/* Enhanced User Experience Features */

/* Smooth Scrolling Enhancement */
html {
    scroll-behavior: smooth;
}

/* Loading Animation Enhancement */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced Button Interactions */
.cta-button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.cta-button::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 ease;
}

.cta-button:hover::before {
    left: 100%;
}

/* Enhanced Form Elements */
input[type="text"], input[type="email"], textarea {
    transition: all 0.3s ease;
}

input[type="text"]:focus, input[type="email"]:focus, textarea:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.15);
}

/* Enhanced Card Interactions */
.story-card, .comic-panel, .search-result-item {
    transition: all 0.3s ease;
}

.story-card:hover, .comic-panel:hover, .search-result-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

/* Smooth Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Enhanced Search Results */
.search-result-item {
    transition: all 0.3s ease;
    cursor: pointer;
}

.search-result-item:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transform: translateY(-2px);
}

/* Loading States */
.loading-state {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Enhanced Mobile Experience */
@media (max-width: 768px) {
    .search-results-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .search-result-item {
        padding: 15px;
    }
    
    .result-title {
        font-size: 1.1rem;
    }
    
    .result-description {
        font-size: 13px;
    }
}

/* Enhanced Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #007bff;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 6px;
}

/* Enhanced Focus States */
button:focus, input:focus, a:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .search-results-container {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
    
    .search-result-item {
        box-shadow: none;
        border-bottom: 1px solid #dee2e6;
    }
}