/* =========================================================================
   DESIGN SYSTEM & VARIABLES (TOKENS)
   ========================================================================= */
:root {
    /* Color Palette - HSL values for unified cyber design */
    --color-bg-darkest: hsl(230, 25%, 5%);     /* Deep space black-blue background */
    --color-bg-darker: hsl(230, 20%, 8%);       /* Secondary dark element color */
    --color-bg-card: rgba(18, 20, 30, 0.6);    /* Semi-transparent container cards */
    
    --color-text-primary: hsl(210, 20%, 96%);   /* Bright text */
    --color-text-secondary: hsl(215, 15%, 72%); /* Muted paragraphs */
    --color-text-muted: hsl(215, 10%, 52%);     /* Footers and labels */
    
    /* Neon Branding Accents */
    --color-accent-primary: hsl(190, 100%, 50%);  /* Neon Cyan */
    --color-accent-secondary: hsl(270, 95%, 65%);  /* Cyber Purple */
    --color-accent-success: hsl(145, 80%, 50%);    /* Emerald Green */
    --color-accent-danger: hsl(355, 90%, 60%);     /* Coral Red */
    
    /* Gradients */
    --gradient-hero: linear-gradient(135deg, var(--color-accent-primary) 0%, var(--color-accent-secondary) 100%);
    --gradient-glow-1: radial-gradient(circle, rgba(0, 242, 254, 0.12) 0%, transparent 70%);
    --gradient-glow-2: radial-gradient(circle, rgba(162, 89, 255, 0.12) 0%, transparent 70%);
    
    /* Borders & Glassmorphism */
    --border-glass: 1px solid rgba(255, 255, 255, 0.07);
    --border-glass-hover: 1px solid rgba(0, 242, 254, 0.25);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --blur-glass: 16px;
    
    /* Transition Speeds */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================================================
   BASE STYLING & RESET
   ========================================================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--color-text-primary);
    background-color: var(--color-bg-darkest);
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    line-height: 1.6;
    position: relative;
}

/* Headings use Outfit */
h1, h2, h3, h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* =========================================================================
   AMBIENT GLOWS
   ========================================================================= */
.ambient-glow {
    position: absolute;
    width: 700px;
    height: 700px;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    filter: blur(120px);
    opacity: 0.55;
}

.glow-1 {
    top: -200px;
    left: -200px;
    background: var(--gradient-glow-1);
    animation: floatGlow 25s infinite alternate;
}

.glow-2 {
    top: 500px;
    right: -250px;
    background: var(--gradient-glow-2);
    animation: floatGlow 30s infinite alternate-reverse;
}

.glow-3 {
    bottom: -100px;
    left: 20%;
    background: radial-gradient(circle, rgba(0, 242, 254, 0.08) 0%, transparent 60%);
}

@keyframes floatGlow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(80px, 60px) scale(1.15); }
}

/* =========================================================================
   HEADER & NAVIGATION BAR
   ========================================================================= */
.site-header {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 100;
    backdrop-filter: blur(var(--blur-glass));
    background-color: rgba(10, 11, 16, 0.75);
    border-bottom: var(--border-glass);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    font-size: 1.4rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
}

.logo-accent {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-domain {
    color: var(--color-accent-primary);
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(255, 255, 255, 0.04);
    border: var(--border-glass);
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--color-accent-success);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--color-accent-success);
    animation: dotPulse 2s infinite;
}

@keyframes dotPulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.6; }
}

/* =========================================================================
   HERO SECTION & CONTROLS
   ========================================================================= */
.hero-section {
    padding: 60px 0 30px 0;
    text-align: center;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 3.8rem);
    line-height: 1.1;
    margin-bottom: 16px;
}

.gradient-text {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    max-width: 750px;
    margin: 0 auto 40px auto;
}

/* Controls Panel Styling */
.controls-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    margin: 0 auto;
    border-radius: var(--radius-md);
    flex-wrap: wrap;
    gap: 20px;
    max-width: 900px;
}

.glass-card {
    background-color: var(--color-bg-card);
    backdrop-filter: blur(var(--blur-glass));
    border: var(--border-glass);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.control-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.tab-buttons {
    display: flex;
    gap: 8px;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: var(--radius-sm);
    border: var(--border-glass);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.tab-btn:hover {
    color: var(--color-text-primary);
    background-color: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--color-accent-primary);
    border: 1px solid rgba(0, 242, 254, 0.2);
}

/* Cloudflare Sync status tag */
.sync-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(255, 255, 255, 0.02);
    border: var(--border-glass);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.sync-dot {
    width: 6px;
    height: 6px;
    background-color: var(--color-text-muted);
    border-radius: 50%;
}

.sync-status.synced {
    color: var(--color-accent-primary);
    border-color: rgba(0, 242, 254, 0.2);
}

.sync-status.synced .sync-dot {
    background-color: var(--color-accent-primary);
    box-shadow: 0 0 6px var(--color-accent-primary);
}

/* =========================================================================
   SHOWCASE GRID & CARD DESIGNS
   ========================================================================= */
.showcase-main {
    padding: 40px 0 100px 0;
}

.showcase-grid {
    display: flex;
    flex-direction: column;
    gap: 80px; /* Large gap separating each showcase row */
    min-height: 400px;
}

/* Loading Placeholder style */
.loading-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
    color: var(--color-text-secondary);
    gap: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 242, 254, 0.1);
    border-top-color: var(--color-accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Each Project Row (combines device & metadata) */
.showcase-row {
    display: grid;
    grid-template-columns: 350px 1fr; /* 350px for phone frame, rest for metadata */
    gap: 60px;
    align-items: center;
    padding: 40px;
    border-radius: var(--radius-lg);
    transition: var(--transition-slow);
}

.showcase-row:hover {
    border-color: rgba(0, 242, 254, 0.15);
    background-color: rgba(18, 20, 30, 0.3);
}

/* Swap order for even rows to create a beautiful staggered layout */
.showcase-row:nth-child(even) {
    grid-template-columns: 1fr 350px;
}

.showcase-row:nth-child(even) .device-wrapper {
    grid-column: 2;
}

.showcase-row:nth-child(even) .project-info-card {
    grid-column: 1;
    grid-row: 1;
}

/* =========================================================================
   MOBILE DEVICE FRAME (IPHONE MOCKUP)
   ========================================================================= */
.device-wrapper {
    display: flex;
    justify-content: center;
    position: relative;
}

.device-phone {
    width: 350px;
    height: 700px;
    border: 10px solid #1c1d24; /* iPhone metal bezel */
    border-radius: 40px;
    background-color: #000;
    position: relative;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8),
                0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

/* iPhone Top Dynamic Island / Notch */
.device-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 110px;
    height: 22px;
    background-color: #000;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.device-camera {
    width: 6px;
    height: 6px;
    background-color: #1a1a1a;
    border-radius: 50%;
    margin-right: 6px;
}

.device-speaker {
    width: 35px;
    height: 4px;
    background-color: #0f0f0f;
    border-radius: 2px;
}

/* Screen area inside phone border */
.device-screen {
    width: 100%;
    height: 100%;
    position: relative;
    background-color: #0c0d12;
}

.device-iframe {
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: auto; /* Always interactive by default */
    transition: var(--transition-fast);
}

/* Screen area inside phone border */
.device-screen {
    width: 100%;
    height: 100%;
    position: relative;
    background-color: #0c0d12;
}

/* =========================================================================
   PROJECT METADATA INFORMATION CARD
   ========================================================================= */
.project-info-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Badge block: combines folder tag and views tag */
.project-badges {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.folder-badge {
    background-color: rgba(162, 89, 255, 0.1);
    border: 1px solid rgba(162, 89, 255, 0.25);
    color: var(--color-accent-secondary);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.views-badge {
    background-color: rgba(0, 242, 254, 0.07);
    border: 1px solid rgba(0, 242, 254, 0.2);
    color: var(--color-accent-primary);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.project-title {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    line-height: 1.1;
    color: var(--color-text-primary);
}

.project-desc {
    font-size: 1.05rem;
    color: var(--color-text-secondary);
    max-width: 650px;
}

/* Buttons inside the information card */
.project-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 10px 20px;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-unlock {
    background-color: rgba(255, 255, 255, 0.05);
    border: var(--border-glass);
    color: var(--color-text-primary);
}

.btn-unlock:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--color-accent-primary);
}

.btn-open {
    background: var(--gradient-hero);
    color: var(--color-bg-darkest);
    border: none;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.2);
}

.btn-open:hover {
    box-shadow: 0 4px 22px rgba(0, 242, 254, 0.45);
    transform: translateY(-1px);
}

/* =========================================================================
   FOOTER
   ========================================================================= */
.site-footer {
    border-top: var(--border-glass);
    padding: 40px 0;
    background-color: rgba(5, 6, 10, 0.8);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.copyright-text {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.footer-link {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.footer-link:hover {
    color: var(--color-accent-primary);
}

/* =========================================================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================================================= */

@media (max-width: 992px) {
    .showcase-row {
        grid-template-columns: 1fr; /* Stack phone and info card vertically */
        justify-items: center;
        text-align: center;
        gap: 32px;
        padding: 24px;
    }
    
    .showcase-row:nth-child(even) {
        grid-template-columns: 1fr;
    }
    
    .showcase-row:nth-child(even) .device-wrapper {
        grid-column: 1;
    }
    
    .project-badges {
        justify-content: center;
    }
    
    .project-actions {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .controls-panel {
        justify-content: center;
        padding: 12px;
    }
    
    .filter-group {
        flex-direction: column;
        gap: 10px;
    }
}
