/* =========================================
   PREMIUM DARK MODE IPHONE 17 THEME 
   ========================================= */
:root {
    --primary: #007aff;
    --primary-hover: #005bb5;
    --bg-dark: #0a0a0c;
    --card-bg: rgba(25, 25, 30, 0.75);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-main: #ffffff;
    --text-dim: #a1a1aa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Cinematic Background - "Harban" Animated Space */
#cosmic-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 50% 50%, #101018 0%, #000 100%);
    overflow: hidden;
}

.stars {
    position: absolute;
    width: 200%;
    height: 200%;
    background-image: 
        radial-gradient(1.5px 1.5px at 20px 30px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 150px 250px, #e2e2e2, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 300px 100px, #c4c4c4, rgba(0,0,0,0));
    background-size: 400px 400px;
    opacity: 0.15;
    animation: galaxyDrift 150s linear infinite;
}

.nebula {
    position: absolute;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 30% 20%, rgba(0, 122, 255, 0.08) 0%, transparent 60%),
        radial-gradient(circle at 70% 80%, rgba(138, 43, 226, 0.05) 0%, transparent 60%);
    filter: blur(60px);
}

@keyframes galaxyDrift {
    0% { transform: translate(-25%, -25%) rotate(0deg); }
    100% { transform: translate(0, 0) rotate(10deg); }
}

/* Header */
header {
    text-align: center;
    padding: 60px 0 40px;
    position: relative;
}

#header-title {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(180deg, #fff, #888);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 40px rgba(0,0,0,0.8);
    margin-bottom: 20px;
    animation: revealUp 1s cubic-bezier(0.2, 1, 0.3, 1) forwards;
}

@keyframes revealUp {
    0% { opacity: 0; transform: translateY(30px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.live-counter, #timer-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.2);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    color: #2ecc71;
    font-weight: 600;
    margin: 5px;
}

#timer-box {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255,255,255,0.1);
    color: var(--text-dim);
}
#timer { color: #fff; font-weight: 800; }

.pulse-dot {
    width: 8px; height: 8px; 
    background: #2ecc71; border-radius: 50%;
    animation: counter-pulse 2s infinite;
}

@keyframes counter-pulse {
    0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(46, 204, 113, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); }
}

/* Notification Bar */
#notification-bar {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85); color: #fff;
    padding: 12px 25px; border-radius: 50px; font-size: 0.9rem;
    border: 1px solid var(--primary);
    box-shadow: 0 10px 30px rgba(0, 122, 255, 0.3);
    z-index: 1000; backdrop-filter: blur(10px); transition: 0.5s all ease;
    display: flex; align-items: center; gap: 12px;
}
.apple-logo-icon { filter: drop-shadow(0 0 5px rgba(255,255,255,0.3)); }
.apple-logo-header { filter: drop-shadow(0 5px 15px rgba(0,0,0,0.5)); }
.hidden { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(-20px) !important; }

/* Main Modal Container */
#app-modal {
    position: relative;
    max-width: 600px;
    margin: 20px auto 40px;
    width: 92%;
    background: var(--card-bg);
    backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
    overflow: hidden;
    padding: 30px 20px;
    z-index: 10;
}

/* Views & Cards */
.view {
    display: none;
    animation: fadeIn 0.4s ease;
}
.view.active { display: block; }

@keyframes fadeIn {
    0% { opacity: 0; transform: scale(0.98); }
    100% { opacity: 1; transform: scale(1); }
}

.hero { text-align: center; margin-bottom: 20px; }
.hero h2 { font-size: 1.6rem; margin-bottom: 8px; font-weight: 700; color: #fff;}
.hero p { color: var(--text-dim); font-size: 0.95rem; }

/* The Main 3D Card */
.product-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 30px;
    text-align: center;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.product-card:hover {
    border-color: rgba(0, 122, 255, 0.4);
    box-shadow: 0 30px 60px rgba(0, 122, 255, 0.15);
}

.product-card img {
    width: 100%;
    max-width: 300px;
    height: 350px;
    object-fit: contain;
    margin: 0 auto 20px;
    filter: drop-shadow(0 25px 35px rgba(0,0,0,0.8));
    transform: perspective(1000px) rotateY(0deg) scale(1);
    transition: all 0.6s ease;
}
.product-card:hover img {
    transform: perspective(1000px) rotateY(15deg) scale(1.05) translateY(-5px);
    filter: drop-shadow(-20px 30px 40px rgba(0, 122, 255, 0.3));
}

.product-card h3 { font-size: 1.8rem; margin-bottom: 5px; }
.product-card p { color: var(--text-dim); margin-bottom: 25px; }

/* Buttons */
.primary-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    padding: 18px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 10px 20px rgba(0, 122, 255, 0.3);
}
.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(0, 122, 255, 0.4);
}
.pulse-button {
    animation: btn-pulse 2s infinite;
}
@keyframes btn-pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(0, 122, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 122, 255, 0); }
}

/* Configurator Panels */
.config-container, .form-container, .locker-container {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 35px;
    border: 1px solid var(--border-color);
}

.step-progress { margin-bottom: 25px; }
#step-label { font-weight: 600; font-size: 1.1rem; color: #fff; margin-bottom: 10px; }
.progress-bar {
    background: rgba(255,255,255,0.1); height: 8px; border-radius: 10px; overflow: hidden;
}
#progress-fill {
    background: var(--primary); height: 100%; transition: width 0.5s ease;
}

.options-container { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 20px; 
    align-items: stretch;
}

.select-card {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(25,25,30,0.5);
    padding: 20px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    display: flex; flex-direction: column; justify-content: space-between; text-align: left;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.card-img-container {
    width: 100%;
    height: 160px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 15px;
}
.card-img-container img {
    max-width: 100%; max-height: 100%; object-fit: contain;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.6));
    transition: transform 0.4s ease;
}
.select-card:hover .card-img-container img {
    transform: scale(1.08) translateY(-5px);
}

.card-info h4 {
    font-size: 1.2rem; color: #fff; margin-bottom: 5px;
}
.card-info p.desc {
    color: var(--text-dim); font-size: 0.85rem; margin-bottom: 10px;
}

.scarcity-tag {
    font-size: 0.8rem; color: #ff3b30; font-weight: 600;
    margin-bottom: 15px;
}

.card-btn {
    background: var(--primary);
    color: white; border: none; padding: 10px; border-radius: 8px; font-weight: 600; text-align: center;
    transition: 0.3s; width: 100%;
}
.select-card:hover .card-btn {
    background: var(--primary-hover);
    box-shadow: 0 5px 15px rgba(0, 122, 255, 0.4);
}

.select-card:hover { 
    border-color: var(--primary);
    background: rgba(30,30,40,0.8);
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 122, 255, 0.2);
}


.color-choice { justify-content: flex-start; gap: 15px; }
.color-circle {
    width: 28px; height: 28px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.2);
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

/* Form */
.form-container h2 { margin-bottom: 5px; }
.form-container p { color: var(--text-dim); margin-bottom: 25px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

input, textarea {
    width: 100%; padding: 18px; border-radius: 10px;
    border: 1px solid var(--border-color);
    background: rgba(0,0,0,0.3); color: #fff;
    font-size: 1rem; margin-bottom: 15px; transition: 0.3s;
}
input:focus, textarea:focus { outline: none; border-color: var(--primary); background: rgba(0,0,0,0.5); }
textarea { height: 100px; resize: none; }

/* Processing / Reservation Stage */
.processing-container { text-align: center; padding: 40px 20px; }
.apple-loader {
    width: 50px; height: 50px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    margin: 0 auto 25px;
    animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

#process-title { font-size: 1.5rem; margin-bottom: 10px; color: #fff; }
#process-status { color: var(--primary); font-weight: 600; font-size: 0.9rem; min-height: 1.2rem; }

.mini-summary {
    display: flex; align-items: center; justify-content: center; gap: 15px;
    margin-top: 30px; padding: 15px; background: rgba(255,255,255,0.03); border-radius: 12px;
}
.mini-summary img { height: 50px; }
.mini-summary div { font-size: 0.9rem; color: #888; }

/* Enhanced Locker Final Verification */
.locker-container { padding: 0 10px; }
.reserve-timer {
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 59, 48, 0.2);
}

.lock-icon { font-size: 2.5rem; text-align: center; margin-bottom: 5px; }
.locker-container h2 { text-align: center; margin-bottom: 10px; color: #fff; font-size: 1.5rem; }
.locker-container p { text-align: center; color: var(--text-dim); font-size: 0.9rem; line-height: 1.5; }

.selection-summary {
    display: flex; flex-direction: column; align-items: center;
    background: rgba(0, 0, 0, 0.4);
    padding: 20px; border-radius: 12px; margin: 15px 0 20px;
    border: 1px dashed rgba(0, 122, 255, 0.6);
    box-shadow: 0 0 30px rgba(0, 122, 255, 0.1);
    animation: floatItem 4s ease-in-out infinite;
}

@keyframes floatItem {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0px); }
}

#locker-phone-img {
    height: 140px; object-fit: contain; margin-bottom: 10px;
    filter: drop-shadow(0 15px 20px rgba(0,0,0,0.6));
}
#locker-summary-text { font-weight: 700; color: #fff; font-size: 1.1rem; }

.security-badges {
    display: flex; justify-content: center; gap: 15px; margin-top: 15px;
    font-size: 0.75rem; color: #888; flex-wrap: wrap; text-transform: uppercase; letter-spacing: 1px;
}

footer { text-align: center; padding: 40px; color: #666; font-size: 0.85rem; }

/* Responsive adjustments */
@media(max-width: 600px) {
    #header-title { font-size: 2.5rem; }
    .form-grid { grid-template-columns: 1fr; }
    .product-card img { height: 250px; }
    .options-container { grid-template-columns: 1fr; } /* Stack on mobile! */
}
