/* ===== VARIÁVEIS CSS ===== */
:root {
    --primary: #4A90E2;
    --secondary: #50E3C2;
    --accent: #F5A623;
    --bg-light: #F5F7FA;
    --text-dark: #333333;
    --text-light: #666666;
    --border-color: #E0E0E0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    --radius: 8px;
    --transition: all 0.3s ease;
}

/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

/* ===== TIPOGRAFIA ===== */
h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 32px;
    font-weight: bold;
    color: var(--text-dark);
}

h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
}

h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
}

p {
    font-size: 16px;
    color: var(--text-light);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary);
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== HEADER ===== */
header {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: bold;
    color: var(--primary);
}

.nav-menu {
    display: flex;
    gap: 30px;
    align-items: center;
    list-style: none;
}

.nav-menu a {
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
}

.nav-menu a:hover {
    color: var(--primary);
}

.notification-link {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.user-avatar:hover {
    transform: scale(1.1);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* User Dropdown */
.user-menu {
    position: relative;
}

.user-dropdown {
    position: absolute;
    top: 40px;
    /* Alinhado ao fundo do avatar */
    right: 0;
    background: white;
    min-width: 200px;
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    padding: 8px 0;
    z-index: 9999;
    margin-top: 5px;
    border: 1px solid var(--border-color);
    animation: fadeIn 0.2s ease;
}

/* Ponte invisível maior para o mouse não "cair" no buraco */
.user-dropdown::before {
    content: '';
    position: absolute;
    top: -20px;
    right: 0;
    width: 100%;
    height: 20px;
    background: transparent;
}

.user-menu:hover .user-dropdown {
    display: flex;
}

.user-dropdown-item {
    padding: 12px 20px;
    color: var(--text-dark);
    font-size: 14px;
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.user-dropdown-item:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.user-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 5px 0;
}


/* ===== BOTÕES ===== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #3A8BC1;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: var(--secondary);
    border: 2px solid var(--secondary);
}

.btn-secondary:hover {
    background: var(--secondary);
    color: white;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== FORMULÁRIOS ===== */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    transition: var(--transition);
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* ===== LAYOUT PRINCIPAL ===== */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    padding: 30px 0;
}

.feed {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===== CARD DE POSTAGEM ===== */
.post-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    transition: var(--transition);
}

.post-card:hover {
    box-shadow: var(--shadow-lg);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    flex-shrink: 0;
}

.post-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.post-info {
    flex: 1;
}

.post-author {
    font-weight: 600;
    color: var(--text-dark);
}

.post-author a {
    color: var(--primary);
}

.post-time {
    font-size: 12px;
    color: var(--text-light);
}

.post-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.post-content {
    font-size: 16px;
    color: var(--text-dark);
    margin-bottom: 15px;
    line-height: 1.6;
}

.post-content a {
    color: var(--primary);
    text-decoration: underline;
}

.post-image {
    display: block;
    width: 100%;
    margin: 0 0 15px 0;
    border-radius: var(--radius);
    max-height: none;
    object-fit: cover;
    cursor: zoom-in;
}

.post-link-preview {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 15px;
    transition: var(--transition);
}

.post-link-preview:hover {
    border-color: var(--primary);
}

.link-preview-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.link-preview-content {
    padding: 12px;
}

.link-preview-title {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.link-preview-description {
    font-size: 14px;
    color: var(--text-light);
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.post-stats {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: var(--text-light);
}

.post-actions {
    display: flex;
    gap: 10px;
}

.post-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    font-size: 14px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-action-btn:hover {
    color: var(--primary);
}

.post-action-btn.liked {
    color: #FF6B6B;
}

/* ===== FORMULÁRIO DE POSTAGEM ===== */
.post-form-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.post-form-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.post-form-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.post-form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
}

.post-form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.post-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-form-tools {
    display: flex;
    gap: 10px;
}

.post-form-tool-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary);
    font-size: 18px;
    transition: var(--transition);
}

.post-form-tool-btn:hover {
    color: var(--secondary);
    transform: scale(1.1);
}

/* ===== SEÇÃO DE COMENTÁRIOS ===== */
.comments-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.comment {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    flex-shrink: 0;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
    background: var(--bg-light);
    padding: 12px;
    border-radius: var(--radius);
}

.comment-author {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.comment-author a {
    color: var(--primary);
}

.comment-text {
    font-size: 14px;
    color: var(--text-dark);
}

.comment-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    font-size: 12px;
}

.comment-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
}

.comment-action-btn:hover {
    color: var(--primary);
}

/* ===== WIDGET DA SIDEBAR ===== */
.widget {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.widget-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.widget-list {
    list-style: none;
}

.widget-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.widget-item:last-child {
    border-bottom: none;
}

.widget-item a {
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
}

.widget-item a:hover {
    color: var(--primary);
}

/* ===== PERFIL DE USUÁRIO ===== */
.profile-header {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 30px;
}

.profile-cover {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius);
    margin-bottom: -50px;
    position: relative;
}

.profile-info {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: white;
    border: 4px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: bold;
    color: var(--primary);
    flex-shrink: 0;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.profile-details {
    flex: 1;
}

.profile-name {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
}

.profile-username {
    color: var(--text-light);
    font-size: 14px;
}

.profile-bio {
    color: var(--text-dark);
    margin-top: 8px;
}

.profile-stats {
    display: flex;
    gap: 30px;
    margin-top: 15px;
}

.profile-stat {
    text-align: center;
}

.profile-stat-number {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary);
}

.profile-stat-label {
    font-size: 12px;
    color: var(--text-light);
}

.profile-actions {
    display: flex;
    gap: 10px;
}

/* ===== CHAT FLUTUANTE ===== */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    max-height: 500px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.chat-header {
    background: var(--primary);
    color: white;
    padding: 15px;
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-title {
    font-weight: 600;
}

.chat-close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 18px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.chat-message.sent {
    justify-content: flex-end;
}

.chat-message-content {
    max-width: 70%;
    padding: 10px 12px;
    border-radius: var(--radius);
    font-size: 14px;
}

.chat-message.received .chat-message-content {
    background: var(--bg-light);
    color: var(--text-dark);
}

.chat-message.sent .chat-message-content {
    background: var(--primary);
    color: white;
}

.chat-input {
    display: flex;
    gap: 10px;
    padding: 15px;
    border-top: 1px solid var(--border-color);
}

.chat-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
}

.chat-input button {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 10px 15px;
    cursor: pointer;
    transition: var(--transition);
}

.chat-input button:hover {
    background: #3A8BC1;
}

.chat-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    z-index: 999;
}

.chat-fab:hover {
    transform: scale(1.1);
    background: #3A8BC1;
}

.chat-fab.hidden {
    display: none;
}

/* ===== NOTIFICAÇÕES ===== */
.notification {
    background: white;
    border-left: 4px solid var(--primary);
    padding: 15px;
    border-radius: var(--radius);
    margin-bottom: 10px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    color: var(--text-dark);
}

.notification-message {
    font-size: 14px;
    color: var(--text-light);
}

/* ===== RESPONSIVO ===== */
@media (max-width: 768px) {
    .main-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .nav-menu {
        display: none;
    }

    .header-content {
        justify-content: space-between;
    }

    .chat-widget {
        width: calc(100% - 40px);
        max-height: 400px;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }

    .profile-info {
        flex-direction: column;
        align-items: center;
    }

    .profile-stats {
        justify-content: center;
    }

    .post-form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .post-card {
        padding: 15px;
    }

    .chat-widget {
        width: calc(100% - 20px);
        bottom: 10px;
        right: 10px;
    }

    .chat-fab {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .profile-avatar {
        width: 80px;
        height: 80px;
    }

    .post-stats {
        font-size: 12px;
    }
}

/* ===== UTILITÁRIOS ===== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-light);
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.gap-20 {
    gap: 20px;
}

.mention {
    color: var(--primary);
    font-weight: 500;
}

.mention:hover {
    text-decoration: underline;
}

/* ===== ANIMAÇÕES ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.slide-up {
    animation: slideUp 0.3s ease;
}

/* ===== MODAL DE IMAGEM (PREMIUM) ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: flex-start;
    /* Permite scroll no topo */
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
    overflow-y: auto;
    /* Scroll para imagens longas */
    padding: 40px 10px;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-container {
    position: relative;
    width: 98%;
    max-width: 1400px;
    /* Permitir zoom bem maior */
    transform: scale(0.95);
    transition: transform 0.3s ease-out;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-image {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    display: block;
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-dark);
    font-weight: bold;
    border: none;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--primary);
    color: white;
    transform: rotate(90deg);
}

/* Cursor pointer para imagens que podem ser ampliadas */
.post-image {
    cursor: pointer;
}