/* =========================================
   STYLE-FEATURES.CSS 
   ========================================= */

/* FIX 4: Added Section Header styling */
.section-header { margin-bottom: 3rem; text-align: center; padding: 0 1rem; }
.section-header h2 { font-size: clamp(2rem, 5vw, 2.5rem); margin-bottom: 1rem; color: var(--text-color); }
.section-header p { opacity: 0.7; font-size: 1rem; }

/* GRID SYSTEM */
.features-grid-12 {
    display: grid;
    /* Optimised minmax for smaller mobile screens to prevent overflow */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 20px;
    max-width: 1200px; 
    margin: 0 auto;
    padding: 0 10px; /* Safety padding for mobile edges */
}

/* SPAN UTILITY FOR DESKTOP */
.span-2-desktop {
    grid-column: span 2;
}

/* CARD STYLING */
.feature-card {
    background: var(--card-bg); 
    border: 1px solid var(--border-color); 
    padding: 2rem;
    border-radius: 20px; 
    position: relative; 
    overflow: hidden; 
    min-height: 300px;
    display: flex; 
    flex-direction: column; 
    justify-content: space-between;
}
.feature-card:hover { border-color: var(--accent); }

/* Utility: Centered Flex Card */
.centered-flex-card {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* --- CARD SPECIFIC STYLES --- */

/* 1. Theme Demo Card (White Mode) */
.demo-white-mode {
    background: #ffffff !important;
    color: #000000 !important;
}
.demo-white-mode h3, .demo-white-mode p { color: #000000 !important; }
.demo-white-mode .theme-btn-card { border-color: #000000; color: #000000; }

.theme-btn-card { background: transparent; border: 2px solid var(--text-color); color: var(--text-color); width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 15px auto; transition: 0.3s; cursor: pointer; }

/* 2. Bento Component (Mini) */
.bento-component { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    grid-auto-rows: 70px; 
    gap: 10px; 
    margin-top: 20px; 
}

.b-box { 
    background: var(--primary); 
    opacity: 0.5; 
    border-radius: 8px; 
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); 
    cursor: pointer;
}

.b-box:hover {
    opacity: 1;
    transform: scale(0.95);
    background: var(--accent);
    box-shadow: 0 0 15px var(--accent);
}

.b-tall { grid-row: span 2; }
.b-wide { grid-column: span 2; background: #334155; }

/* 3. Marquee in Card */
.marquee-container { 
    width: 100%; overflow: hidden; background: var(--nav-bg); padding: 15px 0; border-radius: 8px; margin-top: auto; 
    display: flex;
}
.marquee-content { 
    display: flex; white-space: nowrap; animation: scrollText 10s linear infinite; 
}
.marquee-content span { padding: 0 20px; font-weight: bold; color: var(--accent); }

@keyframes scrollText { 
    from { transform: translateX(0); } 
    to { transform: translateX(-50%); } 
}

/* 4. Glare */
.glare-card { transform-style: preserve-3d; transform: perspective(1000px); background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%); }
.glare-content { pointer-events: none; transform: translateZ(30px); display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; text-align: center; }
.glare-effect { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.2) 0%, transparent 60%); opacity: 0; pointer-events: none; mix-blend-mode: overlay; }

/* 5. Sticky Stack */
.sticky-window { 
    height: 180px; 
    overflow-y: auto; 
    border: 1px solid var(--border-color); 
    border-radius: 12px; 
    padding: 10px; 
    position: relative; 
    background: rgba(0,0,0,0.2);
    /* Mobile Touch optimization */
    -webkit-overflow-scrolling: touch;
}

.sticky-window::-webkit-scrollbar { display: none; }

.s-card { 
    height: 80px; 
    margin-bottom: 12px; 
    border-radius: 10px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: white; 
    position: sticky; 
    top: 0; 
    z-index: 1; 
    font-weight: 700;
    font-family: 'Syne', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 -5px 15px rgba(0,0,0,0.5);
}

.c1 { background: #4c1d95; } 
.c2 { background: var(--primary); } 
.c3 { background: #7c3aed; } 
.c4 { background: var(--accent); color: #000; } 

/* 6. Cinematic */
.video-text-container { background: #000; padding: 20px; display: flex; align-items: center; justify-content: center; height: 150px; border-radius: 10px; overflow: hidden; }

/* Responsive Text Sizing using Clamp */
.video-text { 
    font-size: clamp(2.5rem, 10vw, 4rem); 
    font-weight: 900; 
    background: url('https://media.giphy.com/media/3o6Zt6ML6BklcajjsA/giphy.gif') center/cover; 
    -webkit-background-clip: text; 
    color: transparent; 
    margin: 0; 
}

/* 7. Hacker Text */
.hacker-text { 
    font-family: 'Courier New', monospace; 
    color: var(--accent); 
    background: rgba(255,255,255,0.05); 
    padding: 10px; 
    margin: 10px 0; 
    border-radius: 5px; 
    word-break: break-all; /* Prevents overflow */
    font-size: 1.2rem;
}

/* 8. Spotlight */
.spotlight-card { background: #000; text-align: center; }
.spotlight-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), transparent 10%, rgba(0,0,0,0.98) 25%); pointer-events: none; z-index: 2; }
.spotlight-content { position: relative; z-index: 1; padding-top: 40px; }

/* 9. Glassmorphism */
.glass-demo { 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); padding: 20px; border-radius: 10px; margin-top: 10px; color: white; text-align: center; font-weight: bold; }

/* 10. Gradient UI */
.gradient-text { background: linear-gradient(to right, #ff00cc, #333399); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight: 800; font-size: 2rem; }
.gradient-border-box { border: 4px solid; border-image-slice: 1; border-width: 4px; border-image-source: linear-gradient(to left, #743ad5, #d53a9d); padding: 10px; margin-top: 10px; font-weight: bold; text-align: center; }

/* 11. 3D Flip */
.flip-container { perspective: 1000px; width: 100%; height: 150px; margin-top: 20px; }
.flipper { transition: 0.6s; transform-style: preserve-3d; position: relative; width: 100%; height: 100%; }
.flip-container:hover .flipper { transform: rotateY(180deg); }
.front, .back { backface-visibility: hidden; position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 10px; border: 1px solid var(--border-color); background: var(--nav-bg); }
.back { transform: rotateY(180deg); background: var(--primary); color: white; }

/* 12. Magnetic Button */
.magnetic-btn { padding: 15px 30px; background: var(--text-color); color: var(--bg-color); border: none; border-radius: 50px; cursor: pointer; transition: transform 0.1s cubic-bezier(0.23, 1, 0.32, 1); font-weight: bold; }

/* UTILS */
.counter { font-size: 2.5rem; font-weight: bold; color: var(--primary); }
.img-comp-container { position: relative; height: 150px; width: 100%; overflow: hidden; border-radius: 8px; margin-top: 10px; }
.img-comp-img { position: absolute; width: auto; height: auto; overflow: hidden; }
.img-comp-img img { display: block; height: 150px; object-fit: cover; }
.img-comp-overlay { width: 50%; border-right: 3px solid white; z-index: 9; }

.accordion { 
    background: var(--nav-bg); 
    color: var(--text-color); 
    width: 100%; 
    border: 1px solid var(--border-color); 
    padding: 15px; 
    text-align: center; 
    cursor: pointer; 
    border-radius: 5px; 
    margin-top: 10px; 
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    transition: 0.3s;
}

.accordion:hover { border-color: var(--accent); }
.panel { padding: 0 10px; max-height: 0; overflow: hidden; transition: max-height 0.2s ease-out; background: var(--bg-color); text-align: center;}
.panel p { padding: 15px 0; opacity: 0.8; }
.hidden-content { display: none; margin-top: 20px; }
.s-line { height: 10px; background: var(--border-color); margin: 10px 0; border-radius: 5px; animation: shimmer 1.5s infinite; }

.toast { 
    position: absolute; 
    top: 50%; left: 50%; 
    transform: translate(-50%, -50%); 
    background: #10b981; 
    color: white; 
    padding: 12px 20px; 
    border-radius: 50px; 
    opacity: 1; 
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    z-index: 10;
    white-space: nowrap;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.toast.hidden { 
    opacity: 0; 
    transform: translate(-50%, -20%) scale(0.8); 
    pointer-events: none; 
}

.parallax-card { color: white; }
.parallax-bg { position: absolute; top: -10%; left: -10%; width: 120%; height: 120%; background-size: 100px; transition: transform 0.1s ease-out; }
.parallax-content { position: relative; z-index: 2; background: rgba(0,0,0,0.7); padding: 15px; border-radius: 10px; }
.parallax-float { position: absolute; top: 20%; right: 20%; z-index: 3; font-size: 3rem; color: var(--accent); }
@keyframes shimmer { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }

.separator-top, .separator { grid-column: 1 / -1; margin: 3rem 0 1rem 0; border-left: 4px solid var(--primary); padding-left: 1rem; }

/* =========================================
   MOBILE RESPONSIVE OPTIMIZATIONS
   ========================================= */
@media (max-width: 768px) {
    /* Force grid to single column */
    .features-grid-12 { 
        grid-template-columns: 1fr; 
        padding: 0 15px;
    }
    
    /* Reset spans: cards take full width naturally in a 1-col grid */
    .span-2-desktop { 
        grid-column: auto; 
    }

    /* Reduce card padding to save screen space */
    .feature-card { 
        padding: 1.5rem; 
        min-height: 260px; /* Slightly shorter minimum height */
    }

    /* Typographic Adjustments */
    .video-text { font-size: 15vw; } /* Scales with viewport width */
    .hacker-text { font-size: 1rem; }
    .section-header h2 { font-size: 2rem; }

    /* Layout specific adjustments */
    .sticky-window { height: 160px; }
    .bento-component { gap: 8px; }
    
    /* Ensure parallax float doesn't block text on small screens */
    .parallax-float { font-size: 2rem; opacity: 0.5; }
}