/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f0f2f5;
    color: #1c1e21;
    padding-top: 60px;
    padding-bottom: 60px;
}

/* Login */
.login-body {
    background: linear-gradient(135deg, #FF5252 0%, #FFD740 25%, #69F0AE 50%, #448AFF 100%);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.login-logo img {
    max-width: 200px;
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 15px;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.login-btn {
    background: linear-gradient(to right, #FF5252, #FFD740);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 5px;
    width: 100%;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 15px;
}

.login-users {
    font-size: 14px;
    color: #65676b;
}

.error-message {
    color: #FF5252;
    margin-bottom: 15px;
}

/* Header */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.logo {
    height: 30px;
}

.header-right {
    display: flex;
    align-items: center;
}

.header-icon {
    font-size: 20px;
    margin-right: 15px;
    cursor: pointer;
}

.profile-menu {
    position: relative;
}

.profile-pic {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
}

.profile-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 45px;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    width: 150px;
    z-index: 1001;
}

.profile-dropdown a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #1c1e21;
    border-bottom: 1px solid #eee;
}

.profile-dropdown a:last-child {
    border-bottom: none;
}

.profile-menu:hover .profile-dropdown {
    display: block;
}

/* Container principal */
.container {
    max-width: 100%;
    padding: 10px;
}

/* Criação de post */
.post-create {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.post-create-header {
    display: flex;
    align-items: center;
}

.profile-pic-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}

.post-create-input {
    flex: 1;
    background: #f0f2f5;
    border-radius: 20px;
    padding: 10px 15px;
    color: #65676b;
    cursor: pointer;
}

/* Stories */
.stories-container {
    margin-bottom: 15px;
    overflow-x: auto;
    white-space: nowrap;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch; /* Suaviza a rolagem no iOS */
}

.stories-scroll {
    display: inline-flex;
    padding: 0 10px;
}

.story-item {
    display: inline-block;
    text-align: center;
    margin-right: 15px;
    cursor: pointer;
}

.story-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(45deg, #FF5252, #FFD740, #69F0AE, #448AFF);
    position: relative;
    margin-bottom: 5px;
}

.story-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
}

.add-story {
    background: #e4e6eb;
}

.add-icon {
    position: absolute;
    bottom: 0;
    right: 0;
    background: #448AFF;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    font-weight: bold;
}

.story-username {
    font-size: 12px;
    color: #65676b;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Stories em formato de cards */
.stories-section-title {
    margin: 15px 0 10px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.stories-cards-container {
    margin-bottom: 20px;
    overflow: hidden;
}

.stories-cards-wrapper {
    display: flex;
    overflow-x: auto;
    padding: 10px 0;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.stories-cards-wrapper::-webkit-scrollbar {
    display: none;
}

.story-card {
    position: relative;
    width: 100px;
    height: 180px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.story-card:hover {
    transform: scale(1.03);
}

.story-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.85);
}

.story-card-content {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 15px;
    color: white;
}

.add-story-card .story-card-bg {
    background: linear-gradient(135deg, #FF5252 0%, #FFD740 25%, #69F0AE 50%, #448AFF 100%);
}

.add-story-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    color: #448AFF;
    margin-bottom: 10px;
}

.add-story-text {
    font-weight: 600;
    font-size: 13px;
    text-align: center;
}

.story-card-user-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid white;
    object-fit: cover;
    margin-bottom: 10px;
}

.story-card-user {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    font-weight: 600;
    font-size: 12px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.story-card-user img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid white;
    object-fit: cover;
    margin-bottom: 5px;
}

.story-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, #FF5252, #FFD740, #69F0AE, #448AFF);
    animation: progressAnimation 24s linear;
}

@keyframes progressAnimation {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* Story Viewer em tela cheia */
.story-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: none;
    flex-direction: column;
}

.story-viewer.active {
    display: flex;
}

.story-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    color: white;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent);
    z-index: 10;
}

.story-viewer-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.story-viewer-user img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
}

.story-viewer-time {
    font-size: 14px;
    opacity: 0.8;
}

.story-viewer-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.story-viewer-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.story-viewer-content {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
}

.story-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
}

.story-prev-btn {
    left: 20px;
}

.story-next-btn {
    right: 20px;
}

.story-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.story-display {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.story-display img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.story-progress-bars {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    gap: 4px;
    z-index: 10;
}

.story-progress-bar {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
    overflow: hidden;
}

.story-progress-bar.active {
    background: rgba(255, 255, 255, 0.6);
}

.story-progress-bar.active::after {
    content: '';
    display: block;
    height: 100%;
    width: 0%;
    background: white;
    animation: storyProgress 5s linear forwards;
}

.story-progress-bar.completed {
    background: white;
}

@keyframes storyProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

.story-viewer-reactions {
    padding: 15px;
    display: flex;
    gap: 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    z-index: 10;
}

.story-viewer-reactions input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.story-viewer-reactions input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.story-reaction-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.story-reaction-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Feed de postagens */
.post {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.post-user {
    font-weight: bold;
    margin-right: 10px;
}

.post-time {
    font-size: 12px;
    color: #65676b;
}

.post-content {
    margin-bottom: 10px;
    line-height: 1.4;
}

.post-media {
    margin-bottom: 10px;
}

.post-media img, .post-media video {
    width: 100%;
    border-radius: 10px;
}

.post-actions {
    display: flex;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    padding: 10px 0;
    margin-bottom: 10px;
}

.reaction-btn, .comment-btn {
    flex: 1;
    text-align: center;
    padding: 5px;
    cursor: pointer;
}

.comment-input {
    display: flex;
    margin-top: 10px;
}

.comment-input input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    margin-right: 10px;
}

.comment-input button {
    background: #448AFF;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 15px;
    cursor: pointer;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1002;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
    resize: vertical;
    min-height: 100px;
}

.modal button[type="submit"] {
    background: #448AFF;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
}

.story-viewer {
    background: transparent;
    padding: 0;
    height: 80%;
    max-width: 100%;
}

#storyContent {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#storyContent img {
    max-height: 100%;
    max-width: 100%;
    border-radius: 10px;
}

/* Estilos para o modal de story */
.story-preview {
    margin: 15px 0;
    text-align: center;
}

.story-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
}

.add-story-btn {
    background: linear-gradient(to right, #FF5252, #FFD740);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    width: 100%;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
}

/* Melhorias para formulários em mobile */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px dashed #ddd;
    border-radius: 5px;
    background: #f9f9f9;
}

/* Estilos para reações e comentários */
.post-stats {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
}
.reactions-count, .comments-count {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #65676b;
}
.reaction-icon, .comment-icon {
    margin-right: 5px;
}
.post-actions {
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
}
.reaction-buttons {
    display: flex;
    gap: 5px;
}
.reaction-btn, .comment-toggle-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}
.reaction-btn:hover, .comment-toggle-btn:hover {
    background-color: #f0f2f5;
}
.reaction-btn.active {
    background-color: #e7f3ff;
    color: #1877f2;
}
.post-comments {
    padding: 10px 0;
}
.comments-list {
    margin-bottom: 10px;
}
.comment {
    display: flex;
    margin-bottom: 10px;
}
.profile-pic-xs {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    flex-shrink: 0;
}
.comment-content {
    flex: 1;
    background: #f0f2f5;
    border-radius: 18px;
    padding: 8px 12px;
}
.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}
.comment-user {
    font-weight: bold;
    font-size: 13px;
}
.comment-time {
    font-size: 11px;
    color: #65676b;
}
.comment-text {
    font-size: 14px;
    line-height: 1.4;
}
.comment-input {
    display: flex;
    align-items: center;
    margin-top: 10px;
}
.comment-input input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 18px;
    margin: 0 10px;
    font-size: 14px;
}
.comment-submit-btn {
    background: #448AFF;
    color: white;
    border: none;
    border-radius: 18px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
}

/* Melhorias para o chat coletivo */
.group-chat-container {
    height: calc(100vh - 150px);
    display: flex;
    flex-direction: column;
    background: #f0f2f5;
}

#groupMessages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: white;
}

.message {
    margin-bottom: 15px;
    max-width: 85%;
}

.message.sent {
    margin-left: auto;
}

.message.received {
    margin-right: auto;
}

.message-sender {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    font-size: 14px;
}

.message-sender img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 8px;
}

.message-sender span {
    font-weight: 600;
    color: #385898;
}

.message-content {
    padding: 10px 14px;
    border-radius: 18px;
    display: inline-block;
    word-wrap: break-word;
    max-width: 100%;
}

.message.sent .message-content {
    background-color: #0084ff;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.received .message-content {
    background-color: #f0f0f0;
    color: #333;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 11px;
    color: #65676b;
    margin-top: 4px;
    text-align: right;
}

.message.received .message-time {
    text-align: left;
}

.message-input-container {
    padding: 12px 15px;
    background: white;
    border-top: 1px solid #dddfe2;
    display: flex;
    align-items: center;
    gap: 10px;
}

.message-input-container input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #dddfe2;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
}

.message-input-container input:focus {
    border-color: #0084ff;
}

.message-input-container button {
    background: #0084ff;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.message-input-container button:hover {
    background: #0066cc;
}

.message-input-container button:disabled {
    background: #ccd0d5;
    cursor: not-allowed;
}

/* Indicador de digitação */
.typing-indicator {
    padding: 8px 15px;
    font-size: 12px;
    color: #65676b;
    font-style: italic;
    display: none;
}

.typing-indicator.visible {
    display: block;
}

/* Scroll personalizado */
#groupMessages::-webkit-scrollbar {
    width: 6px;
}

#groupMessages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#groupMessages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#groupMessages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Notificação de novas mensagens */
.new-messages-indicator {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: #0084ff;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 100;
}

.new-messages-indicator.visible {
    display: block;
}

/* Melhorias para o mensageiro */
.messenger-container {
    display: flex;
    height: calc(100vh - 150px);
    background: #f0f2f5;
}

.users-list {
    width: 350px;
    border-right: 1px solid #e4e6eb;
    overflow-y: auto;
    background: white;
    display: flex;
    flex-direction: column;
}

.users-list-header {
    padding: 16px;
    border-bottom: 1px solid #e4e6eb;
    background: #f8f9fa;
}

.users-list-header h3 {
    margin: 0 0 12px 0;
    color: #1c1e21;
    font-size: 18px;
    font-weight: 600;
}

.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 1px solid #e4e6eb;
    border-radius: 18px;
    background: #f0f2f5;
    font-size: 14px;
    outline: none;
}

.search-box input:focus {
    background: white;
    border-color: #0084ff;
}

.search-box span {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #65676b;
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
}

.conversation-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 72px;
}

.conversation-item:hover {
    background-color: #f5f6f8;
}

.conversation-item.active {
    background-color: #e7f3ff;
    border-right: 3px solid #0084ff;
}

.conversation-avatar {
    position: relative;
    flex-shrink: 0;
    margin-right: 12px;
}

.conversation-avatar img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e4e6eb;
}

.conversation-item.active .conversation-avatar img {
    border-color: #0084ff;
}

.unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff3b30;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid white;
}

.conversation-info {
    flex: 1;
    min-width: 0; /* Permite que o texto quebre corretamente */
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.conversation-name {
    font-weight: 600;
    font-size: 15px;
    color: #1c1e21;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.conversation-time {
    font-size: 12px;
    color: #65676b;
    flex-shrink: 0;
    margin-left: 8px;
}

.conversation-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.preview-text {
    font-size: 13px;
    color: #65676b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.conversation-item.active .preview-text {
    color: #1c1e21;
    font-weight: 500;
}

.no-messages {
    font-size: 13px;
    color: #8a8d91;
    font-style: italic;
}

.sent-indicator {
    color: #0084ff;
    font-size: 14px;
    flex-shrink: 0;
    margin-left: 6px;
}

/* Chat container melhorado */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f0f2f5;
}

.chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e4e6eb;
    display: flex;
    align-items: center;
    background: white;
}

.chat-header img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
}

.chat-user {
    font-weight: 600;
    font-size: 16px;
    color: #1c1e21;
}

.messages-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f0f2f5;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message {
    max-width: 65%;
    padding: 8px 0;
}

.message.sent {
    align-self: flex-end;
}

.message.received {
    align-self: flex-start;
}

.message-content {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.sent .message-content {
    background: linear-gradient(135deg, #0084ff, #0066cc);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.received .message-content {
    background: white;
    color: #1c1e21;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-time {
    font-size: 11px;
    color: #65676b;
    margin-top: 4px;
    padding: 0 8px;
}

.message.sent .message-time {
    text-align: right;
}

.message.received .message-time {
    text-align: left;
}

.message-input-container {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e4e6eb;
    display: flex;
    align-items: center;
    gap: 12px;
}

.message-input-container input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e4e6eb;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    background: #f0f2f5;
}

.message-input-container input:focus {
    background: white;
    border-color: #0084ff;
}

.message-input-container button {
    background: #0084ff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s;
}

.message-input-container button:hover {
    background: #0066cc;
}

.no-chat-selected {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #65676b;
    text-align: center;
    padding: 40px;
}

.no-chat-selected .icon {
    font-size: 48px;
    margin-bottom: 16px;
    color: #ccd0d5;
}

.no-chat-selected h3 {
    font-size: 18px;
    margin: 0 0 8px 0;
    color: #1c1e21;
}

.no-chat-selected p {
    font-size: 14px;
    margin: 0;
    color: #65676b;
}

/* Notificação badge */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff3b30;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Indicador de mensagens não lidas */
.unread-count {
    background: #0084ff;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: auto;
}

/* Responsividade */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .post-create-input {
        font-size: 14px;
    }
    
    .story-avatar {
        width: 50px;
        height: 50px;
    }
    .reaction-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .reaction-btn, .comment-toggle-btn {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .comment-input {
        flex-direction: column;
        align-items: stretch;
    }
    
    .comment-input img {
        align-self: flex-start;
        margin-bottom: 5px;
    }
    
    .comment-input input {
        margin: 5px 0;
    }
    
    .comment-submit-btn {
        align-self: flex-end;
    }
    /* Responsividade para mobile */
    .story-card {
        width: 90px;
        height: 160px;
    }
    
    .story-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .story-prev-btn {
        left: 10px;
    }
    
    .story-next-btn {
        right: 10px;
    }
    
    .story-viewer-reactions {
        padding: 10px;
    }

/* Responsividade para mobile */
@media (max-width: 480px) {
    .group-chat-container {
        height: calc(100vh - 130px);
    }
    
    .message {
        max-width: 90%;
    }
    
    .message-input-container {
        padding: 10px;
    }
    
    .message-input-container input {
        padding: 10px 12px;
    }
    
    .message-input-container button {
        padding: 10px 15px;
    }
}
}

/* Responsividade para mobile */
@media (max-width: 768px) {
    .messenger-container {
        flex-direction: column;
        height: calc(100vh - 130px);
    }
    
    .users-list {
        width: 100%;
        height: 40%;
        border-right: none;
        border-bottom: 1px solid #dddfe2;
    }
    
    .chat-container {
        width: 100%;
        height: 60%;
    }
    
    .message {
        max-width: 85%;
    }
}

@media (max-width: 480px) {
    .user-item {
        padding: 10px;
    }
    
    .message-input-container {
        padding: 10px;
    }
    
    .message-input-container input {
        padding: 10px 12px;
    }
    
    .message-input-container button {
        padding: 10px 15px;
    }
}
}

/* Animações suaves */
.conversation-item {
    transition: all 0.2s ease;
}

.message {
    animation: messageAppear 0.3s ease;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll personalizado */
.conversations-list::-webkit-scrollbar,
.messages-container::-webkit-scrollbar {
    width: 6px;
}

.conversations-list::-webkit-scrollbar-track,
.messages-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.conversations-list::-webkit-scrollbar-thumb,
.messages-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.conversations-list::-webkit-scrollbar-thumb:hover,
.messages-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
}

/* Estilos para feedback de mensagem */
.message-input-container input:invalid {
    border-color: #ff3b30;
}

.message-input-container input:focus:invalid {
    border-color: #ff3b30;
    box-shadow: 0 0 0 2px rgba(255, 59, 48, 0.2);
}

.loading-indicator {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0084ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background: #ff3b30;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 14px;
}

.success-message {
    background: #4cd964;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 14px;
}