/* ===== VARIÁVEIS E RESET ===== */
:root {
    --primary-color: #00ff88;
    --primary-dark: #00cc6a;
    --primary-light: #33ff9c;
    --primary-rgb: 0, 255, 136;

    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --bg-card: #151515;

    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-tertiary: #666666;

    --border-color: #2a2a2a;
    --success-color: #00ff88;
    --danger-color: #ff4444;
    --warning-color: #ffaa00;
    --info-color: #00a8ff;

    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-primary: 0 4px 20px rgba(0, 255, 136, 0.3);

    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 50%;

    --transition: 250ms ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

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

/* ===== HEADER COMPLETO ===== */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.top-bar {
    height: 70px;
}

.top-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 20px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: background var(--transition);
}


.menu-toggle:hover {
    background: var(--bg-secondary);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 700;
}

.logo i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.logo-primary {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 400;
}

.logo-secondary {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 700;
}

/* Menu de Navegação */
.main-navigation {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 5px;
    overflow-x: auto;
    scrollbar-width: none;
}

.nav-menu::-webkit-scrollbar {
    display: none;
}

.nav-item {
    flex-shrink: 0;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.nav-item a:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-item.active a {
    color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.1);
}

.nav-item a i {
    font-size: 1.1rem;
}

/* User Section */
.user-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.notification-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-md);
    position: relative;
    transition: background var(--transition);
}

.notification-btn:hover {
    background: var(--bg-secondary);
}

.notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--danger-color);
    color: white;
    font-size: 0.7rem;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-weight: 600;
}

.quick-action-btn {
    background: var(--primary-color);
    color: var(--bg-primary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all var(--transition);
}

.quick-action-btn:hover {
    background: var(--primary-dark);
    transform: rotate(90deg);
}

.profile-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-lg);
    transition: all var(--transition);
}

.profile-toggle:hover {
    background: var(--bg-secondary);
    transform: scale(1.05);
}

.profile-avatar {
    position: relative;
}

.profile-avatar img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid transparent;
    transition: border-color var(--transition);
}

.profile-toggle:hover .profile-avatar img {
    border-color: var(--primary-color);
}

.user-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--success-color);
    border: 2px solid var(--bg-card);
}

.profile-info {
    text-align: left;
}

.profile-name {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
}

.profile-level {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ===== CONTEÚDO PRINCIPAL ===== */
.main-content {
    margin-top: 140px;
    padding: 30px 0;
    min-height: calc(100vh - 200px);
}

/* Header dos Sonhos */
.dreams-header {
    margin-bottom: 40px;
    text-align: center;
}

.dreams-title {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.dreams-subtitle {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

/* Botão Criar Novo Sonho */
.create-dream-btn {
    text-align: center;
    margin-bottom: 40px;
}

/* Grid de Sonhos */
.dreams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* Card de Sonho */
.dream-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
    position: relative;
}

.dream-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.dream-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.dream-content {
    padding: 20px;
}

.dream-title {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--text-primary);
    line-height: 1.3;
}

.dream-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.dream-date {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 20px;
}

.dream-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Botão de Excluir */
.delete-btn {
    background: rgba(255, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(255, 68, 68, 0.3);
}

.delete-btn:hover {
    background: rgba(255, 68, 68, 0.2);
    color: var(--danger-color);
}

/* ===== BOTÕES ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
}

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

.btn-secondary:hover {
    background: rgba(var(--primary-rgb), 0.1);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
}

/* ===== MODAL DO SONHO ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    padding: 20px;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 30px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-20px);
    transition: transform var(--transition);
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}

.modal-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 5px;
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

/* Formulário Simples */
.dream-form {
    display: grid;
    gap: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

/* Upload de Imagem */
.image-upload {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}

.image-upload:hover {
    border-color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.05);
}

.image-upload i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.image-upload p {
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.image-upload .btn-sm {
    margin-top: 10px;
}

.image-preview {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-top: 15px;
    display: none;
}

.image-preview.active {
    display: block;
}

/* ===== MENSAGENS ===== */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bg-card);
    border-left: 4px solid var(--info-color);
    padding: 15px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 3000;
    transform: translateX(100%);
    opacity: 0;
    transition: all var(--transition);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--danger-color);
}

.toast.warning {
    border-left-color: var(--warning-color);
}

.toast-icon {
    font-size: 1.25rem;
}

.toast.success .toast-icon {
    color: var(--success-color);
}

.toast.error .toast-icon {
    color: var(--danger-color);
}

.toast.warning .toast-icon {
    color: var(--warning-color);
}

.toast.info .toast-icon {
    color: var(--info-color);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.toast-message {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.toast-close:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

/* ===== FOOTER ===== */
.main-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.footer-logo i {
    font-size: 1.5rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-copyright {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 992px) {
    .menu-toggle {
        display: block;
    }

    .main-navigation {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(15px);
        border-top: 1px solid var(--border-color);
        border-bottom: 1px solid var(--border-color);
        padding: 10px 0;
        z-index: 999;
        transform: translateY(-20px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: all 0.3s ease;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    .main-navigation.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: all;
    }

    .nav-menu {
        flex-direction: column;
        padding: 15px;
    }

    .nav-item a {
        justify-content: space-between;
        padding: 15px;
    }

    .main-content {
        margin-top: 70px;
    }

    .profile-info {
        display: none;
    }

    .dreams-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .dreams-grid {
        grid-template-columns: 1fr;
    }

    .dream-actions {
        flex-direction: column;
    }

    .dream-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .toast {
        left: 20px;
        right: 20px;
        bottom: 20px;
    }

    .image-upload {
        padding: 20px;
    }

    .image-upload i {
        font-size: 2.5rem;
    }
}

/* Modal de Perfil */
.profile-modal .modal-content {
    max-width: 600px;
}

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 30px;
}

.profile-avatar-large {
    position: relative;
    margin-bottom: 20px;
}

.profile-avatar-large img {
    width: 150px;
    height: 150px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 4px solid var(--primary-color);
    box-shadow: var(--shadow-primary);
}

.change-avatar-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition);
}

.change-avatar-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.profile-info-large h2 {
    font-size: 1.75rem;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.profile-info-large .email {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 30px 0;
}

.stat-item-large {
    text-align: center;
    padding: 20px 15px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.stat-item-large:hover {
    transform: translateY(-2px);
    background: rgba(var(--primary-rgb), 0.1);
}

.stat-value-large {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
    line-height: 1;
}

.stat-label-large {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.profile-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.profile-tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition);
    position: relative;
}

.profile-tab:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.profile-tab.active {
    color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.1);
}

.profile-tab.active::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px 3px 0 0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Modal de Trocar Avatar */
.avatar-modal .modal-content {
    max-width: 500px;
}

.avatar-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.avatar-option {
    cursor: pointer;
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 3px solid transparent;
    transition: all var(--transition);
}

.avatar-option:hover {
    transform: scale(1.1);
    border-color: var(--primary-light);
}

.avatar-option.selected {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-primary);
}

.avatar-option img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.upload-avatar {
    text-align: center;
    padding: 30px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    margin: 20px 0;
    cursor: pointer;
    transition: all var(--transition);
}

.upload-avatar:hover {
    border-color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.05);
}

.upload-avatar i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.upload-avatar p {
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.upload-avatar .btn-sm {
    margin-top: 10px;
}

@media (max-width: 480px) {
    .avatar-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-avatar-large img {
        width: 120px;
        height: 120px;
    }

    .profile-stats {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}