/* ============================================
   CACTUS CLASH - Authentication Styles
   ============================================ */

/* Auth Modal */
#auth-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#auth-modal.active {
    opacity: 1;
}

.auth-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.auth-modal-content {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1a 100%);
    border: 1px solid rgba(50, 205, 50, 0.3);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 40px rgba(50, 205, 50, 0.1);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

#auth-modal.active .auth-modal-content {
    transform: translateY(0);
}

.auth-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.auth-modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.auth-modal-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-modal-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 28px;
    color: #32CD32;
    margin: 0 0 8px 0;
    text-shadow: 0 0 20px rgba(50, 205, 50, 0.3);
}

.auth-modal-header p {
    color: #888;
    margin: 0;
    font-size: 14px;
}

/* Auth Buttons */
.auth-btn {
    width: 100%;
    padding: 14px 20px;
    border-radius: 10px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-btn-google {
    background: #fff;
    color: #333;
    border: none;
}

.auth-btn-google:hover {
    background: #f5f5f5;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.auth-btn-primary {
    background: linear-gradient(135deg, #32CD32, #228B22);
    color: #000;
    border: none;
    margin-top: 10px;
}

.auth-btn-primary:hover {
    background: linear-gradient(135deg, #3de03d, #2da32d);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(50, 205, 50, 0.4);
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: #555;
    font-size: 12px;
    text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #333, transparent);
}

.auth-divider span {
    padding: 0 16px;
}

/* Form Inputs */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-input-group label {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-input-group input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 16px;
    color: #fff;
    font-size: 15px;
    font-family: 'Rajdhani', sans-serif;
    transition: all 0.2s;
}

.auth-input-group input:focus {
    outline: none;
    border-color: #32CD32;
    box-shadow: 0 0 0 3px rgba(50, 205, 50, 0.1);
}

.auth-input-group input::placeholder {
    color: #555;
}

/* Error Message */
.auth-error {
    background: rgba(255, 100, 100, 0.1);
    border: 1px solid rgba(255, 100, 100, 0.3);
    border-radius: 8px;
    padding: 12px;
    color: #ff6b6b;
    font-size: 14px;
    text-align: center;
}

/* Links */
.auth-link {
    background: none;
    border: none;
    color: #32CD32;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    text-decoration: underline;
    transition: color 0.2s;
}

.auth-link:hover {
    color: #4ae04a;
}

/* Footer */
.auth-modal-footer {
    margin-top: 24px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-modal-footer p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

/* Top Bar Auth Elements */
.auth-login-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #32CD32, #228B22);
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(50, 205, 50, 0.3);
}

.auth-user-info {
    display: none;
    align-items: center;
    gap: 12px;
}

.auth-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #32CD32;
}

.auth-user-name {
    font-weight: 600;
    color: #fff;
}

.auth-logout-btn {
    background: rgba(255, 100, 100, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(255, 100, 100, 0.3);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-logout-btn:hover {
    background: rgba(255, 100, 100, 0.3);
}

/* Guest Badge */
.guest-badge {
    background: rgba(255, 200, 50, 0.2);
    color: #ffc832;
    border: 1px solid rgba(255, 200, 50, 0.3);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Cloud Sync Indicator */
.cloud-sync-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #32CD32;
    opacity: 0.8;
}

.cloud-sync-indicator.syncing {
    color: #ffc832;
}

.cloud-sync-indicator svg {
    width: 14px;
    height: 14px;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-modal-content {
        margin: 20px;
        padding: 24px;
    }
    
    .auth-modal-header h2 {
        font-size: 24px;
    }
}

/* ============================================
   PROFILE EDIT MODAL
   ============================================ */

#profile-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10001;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#profile-modal.active {
    opacity: 1;
}

.profile-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.profile-modal-content {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1a 100%);
    border: 1px solid rgba(50, 205, 50, 0.3);
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 40px rgba(50, 205, 50, 0.1);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
}

#profile-modal.active .profile-modal-content {
    transform: translateY(0) scale(1);
}

.profile-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.profile-modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.profile-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.profile-modal-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    color: #32CD32;
    margin: 0 0 6px 0;
    text-shadow: 0 0 20px rgba(50, 205, 50, 0.3);
}

.profile-modal-header p {
    color: #666;
    margin: 0;
    font-size: 13px;
}

/* Avatar Section */
.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
}

.profile-avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #32CD32;
    overflow: hidden;
    background: rgba(50, 205, 50, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(50, 205, 50, 0.2);
}

.profile-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-placeholder {
    color: #32CD32;
    opacity: 0.5;
}

.profile-avatar-note {
    font-size: 11px;
    color: #555;
    margin-top: 8px;
}

/* Form */
.profile-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-input-group label {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-input-group input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 16px;
    color: #fff;
    font-size: 16px;
    font-family: 'Rajdhani', sans-serif;
    transition: all 0.2s;
}

.profile-input-group input:focus {
    outline: none;
    border-color: #32CD32;
    box-shadow: 0 0 0 3px rgba(50, 205, 50, 0.1);
}

.profile-input-hint {
    font-size: 11px;
    color: #555;
}

/* Messages */
.profile-error {
    background: rgba(255, 100, 100, 0.1);
    border: 1px solid rgba(255, 100, 100, 0.3);
    border-radius: 8px;
    padding: 10px;
    color: #ff6b6b;
    font-size: 13px;
    text-align: center;
}

.profile-success {
    background: rgba(50, 205, 50, 0.1);
    border: 1px solid rgba(50, 205, 50, 0.3);
    border-radius: 8px;
    padding: 10px;
    color: #32CD32;
    font-size: 13px;
    text-align: center;
}

/* Buttons */
.profile-buttons {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.profile-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 8px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.profile-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #888;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.profile-btn-primary {
    background: linear-gradient(135deg, #32CD32, #228B22);
    color: #000;
    border: none;
}

.profile-btn-primary:hover {
    background: linear-gradient(135deg, #3de03d, #2da32d);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(50, 205, 50, 0.3);
}

.profile-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Edit Button (next to username) */
.auth-edit-btn {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-edit-btn:hover {
    color: #32CD32;
    background: rgba(50, 205, 50, 0.1);
}

.auth-edit-btn svg {
    width: 14px;
    height: 14px;
}
/* ============================================
   EXTENDED PROFILE MODAL
   ============================================ */

.profile-modal-extended {
    max-width: 520px !important;
    max-height: 85vh;
    overflow-y: auto;
}

.profile-modal-extended::-webkit-scrollbar {
    width: 6px;
}
.profile-modal-extended::-webkit-scrollbar-thumb {
    background: rgba(50, 205, 50, 0.3);
    border-radius: 3px;
}

/* Tab Navigation */
.profile-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    padding: 4px;
}

.profile-tab-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: #888;
    font-size: 0.85em;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.profile-tab-btn:hover {
    color: #ccc;
    background: rgba(255,255,255,0.05);
}

.profile-tab-btn.active {
    color: #32CD32;
    background: rgba(50, 205, 50, 0.15);
}

/* Tab Panels */
.profile-tab-panel {
    display: none;
}
.profile-tab-panel.active {
    display: block;
}

/* Row (side-by-side fields) */
.profile-row {
    display: flex;
    gap: 12px;
}
.profile-row .profile-input-group {
    flex: 1;
}

/* Select styling */
.profile-input-group select,
.profile-input-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 0.95em;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.profile-input-group select:focus,
.profile-input-group textarea:focus {
    outline: none;
    border-color: rgba(50, 205, 50, 0.5);
}

.profile-input-group select option {
    background: #1a1a2e;
    color: #fff;
}

.profile-input-group textarea {
    resize: vertical;
    min-height: 50px;
}

/* Checkbox Grid (chips) */
.profile-checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.profile-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    color: #ccc;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.profile-chip:hover {
    border-color: rgba(50, 205, 50, 0.3);
    background: rgba(50, 205, 50, 0.05);
}

.profile-chip input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #32CD32;
}

.profile-chip:has(input:checked) {
    border-color: rgba(50, 205, 50, 0.5);
    background: rgba(50, 205, 50, 0.1);
    color: #32CD32;
}

/* Section description */
.profile-section-desc {
    color: #888;
    font-size: 0.9em;
    margin-bottom: 16px;
}

/* Consent Section */
.profile-consent-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-consent-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.profile-consent-item:hover {
    border-color: rgba(50, 205, 50, 0.2);
}

.profile-consent-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: #32CD32;
    flex-shrink: 0;
}

.profile-consent-item div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-consent-item strong {
    color: #fff;
    font-size: 0.9em;
}

.profile-consent-item span {
    color: #888;
    font-size: 0.8em;
    line-height: 1.3;
}

.profile-privacy-note {
    color: #666;
    font-size: 0.8em;
    margin-top: 16px;
    text-align: center;
}

.profile-privacy-note a {
    color: #32CD32;
    text-decoration: none;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .profile-modal-extended {
        max-width: 95vw !important;
        padding: 20px !important;
    }
    .profile-row {
        flex-direction: column;
        gap: 0;
    }
    .profile-tabs {
        flex-wrap: wrap;
    }
    .profile-tab-btn {
        font-size: 0.78em;
        padding: 6px 8px;
    }
}