/* ============================================
   MODERN ENHANCEMENTS - 2025 DESIGN
   ============================================ */

/* 1. RIPPLE EFFECT FOR BUTTONS */
.btn-ripple {
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.btn-ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--ripple-color);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    opacity: 0;
}

.btn-ripple:active::before {
    width: 300px;
    height: 300px;
    opacity: 1;
    transition: width 0.3s, height 0.3s, opacity 0.3s;
}

.btn-ripple:active {
    transform: scale(0.98);
}

/* 2. LOADING SKELETON */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

body.theme-dark .skeleton {
    background: linear-gradient(90deg, #2a2a2a 25%, #1a1a1a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
}

/* 3. TOAST NOTIFICATIONS */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
}

.toast {
    background: var(--surface);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toast-slide-in 0.3s ease-out;
    border-left: 4px solid;
    min-width: 300px;
}

.toast-success { border-left-color: var(--toast-success); }
.toast-error { border-left-color: var(--toast-error); }
.toast-info { border-left-color: var(--toast-info); }
.toast-warning { border-left-color: var(--toast-warning); }

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.toast-success .toast-icon { color: var(--toast-success); }
.toast-error .toast-icon { color: var(--toast-error); }
.toast-info .toast-icon { color: var(--toast-info); }
.toast-warning .toast-icon { color: var(--toast-warning); }

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-muted);
}

.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.05);
}

@keyframes toast-slide-in {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

body.theme-dark .toast {
    background: var(--surface-card);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

body.theme-dark .toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 4. FLOATING ACTION BUTTON */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    border: none;
    box-shadow: 0 8px 24px rgba(15, 136, 214, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.fab:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 12px 32px rgba(15, 136, 214, 0.5);
}

.fab:active {
    transform: scale(0.95);
}

[dir="rtl"] .fab {
    right: auto;
    left: 30px;
}

/* 5. PROGRESS INDICATOR */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--gradient-primary);
    z-index: 10001;
    transform-origin: left;
    transition: transform 0.2s ease;
}

/* 6. GLASSMORPHISM ENHANCEMENT */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* 7. ANIMATED COUNTERS */
.counter {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 8. PARALLAX EFFECT */
.parallax {
    transform: translateZ(0);
    will-change: transform;
}

/* 9. SMOOTH FADE IN ANIMATIONS */
.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 0;
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.fade-in-down {
    animation: fadeInDown 0.6s ease-out forwards;
    opacity: 0;
}

.fade-in-left {
    animation: fadeInLeft 0.6s ease-out forwards;
    opacity: 0;
}

.fade-in-right {
    animation: fadeInRight 0.6s ease-out forwards;
    opacity: 0;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 10. ENHANCED BUTTON STYLES */
.btn-modern {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
}

.btn-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-modern:hover::before {
    left: 100%;
}

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.btn-modern:active {
    transform: translateY(0);
}

/* 11. CARD HOVER ENHANCEMENTS */
.card-modern {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card-modern::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(15, 136, 214, 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.card-modern:hover::after {
    opacity: 1;
}

.card-modern:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(8, 92, 155, 0.25);
}

/* 12. GRADIENT TEXT */
.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 13. SHIMMER EFFECT */
.shimmer {
    background: linear-gradient(90deg, #f0f0f0 0%, #e0e0e0 50%, #f0f0f0 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* 14. PULSE ANIMATION */
.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* 15. SCALE ON HOVER */
.scale-on-hover {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.scale-on-hover:hover {
    transform: scale(1.05);
}

/* 16. DARK MODE TRANSITION */
body.theme-dark * {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* 17. SMOOTH SCROLL INDICATOR */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--gradient-primary);
    z-index: 10001;
    transition: width 0.1s ease;
}

/* 18. LOADING SPINNER */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(15, 136, 214, 0.1);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 19. MODERN INPUT FOCUS */
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(15, 136, 214, 0.1);
    transition: all 0.3s ease;
}

/* 20. RESPONSIVE IMPROVEMENTS */
@media (max-width: 768px) {
    .toast-container {
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
    }
    
    .toast {
        min-width: auto;
    }
    
    .fab {
        bottom: 20px;
        right: 20px;
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    [dir="rtl"] .fab {
        left: 20px;
    }
}

/* 21. ACCESSIBILITY IMPROVEMENTS */
*:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* 22. SMOOTH PAGE TRANSITIONS */
.page-transition {
    animation: pageFadeIn 0.4s ease-out;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

