/* Bankers Edge Deck Generator — Premium Dark Theme */

/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --navy: #1c2570;
    --navy-dark: #111a4a;
    --blue: #0072e5;
    --blue-medium: #1257a5;
    --blue-glow: rgba(0, 114, 229, 0.35);
    --grey: #808080;
    --light-grey: #f2f2f2;
    --white: #ffffff;
    --black: #333333;
    --glass-bg: rgba(18, 22, 60, 0.72);
    --glass-border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(255, 255, 255, 0.07);
    --input-border: rgba(255, 255, 255, 0.15);
    --input-focus-border: rgba(0, 114, 229, 0.6);
    --font: 'Calibri', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font);
    color: var(--white);
    background: var(--navy-dark);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
}

/* === Skyline Background === */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: url("../images/01_title_skyline.png") center center / cover no-repeat;
    z-index: -2;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(
        165deg,
        rgba(17, 26, 74, 0.88) 0%,
        rgba(28, 37, 112, 0.82) 40%,
        rgba(18, 87, 165, 0.78) 100%
    );
    z-index: -1;
}

/* === Header === */
.header {
    background: rgba(17, 26, 74, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0 2rem;
    height: 64px;
    min-height: 64px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 10;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
}

.header-logo {
    height: 36px;
    width: auto;
}

.header-title {
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 600;
    opacity: 0.7;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 1rem;
}

/* === Main === */
.main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2.5rem 1rem;
    position: relative;
    z-index: 1;
}

.container {
    width: 100%;
    max-width: 640px;
}

/* === Glassmorphism Card === */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2.25rem;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.card h1 {
    font-size: 1.6rem;
    color: var(--white);
    margin-bottom: 0.25rem;
    letter-spacing: -0.01em;
}

.card h2 {
    font-size: 1.35rem;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* Blue accent line under h1 */
.card h1::after {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    background: var(--blue);
    border-radius: 2px;
    margin-top: 0.6rem;
    margin-bottom: 0.15rem;
}

/* === Login Error === */
.login-error {
    background: rgba(198, 40, 40, 0.12);
    border: 1px solid rgba(198, 40, 40, 0.3);
    color: #ef5350;
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

/* === Forgot Password Link === */
.forgot-link {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.88rem;
}

.forgot-link a {
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
    transition: color 0.15s;
}

.forgot-link a:hover {
    color: var(--blue);
}

/* === Login Success (green variant of login-error) === */
.login-success {
    background: rgba(46, 125, 50, 0.12);
    border: 1px solid rgba(46, 125, 50, 0.3);
    color: #66bb6a;
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

/* === Logout Link === */
.header-logout {
    margin-left: auto;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    text-decoration: none;
    padding: 0.3rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.header-logout:hover {
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

/* === Form === */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
    color: rgba(255, 255, 255, 0.85);
}

.required {
    color: #ef5350;
}

.optional {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 400;
    font-size: 0.85rem;
}

input[type="url"],
input[type="email"],
input[type="password"],
input[type="file"],
textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-family: var(--font);
    font-size: 0.95rem;
    color: var(--white);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background: var(--input-bg);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="url"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

input[type="url"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px var(--blue-glow);
}

input[type="file"] {
    padding: 0.5rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
}

input[type="file"]::file-selector-button {
    background: var(--blue);
    color: var(--white);
    border: none;
    border-radius: 5px;
    padding: 0.35rem 0.85rem;
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    margin-right: 0.75rem;
    transition: background 0.15s;
}

input[type="file"]::file-selector-button:hover {
    background: var(--blue-medium);
}

textarea {
    resize: vertical;
}

.help-text {
    display: block;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 0.3rem;
}

/* === Toggle (PDF / Text) === */
.toggle-group {
    display: flex;
    gap: 0;
    margin-bottom: 0.75rem;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    overflow: hidden;
    width: fit-content;
}

.toggle-btn {
    padding: 0.45rem 1rem;
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.toggle-btn:hover {
    color: rgba(255, 255, 255, 0.7);
}

.toggle-btn.active {
    background: var(--blue);
    color: var(--white);
}

.toggle-content {
    display: none;
}

.toggle-content.active {
    display: block;
}

/* === Checkbox === */
.checkbox-group {
    margin-top: 0.5rem;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400 !important;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--blue);
}

/* === Buttons === */
.btn-primary {
    display: inline-block;
    width: 100%;
    padding: 0.8rem 1.5rem;
    background: var(--blue);
    color: var(--white);
    font-family: var(--font);
    font-size: 1.05rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s, box-shadow 0.2s;
    margin-top: 0.75rem;
    box-shadow: 0 4px 16px var(--blue-glow);
}

.btn-primary:hover {
    background: #0080ff;
    box-shadow: 0 6px 24px rgba(0, 114, 229, 0.5);
}

.btn-primary:disabled,
.btn-primary.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    pointer-events: none;
}

.btn-secondary {
    display: inline-block;
    width: 100%;
    padding: 0.6rem 1.5rem;
    background: transparent;
    color: var(--blue);
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid rgba(0, 114, 229, 0.4);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    margin-top: 0.75rem;
    transition: background 0.2s, border-color 0.2s;
}

.btn-secondary:hover {
    background: rgba(0, 114, 229, 0.1);
    border-color: var(--blue);
}

/* === Progress === */
.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    margin: 1.25rem 0 1rem;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--blue), #38a0ff);
    border-radius: 3px;
    box-shadow: 0 0 12px var(--blue-glow);
}

.progress-step {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    min-height: 1.4em;
}

.progress-hint {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 0.5rem;
}

/* === Download / Success === */
.success-icon {
    width: 56px;
    height: 56px;
    background: rgba(46, 125, 50, 0.15);
    color: #66bb6a;
    border: 1px solid rgba(46, 125, 50, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

#download-section .subtitle {
    margin-bottom: 1.25rem;
}

/* === Error === */
.error-icon {
    width: 56px;
    height: 56px;
    background: rgba(198, 40, 40, 0.12);
    color: #ef5350;
    border: 1px solid rgba(198, 40, 40, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.error-message {
    color: #ef5350;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    word-break: break-word;
}

/* === Footer === */
.footer {
    background: rgba(17, 26, 74, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid var(--glass-border);
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
    padding: 1rem 2rem;
    font-size: 0.75rem;
    line-height: 1.5;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

/* === Site Redirect Card (login page) === */
.site-redirect-card {
    text-align: center;
    margin-top: 1.5rem;
    padding: 1.5rem 1.75rem 1.75rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.redirect-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.redirect-divider::before,
.redirect-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
}

.redirect-divider span {
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.redirect-icon {
    font-size: 2rem;
    margin-bottom: 0.6rem;
    line-height: 1;
}

.redirect-heading {
    font-size: 1.05rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0.4rem;
}

.redirect-subtext {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.5;
    margin-bottom: 1.1rem;
}

.redirect-btn {
    display: inline-block;
    width: 100%;
    padding: 0.7rem 1.5rem;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--white);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.redirect-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* === Utility === */
.hidden {
    display: none !important;
}

/* === Slide Editor === */
.slide-editor {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.editor-heading {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 0.2rem;
}

.editor-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 1rem;
}

/* Slide List */
.slide-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.slide-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    transition: background 0.2s, border-color 0.3s;
}

.slide-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.18);
}

.slide-item.slide-updated {
    animation: greenSweep 1.6s ease forwards;
}

@keyframes greenSweep {
    0% {
        background: linear-gradient(90deg, rgba(46, 160, 60, 0.35) 0%, transparent 0%);
        border-color: rgba(46, 160, 60, 0.5);
    }
    30% {
        background: linear-gradient(90deg, rgba(46, 160, 60, 0.35) 100%, transparent 100%);
        border-color: rgba(46, 160, 60, 0.6);
    }
    60% {
        background: rgba(46, 160, 60, 0.25);
        border-color: rgba(46, 160, 60, 0.6);
    }
    100% {
        background: rgba(255, 255, 255, 0.04);
        border-color: rgba(255, 255, 255, 0.12);
    }
}

.slide-number {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--blue);
    white-space: nowrap;
    min-width: 52px;
}

.slide-title {
    flex: 1;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.slide-edit-btn {
    padding: 0.3rem 0.75rem;
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--blue);
    background: transparent;
    border: 1px solid rgba(0, 114, 229, 0.35);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.slide-edit-btn:hover {
    background: rgba(0, 114, 229, 0.1);
    border-color: var(--blue);
}

/* Edit Panel — inline within slide-item */
.edit-panel {
    width: 100%;
    margin-top: 0.25rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.slide-item:has(.edit-panel) {
    border-color: var(--blue);
    background: rgba(0, 114, 229, 0.08);
}

/* Action Buttons */
.edit-actions {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.85rem;
}

.action-btn {
    flex: 1;
    padding: 0.5rem 0.85rem;
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    background: transparent;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.action-btn:hover {
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.3);
}

.action-btn.active {
    background: var(--blue);
    color: var(--white);
    border-color: var(--blue);
}

/* Edit submit button */
.edit-submit-btn {
    width: 100%;
    margin-top: 0.25rem;
}

/* Edit Loading Spinner */
.edit-loading {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.75rem;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.7);
}

.edit-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Edit Error */
.edit-error {
    margin-top: 0.6rem;
    font-size: 0.88rem;
    color: #ef5350;
}

/* === Responsive === */
@media (max-width: 680px) {
    .main {
        padding: 1.5rem 0.75rem;
    }

    .card {
        padding: 1.5rem;
        border-radius: 12px;
    }
}

/* === Tab Bar === */
.tab-bar {
    display: flex;
    gap: 0;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--glass-border);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: rgba(255, 255, 255, 0.7);
}

.tab-btn.active {
    color: var(--white);
    border-bottom-color: var(--blue);
}

/* === Pillar Content === */
.pillar-content.hidden {
    display: none !important;
}

/* === Section Selector === */
.section-selector {
    margin-bottom: 0.75rem;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.section-header-label {
    display: flex !important;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.85rem;
    cursor: pointer;
    font-weight: 600 !important;
    font-size: 0.92rem !important;
    color: rgba(255, 255, 255, 0.9) !important;
    margin-bottom: 0 !important;
}

.section-header-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--blue);
    flex-shrink: 0;
}

.section-header-text {
    flex: 1;
}

.section-slide-count {
    font-size: 0.78rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.35);
}

.section-expand-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.7rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    transition: transform 0.2s, color 0.15s;
}

.section-expand-btn:hover {
    color: rgba(255, 255, 255, 0.6);
}

.section-expand-btn.collapsed {
    transform: rotate(-90deg);
}

.section-slides {
    padding: 0 0.85rem 0.65rem 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.section-slides.collapsed {
    display: none;
}

.slide-check {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem !important;
    font-weight: 400 !important;
    color: rgba(255, 255, 255, 0.65) !important;
    cursor: pointer;
    margin-bottom: 0 !important;
}

.slide-check input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--blue);
}

/* === Data Notice === */
.data-notice {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 0.75rem;
    text-align: center;
    line-height: 1.4;
}

/* === Text Input === */
input[type="text"] {
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-family: var(--font);
    font-size: 0.95rem;
    color: var(--white);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background: var(--input-bg);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px var(--blue-glow);
}
