:root {
    --primary-blue: #002060;
    --primary-dark: #001540;
    --accent-gold: #c5a059;
    --bg-light: #f5f7fa;
    --white: #ffffff;
    --text-dark: #1a1a1a;
    --text-gray: #666666;
    --border-color: #e0e0e0;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 50px rgba(0, 32, 96, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f0f2f5;
    color: var(--text-dark);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Left Panel: Controls */
.control-panel {
    width: 40%;
    min-width: 450px;
    background: var(--white);
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 10;
    overflow-y: auto;
}

/* Custom Scrollbar for Control Panel */
.control-panel::-webkit-scrollbar {
    width: 6px;
}

.control-panel::-webkit-scrollbar-track {
    background: transparent;
}

.control-panel::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 3px;
}

.control-panel::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

.panel-header {
    padding: 24px 40px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-home {
    text-decoration: none;
    color: var(--primary-blue);
    font-weight: 700;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    background: #f0f2f5;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.btn-home:hover {
    background: #eef2f7;
    border-color: rgba(0, 32, 96, 0.1);
    transform: translateY(-1px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-logo {
    height: 48px;
    width: auto;
}

.brand-text h1 {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-blue);
    letter-spacing: -0.5px;
}

.brand-text p {
    font-size: 12px;
    color: var(--accent-gold);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.user-counter {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-gray);
    margin-top: 6px;
    background: #f0f2f5;
    padding: 4px 10px;
    border-radius: 20px;
    width: fit-content;
    font-weight: 600;
}

.user-counter i {
    color: var(--accent-gold);
    font-size: 10px;
}

.user-counter span {
    color: var(--primary-blue);
    font-weight: 800;
}

.panel-content {
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    flex: 1;
}

.tabs {
    display: flex;
    background: #f5f7fa;
    padding: 6px;
    border-radius: 16px;
}

.tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    font-weight: 600;
    color: var(--text-gray);
    cursor: pointer;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    transition: all 0.2s;
}

.tab.active {
    background: var(--white);
    color: var(--primary-blue);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.tab-content {
    display: none;
    flex-direction: column;
    gap: 20px;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Input Groups */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 11px;
    font-weight: 700;
    color: #8898aa;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-badge {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: var(--primary-blue);
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 700;
}

input[type="text"] {
    padding: 14px;
    background: #f8f9fa;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    transition: all 0.2s;
}

input[type="text"]:focus {
    outline: none;
    background: var(--white);
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(0, 32, 96, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-dark));
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 12px;
    box-shadow: 0 8px 20px rgba(0, 32, 96, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 32, 96, 0.3);
}

/* Style Section */
.style-section h3 {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-gray);
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.color-inputs,
.style-inputs {
    display: flex;
    gap: 16px;
}

.color-input-wrapper,
.select-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-picker-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8f9fa;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
}

input[type="color"] {
    border: none;
    width: 32px;
    height: 32px;
    cursor: pointer;
    background: none;
    padding: 0;
}

select {
    width: 100%;
    padding: 14px;
    background: #f8f9fa;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23002060' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
}

/* Branding Badge - Compact & Clean */
.branding-badge {
    background: #f8f9fa;
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 20px;
    border-radius: 16px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-top: auto;
}

.badge-icon {
    font-size: 20px;
    color: var(--accent-gold);
    background: rgba(197, 160, 89, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.badge-text h3 {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.badge-text p {
    font-size: 11px;
    color: var(--text-gray);
    line-height: 1.5;
    margin-bottom: 8px;
    text-align: justify;
}

.badge-footer {
    font-size: 10px;
    font-weight: 600;
    color: var(--primary-blue);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    opacity: 0.9;
}

/* Right Panel: Preview */
.preview-panel {
    flex: 1;
    background: radial-gradient(circle at center, #eef2f7 0%, #dde4ed 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.preview-panel::before {
    content: '';
    position: absolute;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(197, 160, 89, 0.15) 0%, rgba(255, 255, 255, 0) 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

.preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    z-index: 5;
    transform: scale(0.95);
}

.phone-frame {
    width: 340px;
    height: 680px;
    background: var(--primary-blue);
    border-radius: 50px;
    padding: 12px;
    box-shadow: 0 40px 100px rgba(0, 32, 96, 0.3), 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    border: 6px solid #001540;
}

.phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 28px;
    background: #001540;
    border-radius: 0 0 18px 18px;
    z-index: 10;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: var(--primary-blue);
    border-radius: 40px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 56px;
    background-image: linear-gradient(180deg, #002060 0%, #001030 100%);
}

.app-header {
    text-align: center;
    margin-bottom: 28px;
    color: white;
}

.school-name {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--accent-gold);
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.school-sub {
    font-size: 10px;
    letter-spacing: 1.2px;
    opacity: 0.8;
    font-weight: 500;
}

.qr-card {
    background: rgba(255, 255, 255, 0.98);
    width: 88%;
    border-radius: 28px;
    padding: 28px 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    position: relative;
}

.btn-download {
    background: var(--accent-gold);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    transition: all 0.3s;
    box-shadow: 0 10px 30px rgba(197, 160, 89, 0.3);
}

.btn-download:hover {
    background: #b08d4b;
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(197, 160, 89, 0.4);
}

@media (max-width: 1024px) {

    html,
    body {
        overflow-y: auto !important;
        overflow-x: hidden;
        height: auto !important;
        min-height: 100vh;
        -webkit-overflow-scrolling: touch;
        /* Smooth scrolling on iOS */
    }

    .app-container {
        flex-direction: column;
        height: auto !important;
        overflow: visible !important;
        width: 100%;
    }

    .control-panel {
        width: 100%;
        min-width: 0;
        height: auto !important;
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        overflow: visible !important;
        flex: none;
        /* Don't try to flex */
    }

    .panel-header {
        position: relative;
        /* Disable sticky on mobile to prevent issues */
        top: auto;
    }

    .preview-panel {
        padding: 40px 20px;
        min-height: auto;
        height: auto !important;
        overflow: visible !important;
        flex: none;
    }

    .preview-container {
        transform: scale(0.85);
        margin-top: -20px;
        margin-bottom: 40px;
    }

    .phone-frame {
        max-width: 100%;
        box-shadow: 0 10px 30px rgba(0, 32, 96, 0.15);
        /* Reduce shadow for performance */
    }
}

/* Card Footer Typography - Neater Style */
.card-footer {
    margin-top: 20px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card-footer h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary-blue);
    margin: 0;
    letter-spacing: -0.2px;
    line-height: 1.4;
    text-transform: uppercase;
}

.card-footer .divider {
    height: 0;
    margin: 2px 0;
    opacity: 0;
}

.card-footer p {
    font-size: 12px;
    color: var(--text-gray);
    font-weight: 500;
    margin-top: 2px;
    letter-spacing: 0.2px;
}

/* Banner Styles */
.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
    /* Changed from 100vw to prevent horizontal scrollbar */
}

/* ... existing styles ... */

/* Banner Styles */
.promo-banner {
    margin-top: 20px;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.promo-banner img {
    width: 100%;
    max-height: 180px;
    /* Restrict height */
    object-fit: cover;
    /* Maintain aspect ratio */
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

.promo-banner:hover img {
    transform: scale(1.05);
}
