:root {
    --bg-color: #eef2f6;
    --text-color: #1e293b;
    --primary-color: #3b82f6;
    /* Logical Resolutions handled by aspect-ratio in classes */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent scrollbars from scaling logic initially */
}

header {
    text-align: center;
    padding: 1rem 2rem;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    z-index: 100;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.view-switcher {
    display: flex;
    gap: 0.5rem;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 8px;
}

.nav-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #64748b;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-btn:hover {
    color: var(--primary-color);
    background: rgba(255,255,255,0.5);
}

.nav-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.mockup-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center; /* Center content in the available space */
    width: 100%;
    padding: 0;
    box-sizing: border-box;
    transition: transform 0.3s ease-out; /* Smooth zoom */
    
    /* For 'All' mode wrapping */
    flex-wrap: wrap; 
    gap: 4rem;
    align-content: center;
}

.device-wrapper {
    display: none; /* Hidden by default, JS toggles flex */
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    transition: opacity 0.3s ease;
}

.device-wrapper.active {
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.device-label {
    font-weight: 600;
    color: #475569;
    font-size: 1.1rem;
}

.device {
    background: #000;
    border-radius: 20px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    box-sizing: border-box;
    flex-shrink: 0; /* Prevent squishing */
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
    display: block;
    transform-origin: top left; /* Critical for scaling */
}

/* --- Device Specifics (Responsive) --- */

/* Mac Styles - Aspect Ratio 16:10 (1280/800) */
.mac {
    height: 75vh;
    width: auto;
    margin: 0 auto;
    background: #1a1a1a;
    border-radius: 20px 20px 0 0;
    padding: 16px;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
}
.mac-screen {
    width: auto;
    height: 100%;
    background: white;
    overflow: hidden;
    position: relative;
    aspect-ratio: 1280 / 800;
}
.mac-screen iframe {
    width: 100%;
    height: 100%;
}
.mac-camera { position: absolute; top: 5px; left: 50%; transform: translateX(-50%); width: 0.6%; padding-bottom: 0.6%; background: #444; border-radius: 50%; z-index: 2; height: 0; }
.mac-base { 
    width: 105%; 
    margin-left: -2.5%; 
    height: 0; 
    padding-bottom: 2%; /* Scale height based on width */
    background: linear-gradient(to bottom, #2a2a2a, #1a1a1a); 
    border-radius: 0 0 10px 10px; 
    margin-top: -2px; 
    position: relative; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.15); 
}
.mac-base::before { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 15%; height: 30%; background: #111; border-radius: 0 0 5px 5px; }

/* iPad Styles - Aspect Ratio ~0.7 (834/1194) */
.ipad { 
    width: auto;
    height: 85vh; /* Fit height */
    max-width: 90vw;
    background: #1a1a1a;
    border-radius: 32px; 
    padding: 18px;
    margin: 0 auto;
    display: flex;
}
.ipad-screen {
    width: auto;
    height: 100%;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 834 / 1194;
}
.ipad-screen iframe {
    width: 100%;
    height: 100%;
}
.ipad-camera { position: absolute; top: 1%; left: 50%; transform: translateX(-50%); width: 1%; padding-bottom: 1%; background: #333; border-radius: 50%; height: 0; }
.ipad-home-bar { position: absolute; bottom: 1%; left: 50%; transform: translateX(-50%); width: 25%; height: 0.5%; background: rgba(0,0,0,0.2); border-radius: 3px; z-index: 10; pointer-events: none; }


/* iPhone Styles - Aspect Ratio ~0.46 (393/852) */
.iphone { 
    width: auto;
    height: 85vh; /* Fit height */
    max-width: 90vw;
    background: #1a1a1a;
    border-radius: 54px; 
    padding: 12px;
    margin: 0 auto;
    display: flex;
}
.iphone-screen {
    width: auto;
    height: 100%;
    background: white;
    border-radius: 42px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 393 / 852;
}
.iphone-screen iframe {
    width: 100%;
    height: 100%;
}
.iphone-dynamic-island { 
    position: absolute; 
    top: 15px; 
    left: 50%; 
    transform: translateX(-50%); 
    width: 32%; 
    height: 4.2%; 
    background: #000; 
    border-radius: 20px; 
    z-index: 10; 
    display: flex; 
    justify-content: flex-end; 
    align-items: center; 
    padding-right: 1.5%;
}
.iphone-dynamic-island .camera { 
    width: 14%; 
    padding-bottom: 14%; 
    background: #1b264f; 
    border-radius: 50%; 
    height: 0; 
    opacity: 0.8;
}
.iphone-home-bar { 
    position: absolute; 
    bottom: 1.2%; 
    left: 50%; 
    transform: translateX(-50%); 
    width: 35%; 
    height: 0.6%; 
    background: #1a1a1a; 
    border-radius: 10px; 
    z-index: 10; 
    opacity: 0.8;
}


/* Remove old media queries as we are using JS scaling now */
