:root {
    --bg-dark: #0a0a0c;
    --bg-card: #16181c;
    --text-primary: #ffffff;
    --text-secondary: #a0aab2;
    --neon-cyan: #00f0ff;
    --neon-purple: #b026ff;
    --border-color: #2a2e33;
    --success: #00ff66;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow: hidden; /* Prevent body scroll during screen transitions */
}

#app-container {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    position: relative;
    overflow: hidden;
}

/* --- Screen Transitions --- */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 1;
    overflow-y: auto;
}

.screen.active {
    transform: translateX(0);
    z-index: 2;
}

/* --- Typography & Utilities --- */
h1, h2, h3 {
    font-family: var(--font-heading);
    text-transform: uppercase;
}

.neon-text {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.hidden {
    display: none !important;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background-color: rgba(10, 10, 12, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

header h2 {
    font-size: 1.2rem;
    letter-spacing: 2px;
}

/* --- Buttons --- */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background-color: var(--neon-cyan);
    color: var(--bg-dark);
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.3);
}

.btn-primary:active {
    transform: scale(0.98);
    box-shadow: 0 2px 5px rgba(0, 240, 255, 0.3);
}

.btn-secondary {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:active {
    background-color: #1a1d24;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* --- Screen 1: Home --- */
#screen-home {
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.logo-container {
    text-align: center;
    margin-bottom: 4rem;
}

.logo-container h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.logo-container p {
    color: var(--text-secondary);
    font-size: 1rem;
    letter-spacing: 1px;
}

.action-buttons {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.action-buttons .icon {
    margin-right: 10px;
    font-size: 1.3rem;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider span {
    padding: 0 10px;
}

/* --- Screen 2: Scan --- */
.scanner-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background-color: #000;
}

.media-container {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.input-media {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    z-index: 1;
}

.output-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 2;
    pointer-events: none;
}

.scan-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 350px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    z-index: 3;
    pointer-events: none;
}

.scan-actions {
    padding: 1.5rem;
    background-color: var(--bg-dark);
}

.loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--neon-cyan);
}

.spinner {
    border: 4px solid rgba(0, 240, 255, 0.2);
    border-top: 4px solid var(--neon-cyan);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Screen 3: Results --- */
.results-container {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
}

.tier-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.badge-free {
    background: #333;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    color: #fff;
}

.btn-upgrade-sm {
    background: linear-gradient(90deg, var(--neon-purple), #ff0055);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    font-family: var(--font-heading);
}

/* Accordion */
.accordion-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.accordion-header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 700;
}

.accordion-content {
    padding: 0 1rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background-color: rgba(0, 0, 0, 0.2);
}

.accordion-item.expanded .accordion-content {
    padding: 1rem;
    max-height: 1000px; /* arbitrary large value */
}

.accordion-item.locked {
    opacity: 0.6;
    pointer-events: none;
}



.slider-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.slider-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.slider-info {
    flex: 1;
}

.slider-name {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.slider-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--neon-cyan);
    font-family: var(--font-heading);
}

.btn-copy {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.btn-copy:active {
    background: var(--neon-cyan);
    color: #000;
}

.premium-gate {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(176, 38, 255, 0.1), rgba(255, 0, 85, 0.1));
    border: 1px solid var(--neon-purple);
    border-radius: 12px;
    text-align: center;
}

.premium-gate p {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.btn-premium {
    background: linear-gradient(90deg, var(--neon-purple), #ff0055);
    color: white;
    border: none;
}

/* --- Screen 4: Premium --- */
.premium-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}

.premium-hero {
    margin-bottom: 2rem;
}

.premium-hero h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    color: var(--neon-purple);
    text-shadow: 0 0 15px rgba(176, 38, 255, 0.5);
}

.premium-features {
    list-style: none;
    text-align: left;
    margin-bottom: 3rem;
    width: 100%;
    max-width: 300px;
}

.premium-features li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.pricing {
    margin-bottom: 2rem;
}

.pricing .price {
    font-size: 2.5rem;
    font-weight: 900;
    font-family: var(--font-heading);
}

.pricing .period {
    color: var(--text-secondary);
}

.btn-premium-action {
    background: linear-gradient(90deg, var(--neon-purple), #ff0055);
    color: white;
    padding: 1.2rem;
    font-size: 1.2rem;
    border: none;
    border-radius: 8px;
    width: 100%;
    max-width: 300px;
    font-family: var(--font-heading);
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(176, 38, 255, 0.4);
}

/* Responsive adjustments */
@media (min-width: 768px) {
    #app-container {
        max-width: 500px;
        height: 850px;
        margin: 2rem auto;
        border-radius: 20px;
        border: 2px solid var(--border-color);
        box-shadow: 0 20px 50px rgba(0,0,0,0.5);
        overflow: hidden;
    }
}
