/* ===================================
   Modern Homepage Sections - Fekr Tany
   Ultra Modern & Responsive Design
   =================================== */

/* ============= Events Section ============= */
.events-section {
    scroll-margin-top: 80px;
}

.event-card {
    position: relative;
}

.event-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(0,0,0,0.02) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: 20px;
    pointer-events: none;
}

.event-card:hover::before {
    opacity: 1;
}

/* ============= Team Section ============= */
.team-section {
    scroll-margin-top: 80px;
}

.team-member-card {
    position: relative;
}

.member-icon {
    position: relative;
    overflow: hidden;
}

.member-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.team-member-card:hover .member-icon::after {
    width: 120%;
    height: 120%;
}

/* ============= Books Section ============= */
.books-section {
    scroll-margin-top: 80px;
}

.book-card {
    position: relative;
    overflow: hidden;
}

.book-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 280px;
    background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.book-card:hover::before {
    opacity: 1;
}

/* ============= Blog/Articles Section ============= */
.blog-section {
    scroll-margin-top: 80px;
}

.article-card {
    position: relative;
}

.article-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #45B7D1, #FF9500);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.article-card:hover::after {
    transform: scaleX(1);
}

/* ============= Supplements Section ============= */
.supplements-section {
    scroll-margin-top: 80px;
}

.supplement-card {
    position: relative;
}

.supplement-icon {
    position: relative;
    overflow: hidden;
}

.supplement-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: rotate(45deg);
    transition: all 0.6s ease;
}

.supplement-card:hover .supplement-icon::before {
    left: 100%;
}

/* ============= Newsletter Section ============= */
.newsletter-cta {
    scroll-margin-top: 80px;
    position: relative;
}

#newsletterForm input:focus {
    outline: none;
}

#newsletterForm button:active {
    transform: scale(0.95) !important;
}

/* Floating Animation */
@keyframes float {
    0%, 100% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(10px, -10px);
    }
    50% {
        transform: translate(20px, -20px);
    }
    75% {
        transform: translate(10px, -10px);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(69, 183, 209, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 20px rgba(69, 183, 209, 0);
    }
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ============= Responsive Design ============= */

/* Tablets and Below */
@media (max-width: 1024px) {
    .events-section,
    .team-section,
    .books-section,
    .blog-section,
    .supplements-section,
    .newsletter-cta {
        padding: 4rem 0;
    }
    
    .events-section h2,
    .team-section h2,
    .books-section h2,
    .blog-section h2,
    .supplements-section h2,
    .newsletter-cta h2 {
        font-size: 2rem;
    }
}

/* Mobile Devices */
@media (max-width: 768px) {
    /* Events Section */
    .events-section .container > div:first-child {
        margin-bottom: 3rem;
    }
    
    .events-section .container > div:last-child {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Team Section */
    .team-section .container > div:last-child {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Books Section */
    .books-section .container > div:last-child {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .book-card > div:first-child {
        height: 220px !important;
    }
    
    .book-card h3 {
        font-size: 1.125rem !important;
        min-height: 60px !important;
    }
    
    /* Blog Section */
    .blog-section .container > div:nth-child(2) {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .article-card > div:first-child {
        height: 200px !important;
    }
    
    /* Supplements Section */
    .supplements-section .container > div:nth-child(2) {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Newsletter Section */
    .newsletter-cta h2 {
        font-size: 1.75rem;
    }
    
    .newsletter-cta p {
        font-size: 1rem;
    }
    
    #newsletterForm > div {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    #newsletterForm input {
        padding: 1rem;
        text-align: center;
    }
    
    #newsletterForm button {
        width: 100%;
        justify-content: center;
    }
    
    .newsletter-cta .container > div > div:nth-child(4) {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .events-section,
    .team-section,
    .books-section,
    .blog-section,
    .supplements-section,
    .newsletter-cta {
        padding: 3rem 0;
    }
    
    /* Section Headers */
    .events-section h2,
    .team-section h2,
    .books-section h2,
    .blog-section h2,
    .supplements-section h2,
    .newsletter-cta h2 {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }
    
    .events-section p,
    .team-section p,
    .books-section p,
    .blog-section p,
    .supplements-section p,
    .newsletter-cta p {
        font-size: 0.9375rem;
    }
    
    /* Event Cards */
    .event-card > div {
        flex-direction: column;
        padding: 1.5rem;
        gap: 1.5rem;
    }
    
    .event-card h3 {
        font-size: 1.125rem;
    }
    
    /* Team Cards */
    .team-member-card {
        padding: 2rem 1.5rem;
    }
    
    .member-icon {
        width: 80px !important;
        height: 80px !important;
        font-size: 2rem !important;
    }
    
    .team-member-card h3 {
        font-size: 1.125rem;
    }
    
    /* Book Cards */
    .book-card > div:last-child {
        padding: 2rem 1.5rem;
    }
    
    /* Article Cards */
    .article-card > div:last-child {
        padding: 1.5rem;
    }
    
    .article-card h3 {
        font-size: 1.125rem;
    }
    
    /* Supplement Cards */
    .supplement-card {
        padding: 2rem 1.5rem;
    }
    
    .supplement-icon {
        width: 80px !important;
        height: 80px !important;
    }
    
    .supplement-card h3 {
        font-size: 1.125rem;
    }
    
    /* Newsletter */
    .newsletter-cta .container > div > div:first-child {
        width: 60px !important;
        height: 60px !important;
    }
    
    .newsletter-cta .container > div > div:first-child i {
        font-size: 1.75rem !important;
    }
}

/* ============= Print Styles ============= */
@media print {
    .events-section,
    .team-section,
    .books-section,
    .blog-section,
    .supplements-section,
    .newsletter-cta {
        page-break-inside: avoid;
    }
}

/* ============= Dark Mode Support (Future) ============= */
@media (prefers-color-scheme: dark) {
    /* Placeholder for dark mode styles */
}

/* ============= Reduced Motion ============= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============= High Contrast Mode ============= */
@media (prefers-contrast: high) {
    .events-section,
    .team-section,
    .books-section,
    .blog-section,
    .supplements-section,
    .newsletter-cta {
        border: 2px solid currentColor;
    }
}

/* ============= Accessibility Enhancements ============= */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Visible Styles */
*:focus-visible {
    outline: 3px solid #45B7D1;
    outline-offset: 2px;
}

/* Skip to Content Link */
.skip-to-content {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: #45B7D1;
    color: white;
    padding: 1rem 2rem;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    text-decoration: none;
    z-index: 9999;
    transition: top 0.3s ease;
}

.skip-to-content:focus {
    top: 0;
}

/* ============= Performance Optimizations ============= */
.events-section *,
.team-section *,
.books-section *,
.blog-section *,
.supplements-section *,
.newsletter-cta * {
    will-change: auto;
}

.events-section img,
.team-section img,
.books-section img,
.blog-section img,
.supplements-section img {
    content-visibility: auto;
    contain-intrinsic-size: 1px 300px;
}

/* ============= Loading States ============= */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #45B7D1;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============= Utility Classes ============= */
.text-gradient {
    background: linear-gradient(135deg, #45B7D1, #FF9500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.shadow-3d {
    box-shadow: 
        0 2px 4px rgba(0,0,0,0.1),
        0 8px 16px rgba(0,0,0,0.1),
        0 16px 32px rgba(0,0,0,0.1);
}
