:root {
    --bg-color: #eef2f6;
    --text-color: #1e293b;
    --primary-color: #3b82f6;
    --mac-width: 800px;
    --mac-height: 500px;
    --ipad-width: 380px;
    --ipad-height: 520px;
    --iphone-width: 280px;
    --iphone-height: 580px;
}

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: 2rem;
    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; /* Removes minimal scrollbar gap potentially */
}

/* --- Device Specifics (Same as before) --- */
/* Mac Styles */
.mac {
    width: var(--mac-width);
    height: var(--mac-height);
    border: 12px solid #1a1a1a;
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
}
.mac-screen {
    width: 100%;
    height: 100%;
    background: white;
    overflow: hidden;
    position: relative;
}

.mac-screen iframe {
    width: 1280px;
    height: 800px;
    transform: scale(0.60625);
    transform-origin: 0 0;
}
.mac-camera { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); width: 6px; height: 6px; background: #444; border-radius: 50%; z-index: 2; }
.mac-base { width: calc(var(--mac-width) + 40px); height: 24px; background: linear-gradient(to bottom, #2a2a2a, #1a1a1a); border-radius: 0 0 16px 16px; margin-top: -2px; position: relative; box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.mac-base::before { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 120px; height: 8px; background: #111; border-radius: 0 0 8px 8px; }

/* iPad Styles */
.ipad { width: var(--ipad-width); height: var(--ipad-height); border: 12px solid #1a1a1a; border-radius: 24px; }
.ipad-screen {
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.ipad-screen iframe {
    width: 834px;
    height: 1194px;
    transform: scale(0.4269);
    transform-origin: 0 0;
}
.ipad-camera { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); width: 6px; height: 6px; background: #333; border-radius: 50%; }
.ipad-home-bar { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); width: 120px; height: 4px; background: rgba(255,255,255,0.3); border-radius: 2px; z-index: 10; pointer-events: none; }

/* iPhone Styles */
.iphone { width: var(--iphone-width); height: var(--iphone-height); border: 10px solid #1a1a1a; border-radius: 36px; }
.iphone-screen {
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 26px;
    overflow: hidden;
}

.iphone-screen iframe {
    width: 393px;
    height: 852px;
    transform: scale(0.6616);
    transform-origin: 0 0;
}
.iphone-notch { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 90px; height: 24px; background: #1a1a1a; border-radius: 0 0 12px 12px; z-index: 10; display: flex; justify-content: center; align-items: center; gap: 6px; }
.iphone-notch .speaker { width: 40px; height: 4px; background: #333; border-radius: 2px; }
.iphone-notch .camera { width: 6px; height: 6px; background: #1b264f; border-radius: 50%; }
.iphone-home-bar { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); width: 100px; height: 4px; background: parent; background: #1a1a1a; border-radius: 2px; z-index: 10; }

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