/* Additional Styles for Enhanced User Experience */

/* Enhanced Card Hover Effects */
.card {
    position: relative;
    overflow: hidden;
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.card:hover::after {
    transform: translateX(100%);
}

/* Enhanced Icon Animations */
.card-icon {
    position: relative;
}

.card-icon::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover .card-icon::before {
    opacity: 1;
}

/* Floating Animation for Cards */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.card:hover {
    animation: float 2s ease-in-out infinite;
}

/* Enhanced Button Styles */
.nav-btn {
    position: relative;
    overflow: hidden;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.nav-btn:hover::before {
    left: 100%;
}

/* Enhanced Modal Styles */
.modal-content {
    position: relative;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #e74c3c, #27ae60, #3498db);
    border-radius: 20px 20px 0 0;
}

/* Enhanced Search Input */
.search-input {
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

.search-input:focus {
    background: rgba(255, 255, 255, 1);
    border-color: #3498db;
    box-shadow: 0 8px 32px rgba(52, 152, 219, 0.2);
}

/* Enhanced Status Bar */
.status-bar {
    position: relative;
    overflow: hidden;
}

.status-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #e74c3c, #27ae60, #3498db);
    animation: statusBarFlow 3s ease-in-out infinite;
}

@keyframes statusBarFlow {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

/* Enhanced Header */
.header {
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: headerGlow 4s ease-in-out infinite;
}

@keyframes headerGlow {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

/* Enhanced Grid Layout */
.grid-row {
    position: relative;
}

.grid-row::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 49%, rgba(255, 255, 255, 0.1) 50%, transparent 51%);
    background-size: 20px 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.grid-row:hover::before {
    opacity: 1;
}

/* Enhanced Focus States */
.card:focus-within {
    outline: 3px solid #3498db;
    outline-offset: 3px;
    transform: scale(1.02);
}

/* Enhanced Loading States */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.card.loading .loading-overlay {
    opacity: 1;
    pointer-events: all;
}

/* Enhanced Typography */
.main-title {
    background: linear-gradient(45deg, #e74c3c, #c0392b, #e74c3c);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGradient 3s ease-in-out infinite;
}

@keyframes titleGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Enhanced Shadows */
.card {
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.1),
        0 1px 8px rgba(0, 0, 0, 0.05);
}

.card:hover {
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Enhanced Transitions */
.card,
.nav-btn,
.search-input {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Enhanced Mobile Experience */
@media (max-width: 768px) {
    .card {
        margin-bottom: 15px;
    }
    
    .card:hover {
        transform: translateY(-5px) scale(1.01);
    }
    
    .main-title {
        font-size: 2.2rem;
        line-height: 1.2;
    }
    
    .search-input {
        margin: 15px auto;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

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

/* Enhanced Print Styles */
@media print {
    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 2px solid #333;
        margin-bottom: 20px;
    }
    
    .header {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    .main-title {
        color: black !important;
        -webkit-text-fill-color: black !important;
    }
    
    .nav-btn,
    .search-input {
        display: none !important;
    }
}

/* Enhanced Light Mode Support */
@media (prefers-color-scheme: light) {
    body {
        background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #cbd5e1 100%);
    }
    
    .card {
        background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
        color: #1e293b;
        border-color: rgba(255, 255, 255, 0.8);
    }
    
    .card h3 {
        color: #1e293b;
    }
    
    .card p {
        color: #475569;
    }
    
    .header,
    .status-bar {
        background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
        color: #1e293b;
    }
    
    .search-input {
        background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
        color: #1e293b;
        border-color: rgba(59, 130, 246, 0.2);
    }
    
    .search-input::placeholder {
        color: #64748b;
    }
}

/* Enhanced High Contrast Mode */
@media (prefers-contrast: high) {
    .card {
        border: 3px solid #000;
        background: white;
        color: black;
    }
    
    .card-red {
        border-left-color: #d00;
    }
    
    .card-green {
        border-left-color: #0a0;
    }
    
    .main-title {
        color: #d00 !important;
        -webkit-text-fill-color: #d00 !important;
    }
}

/* Enhanced Focus Visible */
.card:focus-visible {
    outline: 3px solid #3498db;
    outline-offset: 3px;
}

.nav-btn:focus-visible {
    outline: 3px solid #2980b9;
    outline-offset: 3px;
}

/* Enhanced Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #e74c3c, #27ae60);
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #c0392b, #229954);
}

/* Enhanced Selection */
::selection {
    background: rgba(52, 152, 219, 0.3);
    color: #2c3e50;
}

::-moz-selection {
    background: rgba(52, 152, 219, 0.3);
    color: #2c3e50;
}
