* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3b82f6;
    --primary-dark: #1e40af;
    --secondary-color: #f59e0b;
    --bg-dark: #1f2937;
    --bg-light: #f3f4f6;
    --border-color: #e5e7eb;
    --text-dark: #111827;
    --text-light: #6b7280;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
}

/* ===== START SCREEN ===== */
.start-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.start-container {
    background: white;
    border-radius: 20px;
    padding: 60px 40px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.6s ease-out;
}

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

.start-container h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.start-container .subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 40px;
}

.input-section {
    margin-bottom: 30px;
}

.input-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.input-section input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
}

.input-section input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-section .hint {
    display: block;
    margin-top: 6px;
    color: var(--text-light);
    font-size: 0.85rem;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    flex: 1;
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

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

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
}

.info-box {
    background-color: var(--bg-light);
    border-radius: 12px;
    padding: 20px;
}

.info-box h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.info-box ul {
    list-style: none;
}

.info-box li {
    padding: 6px 0;
    color: var(--text-light);
}

/* ===== SHOWCASE SCREEN ===== */
.showcase-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: #ffffff;
}

.content-wrapper {
    display: flex;
    flex: 1;
    gap: 0;
    overflow: hidden;
}

.panel {
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    overflow: hidden;
}

.left-panel {
    flex: 1;
    min-width: 300px;
}

.right-panel {
    flex: 0 0 400px;
    background-color: #ffffff;
    color: var(--text-dark);
    border-left: 1px solid var(--border-color);
}

.panel-header {
    background-color: #ffffff;
    color: var(--text-dark);
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 14px;
}

.panel-header-title {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.panel-header-title .title-eng {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-dark);
    text-align: right;
}

.panel-header-title .title-chi {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-light);
    text-align: right;
}

.iframe-display {
    flex: 1;
    border: none;
    width: 100%;
    height: 100%;
}

/* ===== DIVIDER ===== */
.divider {
    width: 4px;
    background-color: var(--border-color);
    cursor: col-resize;
    transition: background-color 0.3s;
    flex-shrink: 0;
}

.divider:hover {
    background-color: var(--primary-color);
}

.divider.dragging {
    background-color: var(--primary-color);
}

/* ===== SETUP PAGE SECTIONS ===== */
.setup-section {
    margin-bottom: 28px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    background: var(--bg-light);
}

.setup-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.setup-section .input-section {
    margin-bottom: 16px;
}

.setup-section .input-section:last-child {
    margin-bottom: 0;
}

.setup-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    min-height: 72px;
    transition: all 0.3s;
}

.setup-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ===== PROGRAMME INFORMATION AREA ===== */
.info-logo {
    height: 126px;
    width: auto;
    object-fit: contain;
}

/* Persistent programme name bar (shown across all slides) */
.persistent-info {
    padding: 12px 18px 10px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
}

.persistent-info .course-code-badge {
    margin-bottom: 6px;
}

.persistent-info p:first-of-type {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.persistent-info p[lang="zh-Hant"] {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-light);
    margin-top: 2px;
}

/* Slides wrapper */
.slides-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.7s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.slide.active {
    opacity: 1;
    pointer-events: auto;
}

/* Slide indicator dots */
.slide-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 8px 0;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
    cursor: pointer;
    transition: background 0.3s;
}

.dot.active {
    background: var(--primary-color);
}

.info-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #f0f6ff 100%);
}

/* Programme Name — top section */
.prog-name {
    padding: 16px 20px 16px;
    margin: 18px 18px 0;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
}

.prog-name p:first-child {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.prog-name p[lang="zh-Hant"] {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-light);
    margin-top: 4px;
}

.course-code-badge {
    display: inline-flex;
    align-items: center;
    margin-bottom: 8px;
    background: var(--primary-color);
    border-radius: 20px;
    padding: 3px 12px;
}

.course-code-badge span {
    font-size: 0.82rem;
    font-weight: 700;
    color: #ffffff;
}

/* QR Section — fills remaining space, vertically centred, shifted up 100px */
.qr-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 20px 20px;
    margin-top: -100px;
}

/* Slogan */
.slogan {
    text-align: center;
    padding: 4px 0 8px;
}

.slogan p:first-child {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.5;
}

.slogan p[lang="zh-Hant"] {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-light);
}

/* QR Code block */
.qr-block {
    filter: drop-shadow(0 4px 16px rgba(59, 130, 246, 0.18));
}

.qr-image {
    width: 175px;
    height: 175px;
    border-radius: 12px;
    background: #ffffff;
    display: block;
}

.qr-image-lg {
    width: 200px;
    height: 200px;
}

/* Animated arrow pointing up at QR */
.qr-arrow {
    font-size: 2.4rem;
    color: var(--primary-color);
    line-height: 1;
    animation: bounceUp 1.1s ease-in-out infinite;
}

@keyframes bounceUp {
    0%, 100% { transform: translateY(0);    opacity: 1; }
    50%       { transform: translateY(-8px); opacity: 0.7; }
}

/* Scan text */
.scan-text {
    text-align: center;
    background: var(--primary-color);
    border-radius: 10px;
    padding: 8px 20px;
}

.scan-text p {
    font-size: 0.92rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.6;
}

.scan-text p[lang="zh-Hant"] {
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255,255,255,0.85);
}

/* ===== SLIDE 2: PROGRAMME DETAILS ===== */
.info-container-2 {
    gap: 12px;
    padding: 16px 18px 12px;
    overflow-y: auto;
    justify-content: flex-start;
    background: linear-gradient(180deg, #ffffff 0%, #f0f6ff 100%);
}

.prog-detail-block {
    width: 100%;
    background: #ffffff;
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.07);
}

.detail-heading {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

.detail-heading span:first-child {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-heading span[lang="zh-Hant"] {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-light);
}

.detail-text {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.55;
    white-space: pre-line;
}

.detail-text-chi {
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-light);
    margin-top: 4px;
}

.qr-section-small {
    flex: 0;
    gap: 8px;
    padding: 8px 0 4px;
    margin-top: 0;
}

/* Gear / Setup button — fixed lower-right corner */
.setup-btn {
    position: fixed;
    bottom: 14px;
    right: 16px;
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    z-index: 100;
}

.setup-btn:hover {
    color: #6b7280;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .right-panel {
        flex: 0 0 350px;
    }
}

@media (max-width: 768px) {
    .start-container {
        padding: 40px 30px;
    }

    .start-container h1 {
        font-size: 2rem;
    }

    .button-group {
        flex-direction: column;
    }

    .content-wrapper {
        flex-direction: column;
    }

    .left-panel,
    .right-panel {
        flex: 1 !important;
    }

    .divider {
        width: 100%;
        height: 4px;
    }

    .right-panel {
        flex: 0 0 250px !important;
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
}
