/* Central Bank Watch - Mode Toggle Styles */

/* Toggle Container - Small and Top Right */
#mode-toggle-container {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 6px 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(30, 41, 59, 0.08);
    transition: all 0.3s ease;
}

#mode-toggle-container:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

/* Toggle Wrapper - Compact */
.mode-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mode-toggle-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Toggle Switch Container - Smaller */
.mode-toggle-switch {
    position: relative;
    display: flex;
    background: #f1f5f9;
    border-radius: 6px;
    padding: 2px;
    min-width: 120px;
    border: 1px solid #e2e8f0;
}

/* Toggle Options - Compact */
.mode-toggle-option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 500;
    color: #64748b; /* Default gray color for inactive */
    flex: 1;
    z-index: 3; /* Higher z-index to ensure clickability */
}

.mode-toggle-option span {
    transition: color 0.2s ease;
    color: inherit; /* Inherit from parent */
}

/* Active state - white text on blue background */
.mode-toggle-option.active {
    color: #ffffff !important;
    font-weight: 600;
}

.mode-toggle-option.active span {
    color: #ffffff !important;
}

/* Hover state for inactive options */
.mode-toggle-option:hover:not(.active) {
    color: #475569;
    background: rgba(255, 255, 255, 0.5);
}

/* Animated Slider - Smaller */
.mode-toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(50% - 2px);
    height: calc(100% - 4px);
    background: linear-gradient(135deg, #2563eb 0%, #1e293b 100%);
    border-radius: 4px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.3);
    z-index: 1;
    transform: translateX(0%);
}

/* Mode-specific body classes */
body.mode-beginner .beginner-indicator {
    display: block !important;
}

body.mode-expert .expert-indicator {
    display: block !important;
}

/* Content transition effects */
.content-visible {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.content-hidden {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

/* Mode switching animation */
body.mode-switching {
    pointer-events: none;
}

body.mode-switching * {
    transition: all 0.3s ease !important;
}

/* First-time hint popup */
#mode-hint-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 80px 40px 20px 20px;
    animation: hintFadeIn 0.3s ease;
}

@keyframes hintFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.mode-hint-popup {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-width: 320px;
    overflow: hidden;
    animation: hintSlideIn 0.4s ease;
}

@keyframes hintSlideIn {
    from { 
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.hint-header {
    background: linear-gradient(135deg, #2563eb 0%, #1e293b 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hint-header i {
    font-size: 1.25rem;
    color: #fbbf24;
}

.hint-header h4 {
    margin: 0;
    font-family: 'Roboto Slab', serif;
    font-size: 1rem;
    font-weight: 600;
}

.hint-content {
    padding: 20px;
}

.hint-content p {
    margin: 0 0 12px 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #475569;
}

.hint-content ul {
    margin: 12px 0;
    padding-left: 16px;
}

.hint-content li {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 6px;
}

.hint-footer {
    padding: 0 20px 20px 20px;
}

.btn-hint-close {
    background: #2563eb;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    width: 100%;
}

.btn-hint-close:hover {
    background: #1d4ed8;
}

/* Arrow pointing to toggle */
.hint-arrow {
    position: absolute;
    top: -8px;
    right: 40px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
}

/* Responsive design - Mobile optimizations */
@media (max-width: 768px) {
    #mode-toggle-container {
        top: 8px;
        right: 8px;
        padding: 4px 6px;
    }
    
    .mode-toggle-switch {
        min-width: 100px;
    }
    
    .mode-toggle-option {
        padding: 3px 6px;
        font-size: 0.6rem;
    }
    
    #mode-hint-overlay {
        padding: 60px 15px 20px 15px;
    }
    
    .mode-hint-popup {
        max-width: 260px;
    }
}

@media (max-width: 480px) {
    .mode-toggle-switch {
        min-width: 90px;
    }
    
    .mode-toggle-label {
        display: none; /* Hide label on very small screens */
    }
    
    .mode-toggle-wrapper {
        gap: 0;
    }
    
    #mode-toggle-container {
        padding: 3px 5px;
    }
    
    .mode-toggle-option {
        font-size: 0.55rem;
        padding: 3px 4px;
    }
}

/* Integration with existing design system */
:root {
    --mode-toggle-primary: #2563eb;
    --mode-toggle-navy: #1e293b;
    --mode-toggle-gray: #475569;
    --mode-toggle-light: #f1f5f9;
    --mode-toggle-border: #e2e8f0;
}

/* Impact on page design */
.simple-explanation {
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
    border: 1px solid #7dd3fc;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.simple-explanation:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.simple-explanation h4 {
    color: var(--info);
    margin-top: 0;
    margin-bottom: 1rem;
    font-weight: 600;
}

.simple-explanation h6 {
    color: var(--info);
    margin-bottom: 1rem;
    font-weight: 600;
}

.simple-explanation p:last-child {
    margin-bottom: 0;
}

.technical-details {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.technical-details h6 {
    color: var(--navy);
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Ensure toggle doesn't interfere with existing content */
.header,
.nav-breadcrumb,
.main-wrapper {
    position: relative;
    z-index: 10;
}

/* Special positioning for pages with different layouts */
body.legal-page #mode-toggle-container,
body.help-page #mode-toggle-container {
    display: none; /* Hide on legal/help pages as requested */
}