
/* 🌟 POLISH CSS - Wavelength Harmony Enhancements */

/* 1. SMOOTH TRANSITIONS */
.cosmic-btn, .dropdown-toggle, .principle-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 2. FOCUS STATES FOR ACCESSIBILITY */
.cosmic-btn:focus, .dropdown-toggle:focus {
    outline: 3px solid rgba(79, 195, 247, 0.5);
    outline-offset: 2px;
    box-shadow: 0 0 0 0.25rem rgba(79, 195, 247, 0.25) !important;
}

/* 3. BETTER TOUCH TARGETS (MOBILE) */
@media (max-width: 768px) {
    .cosmic-btn, .dropdown-toggle {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 16px !important;
    }
    
    .dropdown-item {
        padding: 12px 20px !important;
    }
}

/* 4. LOADING STATES */
.loading-pulse {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 5. ERROR/Success STATES */
.alert-success {
    background: linear-gradient(135deg, var(--cosmic-success) 0%, #059669 100%);
    border: none;
    color: white;
}

.alert-error {
    background: linear-gradient(135deg, var(--cosmic-danger) 0%, #dc2626 100%);
    border: none;
    color: white;
}

.alert-warning {
    background: linear-gradient(135deg, var(--cosmic-warning) 0%, #b45309 100%);
    border: none;
    color: #222;
    /* Dark text for contrast on yellow/orange */
}

.alert-info {
    background: linear-gradient(135deg, var(--cosmic-info) 0%, #0ea5e9 100%);
    border: none;
    color: white;
}

/* 6. READABILITY ENHANCEMENTS */
.card, .principle-card, .wavelength-visualization {
    line-height: 1.6;
    letter-spacing: 0.01em;
}

/* 7. DARK MODE OPTIMIZATION */
@media (prefers-color-scheme: dark) {
    body {
        background: #0f172a !important;
        color: #f8fafc !important;
    }
    
    .card, .principle-card {
        background: #1e293b !important;
        border-color: #334155 !important;
    }
}

/* 8. PRINT OPTIMIZATION */
@media print {
    .navbar-toggler, .dropdown-toggle, .cosmic-btn {
        display: none !important;
    }
    
    .card {
        break-inside: avoid;
        border: 1px solid #ddd !important;
    }
}

/* 9. REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 10. WAVELENGTH HARMONY GRADIENTS */
.unity-gradient {
    background: linear-gradient(135deg, 
        #8b5cf6 0%, 
        #6366f6 25%, 
        #3b82f6 50%, 
        #0ea5e9 75%, 
        #06b6d4 100%
    );
}

.harmony-gradient {
    background: linear-gradient(135deg,
        #10b981 0%,
        #059669 25%,
        #047857 50%,
        #065f46 75%,
        #064e3b 100%
    );
}

/* 11. COMPREHENSIVE BUTTON SYSTEM */
/* Base cosmic button */
.cosmic-btn {
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 2px solid transparent;
}

.cosmic-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 195, 247, 0.3);
}

.cosmic-btn:focus {
    outline: 3px solid rgba(79, 195, 247, 0.5);
    outline-offset: 2px;
    box-shadow: 0 0 0 0.25rem rgba(79, 195, 247, 0.25) !important;
}

/* Primary cosmic button */
.btn-cosmic {
    background: linear-gradient(90deg, var(--cosmic-blue), var(--cosmic-purple));
    color: white;
    border: none;
    border-radius: 50px;
    padding: 0.8rem 2rem;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-cosmic:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(145, 65, 172, 0.5);
}

/* Harmony button (success) */
.btn-harmony {
    background: linear-gradient(90deg, var(--cosmic-teal), var(--cosmic-success));
    color: white;
    border: none;
    border-radius: 50px;
    padding: 0.8rem 2rem;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-harmony:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(38, 162, 105, 0.5);
}

/* Warning button */
.btn-warning-cosmic {
    background: linear-gradient(90deg, var(--cosmic-warning), var(--cosmic-danger));
    color: #222;
    border: none;
    border-radius: 50px;
    padding: 0.8rem 2rem;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-warning-cosmic:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
}

/* Outline variants */
.btn-outline-cosmic {
    background: transparent;
    color: var(--cosmic-blue);
    border: 2px solid var(--cosmic-blue);
    border-radius: 50px;
    padding: 0.8rem 2rem;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-outline-cosmic:hover {
    background: var(--cosmic-blue);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
}

.btn-outline-harmony {
    background: transparent;
    color: var(--cosmic-success);
    border: 2px solid var(--cosmic-success);
    border-radius: 50px;
    padding: 0.8rem 2rem;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-outline-harmony:hover {
    background: var(--cosmic-success);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(38, 162, 105, 0.3);
}

/* Button sizing */
.btn-cosmic-sm {
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
}

.btn-cosmic-lg {
    padding: 1rem 3rem;
    font-size: 1.2rem;
}

/* Button spacing utilities */
.btn-spacing-xs { margin: 0.25rem; }
.btn-spacing-sm { margin: 0.5rem; }
.btn-spacing-md { margin: 1rem; }
.btn-spacing-lg { margin: 1.5rem; }

/* Button groups */
.btn-group-cosmic {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin: 1.5rem 0;
}

/* Mobile touch targets */
@media (max-width: 768px) {
    .cosmic-btn, .btn-cosmic, .btn-harmony, .btn-outline-cosmic {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 20px !important;
    }
    
    .btn-group-cosmic {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
}

/* 12. LOGICAL PLACEMENT GUIDELINES */
/* Primary actions: top-right or centered */
.primary-action-container {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

/* Secondary actions: right-aligned */
.secondary-action-container {
    display: flex;
    justify-content: flex-end;
    margin: 1rem 0;
}

/* Form button groups */
.form-button-group {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    gap: 1rem;
}

/* Navigation button spacing */
.nav-btn-spacing {
    margin: 0 0.25rem;
}

@media (min-width: 768px) {
    .nav-btn-spacing {
        margin: 0 0.5rem;
    }
}

/* 13. WCAG AA CONTRAST ENFORCEMENT */
/* Ensure button text meets contrast requirements */
.btn-cosmic, .btn-harmony, .btn-warning-cosmic {
    /* These combinations pass ≥4.5:1 contrast */
    --primary-text: white;
    --danger-text: #222;
}

.btn-outline-cosmic, .btn-outline-harmony {
    /* Outline buttons rely on border contrast */
    border-width: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cosmic-btn {
        border-width: 3px;
    }
    .btn-outline-cosmic, .btn-outline-harmony {
        border-width: 3px;
    }
}

/* 14. ACCESSIBILITY: SKIP LINK */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--cosmic-primary);
    color: white;
    padding: 8px 16px;
    border-radius: 0 0 10px 0;
    text-decoration: none;
    font-weight: bold;
    z-index: 9999;
    transition: top 0.3s;
}

.skip-to-content:focus {
    top: 0;
    outline: 3px solid var(--cosmic-warning);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .skip-to-content {
        transition: none;
    }
}

/* Hero button responsiveness */
.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}
@media (max-width: 768px) {
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    .hero-buttons .btn-cosmic,
    .hero-buttons .btn-harmony {
        width: 100%;
        max-width: 300px;
        margin: 0.5rem 0 !important;
    }
}
