/* ==================== AUTENTICACAO E USUARIO ====================  */

/* Tela de Login/Registro */
#authScreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #0a0c0e 0%, #1a1f24 50%, #0a0c0e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

#authScreen.hidden {
    display: none;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    position: relative;
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo .auth-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
}

.auth-logo h1 {
    font-family: 'Teko', 'Segoe UI', sans-serif;
    font-size: 48px;
    letter-spacing: 8px;
    color: #C4C4B0;
    text-shadow: 0 0 20px rgba(196, 196, 176, 0.3);
    margin: 0;
}

/* Formularios de Auth */
.auth-form {
    background: rgba(11, 13, 15, 0.95);
    border: 1px solid #2A2E33;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.auth-form.hidden {
    display: none;
}

.auth-form h2 {
    font-family: 'Teko', 'Segoe UI', sans-serif;
    font-size: 24px;
    letter-spacing: 3px;
    color: #C4C4B0;
    margin: 0 0 25px 0;
    text-align: center;
}

.auth-description {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 12px;
    color: #6A6A5A;
    margin: 0 0 20px 0;
    text-align: center;
}

.auth-input-group {
    margin-bottom: 20px;
}

.auth-input-group input {
    width: 100%;
    padding: 14px 16px;
    background: #1A1F24;
    border: 1px solid #2A2E33;
    border-radius: 8px;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 14px;
    color: #E0E0D0;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.auth-input-group input:focus {
    border-color: #3A4F5C;
    box-shadow: 0 0 0 3px rgba(58, 79, 92, 0.2);
}

.auth-input-group input::placeholder {
    color: #4A4A4A;
}

.auth-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #3A4F5C 0%, #2A3F4C 100%);
    border: 1px solid #4A5F6C;
    border-radius: 8px;
    font-family: 'Teko', 'Segoe UI', sans-serif;
    font-size: 18px;
    letter-spacing: 3px;
    color: #E0E0D0;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-btn:hover {
    background: linear-gradient(135deg, #4A5F6C 0%, #3A4F5C 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(58, 79, 92, 0.3);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.auth-btn.google {
    background: #1A1F24;
    border: 1px solid #2A2E33;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 13px;
    letter-spacing: 1px;
}

.auth-btn.google:hover {
    background: #2A2E33;
    border-color: #3A4F5C;
    transform: translateY(-2px);
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
    color: #4A4A4A;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 11px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #2A2E33;
}

.auth-divider span {
    padding: 0 15px;
}

.auth-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.auth-links a {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 12px;
    color: #5A8FAC;
    text-decoration: none;
    transition: color 0.3s ease;
}

.auth-links a:hover {
    color: #7AAFCC;
}

/* Auth Loading */
.auth-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 12, 14, 0.9);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    z-index: 10;
    border-radius: 12px;
}

.auth-loading span {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 12px;
    color: #6A6A5A;
}

.auth-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #2A2E33;
    border-top-color: #3A4F5C;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== USER PROFILE (Topo da pagina) ==================== */

.user-profile {
    position: fixed;
    top: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(11, 13, 15, 0.9);
    border: 1px solid #2A2E33;
    border-radius: 25px;
    padding: 6px 15px 6px 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 5000;
    backdrop-filter: blur(10px);
}

.user-profile:hover {
    background: rgba(26, 31, 36, 0.95);
    border-color: #3A4F5C;
}

.user-profile.hidden {
    display: none;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #2A2E33;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid #3A4F5C;
}

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

.user-avatar svg {
    width: 20px;
    height: 20px;
    color: #6A6A5A;
}

.user-nickname {
    font-family: 'Teko', 'Segoe UI', sans-serif;
    font-size: 16px;
    letter-spacing: 1px;
    color: #C4C4B0;
}

.user-dropdown-icon {
    color: #6A6A5A;
    transition: transform 0.3s ease;
}

.user-profile:hover .user-dropdown-icon {
    transform: translateY(2px);
}

/* ==================== MODAL OVERLAY ==================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 12, 14, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9500;
    backdrop-filter: blur(5px);
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    background: rgba(11, 13, 15, 0.98);
    border: 1px solid #2A2E33;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #2A2E33;
}

.modal-header h2 {
    font-family: 'Teko', 'Segoe UI', sans-serif;
    font-size: 24px;
    letter-spacing: 3px;
    color: #C4C4B0;
    margin: 0;
}

.modal-header .close-btn {
    width: 32px;
    height: 32px;
    background: none;
    border: 1px solid #3A3F44;
    border-radius: 6px;
    color: #8A8A7A;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
}

.modal-header .close-btn:hover {
    background: #2A2E33;
    color: #C4C4B0;
}

/* Nickname Modal */
.nickname-modal {
    max-width: 380px;
    padding: 30px;
    text-align: center;
}

.nickname-modal h2 {
    font-family: 'Teko', 'Segoe UI', sans-serif;
    font-size: 28px;
    letter-spacing: 3px;
    color: #C4C4B0;
    margin: 0 0 10px 0;
}

.nickname-modal p {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 12px;
    color: #6A6A5A;
    margin: 0 0 25px 0;
}

/* ==================== SETTINGS MODAL ==================== */

.settings-modal {
    max-width: 480px;
}

.settings-tabs {
    display: flex;
    border-bottom: 1px solid #2A2E33;
}

.settings-tab {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    font-family: 'Teko', 'Segoe UI', sans-serif;
    font-size: 16px;
    letter-spacing: 2px;
    color: #6A6A5A;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.settings-tab:hover {
    color: #C4C4B0;
    background: rgba(42, 46, 51, 0.3);
}

.settings-tab.active {
    color: #C4C4B0;
    background: rgba(58, 79, 92, 0.2);
}

.settings-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #3A4F5C;
}

.settings-tab-content {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.tab-panel {
    display: block;
}

.tab-panel.hidden {
    display: none;
}

/* Profile Section */
.profile-section {
    margin-bottom: 20px;
}

.profile-avatar-edit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #2A2E33;
}

.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #2A2E33;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid #3A4F5C;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-preview svg {
    width: 40px;
    height: 40px;
    color: #6A6A5A;
}

.btn-secondary {
    padding: 8px 16px;
    background: #2A2E33;
    border: 1px solid #3A3F44;
    border-radius: 6px;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 12px;
    color: #C4C4B0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #3A3F44;
}

/* Settings Groups */
.settings-group {
    margin-bottom: 20px;
}

.settings-group > label {
    display: block;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 11px;
    color: #8A8A7A;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.settings-group input[type="text"],
.settings-group input[type="email"],
.settings-group input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    background: #1A1F24;
    border: 1px solid #2A2E33;
    border-radius: 6px;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 13px;
    color: #E0E0D0;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.settings-group input:focus {
    border-color: #3A4F5C;
}

.settings-group input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.settings-group select {
    width: 100%;
    padding: 12px 14px;
    background: #1A1F24;
    border: 1px solid #2A2E33;
    border-radius: 6px;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 13px;
    color: #E0E0D0;
    outline: none;
    cursor: pointer;
}

.settings-group select option {
    background: #1A1F24;
    color: #C4C4B0;
}

.input-with-btn {
    display: flex;
    gap: 10px;
}

.input-with-btn input {
    flex: 1;
}

.btn-small {
    padding: 10px 16px;
    background: #3A4F5C;
    border: none;
    border-radius: 6px;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 11px;
    color: #E0E0D0;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-small:hover {
    background: #4A5F6C;
}

/* Slider Groups */
.slider-group label {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
}

.slider-group label span:last-child {
    color: #6A6A5A;
}

.settings-group input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    background: #1A1F24;
    border-radius: 3px;
    outline: none;
    margin-top: 10px;
}

.settings-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #3A4F5C;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
}

.settings-group input[type="range"]::-webkit-slider-thumb:hover {
    background: #4A6F7C;
}

.settings-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #3A4F5C;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Toggle Groups */
.toggle-group label {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    cursor: pointer;
}

.toggle-group label span:first-child {
    color: #C4C4B0;
    font-size: 12px;
}

.toggle-group input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 48px;
    height: 26px;
    background: #1A1F24;
    border-radius: 13px;
    position: relative;
    transition: background 0.3s ease;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #6A6A5A;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-group input[type="checkbox"]:checked + .toggle-slider {
    background: #3A4F5C;
}

.toggle-group input[type="checkbox"]:checked + .toggle-slider::after {
    left: 25px;
    background: #E0E0D0;
}

/* Profile Actions */
.profile-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #2A2E33;
}

.btn-danger {
    width: 100%;
    padding: 12px;
    background: #5C3A3A;
    border: 1px solid #6C4A4A;
    border-radius: 6px;
    font-family: 'Teko', 'Segoe UI', sans-serif;
    font-size: 16px;
    letter-spacing: 2px;
    color: #E0D0D0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: #6C4A4A;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-container {
        padding: 15px;
    }

    .auth-logo h1 {
        font-size: 36px;
    }

    .auth-form {
        padding: 20px;
    }

    .modal-content {
        margin: 10px;
        max-height: 90vh;
    }

    .user-profile {
        top: 10px;
        right: 10px;
        padding: 4px 12px 4px 4px;
    }

    .user-avatar {
        width: 30px;
        height: 30px;
    }

    .user-nickname {
        font-size: 14px;
    }

    .settings-tabs {
        flex-wrap: wrap;
    }

    .settings-tab {
        font-size: 14px;
        padding: 12px 8px;
    }
}
