@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Fraunces:opsz,wght@9..144,400;600;700&family=Great+Vibes&display=swap');

:root {
    --font-sans: 'Space Grotesk', sans-serif;
    --font-display: 'Fraunces', serif;
    --font-script: 'Great Vibes', cursive;

    --bg-0: #0b1114;
    --bg-1: #0f1b1f;
    --bg-2: #0b2328;
    --bg-3: #123038;

    --surface-0: #101c20;
    --surface-1: #14242a;
    --surface-2: #1a2f36;
    --surface-3: #203740;

    --paper-0: #fdf8ef;
    --paper-1: #f2eadf;
    --paper-2: #e9dfd0;

    --text-0: #e7f1f2;
    --text-1: #c6d4d8;
    --text-2: #9bb0b6;

    --brand-0: #2aa198;
    --brand-1: #1f7a73;
    --brand-2: #145a55;

    --accent-0: #f59e0b;
    --accent-1: #f97316;
    --accent-2: #fbbf24;

    --success: #22c55e;
    --danger: #ef4444;

    --shadow-lg: 0 20px 60px rgba(3, 7, 9, 0.55);
    --shadow-md: 0 12px 35px rgba(3, 7, 9, 0.4);
    --ring: rgba(245, 158, 11, 0.35);
}

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

body {
    font-family: var(--font-sans);
    background: linear-gradient(135deg, var(--bg-0) 0%, var(--bg-2) 45%, var(--bg-1) 100%);
    height: 100vh;
    overflow: hidden;
    color: var(--text-0);
    display: flex;
    flex-direction: column;
    position: relative;
    isolation: isolate;
}

body::before {
    content: "";
    position: fixed;
    inset: -20vmax;
    background:
        radial-gradient(35vmax 28vmax at 12% 10%, rgba(42, 161, 152, 0.38), transparent 60%),
        radial-gradient(30vmax 24vmax at 92% 18%, rgba(245, 158, 11, 0.26), transparent 62%),
        radial-gradient(28vmax 22vmax at 70% 90%, rgba(34, 197, 94, 0.18), transparent 60%);
    z-index: -2;
    pointer-events: none;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
    opacity: 0.5;
    z-index: -1;
    pointer-events: none;
}

.container {
    flex: 1;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    overflow: hidden;
    width: 100vw;
    max-width: 100vw;
}

.sidebar {
    background: linear-gradient(180deg, rgba(16, 28, 32, 0.98) 0%, rgba(12, 23, 26, 0.95) 100%);
    padding: 20px;
    height: calc(100vh - 56px);
    overflow-y: auto;
    overflow-x: hidden;
    color: var(--text-1);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
}

.sidebar h1 {
    font-family: var(--font-display);
    font-size: 22px;
    margin-bottom: 8px;
    color: var(--text-0);
}

.sidebar p {
    font-size: 12px;
    color: var(--text-2);
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--text-2);
}

.form-group select,
.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--surface-3);
    border-radius: 8px;
    font-size: 13px;
    font-family: var(--font-sans);
    background: var(--surface-1);
    color: var(--text-1);
    transition: all 0.3s ease;
}

.form-input::placeholder {
    color: rgba(231, 241, 242, 0.45);
}

.form-group select {
    cursor: pointer;
}

.form-group select:focus,
.form-input:focus {
    outline: none;
    border-color: var(--accent-0);
    box-shadow: 0 0 0 4px var(--ring);
}

.form-group select:disabled {
    background: rgba(255, 255, 255, 0.06);
    cursor: not-allowed;
    opacity: 0.6;
}

.input-with-button {
    display: flex;
    gap: 8px;
}

.input-with-button .form-input {
    flex: 1;
}

.btn-icon {
    padding: 12px 16px;
    background: var(--surface-1);
    border: 1px solid var(--surface-3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-1);
}

.btn-icon:hover {
    background: var(--brand-0);
    border-color: var(--brand-0);
    color: #061315;
    transform: scale(1.05);
}

.btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    letter-spacing: 0.2px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-0), var(--brand-2));
    color: #071417;
    box-shadow: 0 10px 24px rgba(42, 161, 152, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(42, 161, 152, 0.45);
}

.btn-secondary {
    background: transparent;
    color: var(--accent-0);
    border: 1px solid rgba(245, 158, 11, 0.5);
}

.btn-secondary:hover {
    background: var(--accent-0);
    color: #071417;
}

.btn-success {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #061015;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: #140909;
}

.btn-group {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

input[type="file"] {
    display: none;
}

.preview-section {
    background:
        radial-gradient(1200px 600px at 15% 10%, rgba(42, 161, 152, 0.25), transparent 60%),
        radial-gradient(900px 500px at 90% 20%, rgba(245, 158, 11, 0.18), transparent 60%),
        linear-gradient(135deg, #0a1417 0%, #0c2329 45%, #0b1b20 100%);
    padding: 30px;
    height: calc(100vh - 56px);
    overflow: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    /* Hide scrollbar but keep scroll functionality */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

.preview-section::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

.placeholder-text {
    font-size: 18px;
    color: rgba(231, 241, 242, 0.7);
    text-align: center;
}

.placeholder-card {
    background: var(--paper-0);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 60px 50px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    border: 1px solid rgba(20, 33, 38, 0.08);
}

.placeholder-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.placeholder-title {
    font-family: var(--font-display);
    font-size: 32px;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--brand-0), var(--accent-0));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.placeholder-subtitle {
    font-size: 16px;
    color: #4a5e64;
    margin-bottom: 35px;
    line-height: 1.6;
}

.social-links {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.social-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.social-btn.github {
    background: #24292e;
    color: white;
}

.social-btn.github:hover {
    background: #1a1e22;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(36, 41, 46, 0.4);
}

.social-btn.coffee {
    background: #FFDD00;
    color: #000;
}

.social-btn.coffee:hover {
    background: #ffcc00;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 221, 0, 0.4);
}

/* LARGE CARD - 900px for maximum visibility */
.id-card {
    /* Removed width: 100% to allow fixed width on horizontal cards */
    max-width: 900px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    margin: 0 auto;
    position: relative;
}

.horizontal-card {
    aspect-ratio: 85.6 / 54;
    width: 700px;
    /* Fixed larger width */
    max-width: 100%;
}

/* Horizontal Card - Optimized Layout */
.horizontal-card .card-header {
    padding: 15px 25px;
}

.horizontal-card .university-logo {
    width: 55px;
    height: 55px;
}

.horizontal-card .university-name {
    font-size: 24px;
}

.horizontal-card .university-full-name {
    font-size: 12px;
}

.horizontal-card .card-content {
    padding: 15px 25px;
    align-items: center;
    /* Center vertically */
}


.horizontal-card .info-row .value {
    font-size: 13px;
}

.horizontal-card .info-row .id-number {
    font-size: 14px !important;
}

.horizontal-card .info-row .email {
    font-size: 12px !important;
}

.horizontal-card .card-footer {
    padding: 12px 25px;
}

.horizontal-card .signature-text {
    font-size: 24px;
}

.horizontal-card .signature-label {
    font-size: 9px;
}

.horizontal-card .barcode-svg {
    width: 90px;
    height: 28px;
}

.horizontal-card .barcode-number {
    font-size: 10px;
}

.vertical-card {
    aspect-ratio: 54 / 85.6;
    width: 500px;
}

.glass-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.05));
    pointer-events: none;
    opacity: 0.4;
    mix-blend-mode: overlay;
}

.card-header {
    padding: 24px;
    color: white;
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
    z-index: 1;
}

.university-logo {
    width: 70px;
    height: 70px;
    object-fit: contain;
    background: white;
    padding: 10px;
    border-radius: 12px;
}

.university-info {
    flex: 1;
}

.university-name {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
}

.university-full-name {
    font-size: 14px;
    opacity: 0.95;
}

.card-content {
    padding: 30px;
    display: flex;
    gap: 25px;
    position: relative;
    z-index: 1;
}

.horizontal-card .card-content {
    flex-direction: row;
}

.vertical-card .card-content {
    flex-direction: column;
    align-items: center;
}

.student-photo {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 14px;
    border: 4px solid white;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.vertical-card .student-photo {
    width: 160px;
    height: 160px;
}

.student-info {
    flex: 1;
}

.vertical-card .student-info {
    width: 100%;
}

.info-row {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.info-row .label {
    font-size: 12px;
    font-weight: 600;
    color: #6a7b80;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.info-row .value {
    font-size: 16px;
    font-weight: 500;
    color: #25363a;
}

.info-row .id-number {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: var(--accent-1);
    font-size: 18px;
}

.info-row .email {
    font-size: 14px;
    color: #58686d;
}

.card-footer {
    padding: 24px 30px;
    background: rgba(0, 0, 0, 0.02);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.signature {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.signature-text {
    font-family: var(--font-script);
    font-size: 32px;
    color: #333;
}

.signature-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
}

.barcode {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.barcode-svg {
    width: 110px;
    height: 35px;
}

.barcode-number {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #666;
}

.social-footer {
    margin-top: 25px;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.social-link-small {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.social-link-small:hover {
    color: white;
    transform: translateY(-1px);
}

.social-divider {
    color: rgba(255, 255, 255, 0.4);
    font-size: 16px;
}

@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .id-card {
        max-width: 100%;
    }

    .vertical-card {
        width: 100%;
        max-width: 400px;
    }

    .social-links {
        flex-direction: column;
    }

    .social-footer {
        flex-direction: column;
        gap: 10px;
    }

    .social-divider {
        display: none;
    }
}

/* ==================== */
/* ID CARD BACK SIDE    */
/* ==================== */

.cards-container {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
}

.card-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.card-label {
    display: none;
    /* Hidden - not necessary */
}

.id-card-back {
    width: 700px;
    max-width: 100%;
    aspect-ratio: 85.6 / 54;
    background: #f5f5f5;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
}

.id-card-back.vertical-card {
    width: 500px;
    aspect-ratio: 54 / 85.6;
}

.card-back-header {
    padding: 12px 20px;
    color: white;
}

.back-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.card-back-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: calc(100% - 50px);
}

.back-address {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.address-text {
    margin: 0;
    font-size: 13px;
    color: #333;
    line-height: 1.5;
}

.address-text:first-child {
    font-weight: 600;
    color: var(--brand-0);
    font-size: 14px;
}

.back-terms {
    flex: 1;
}

.terms-text {
    font-size: 11px;
    color: #555;
    line-height: 1.6;
    margin: 0 0 15px 0;
}

.emergency-contact {
    background: rgba(0, 0, 0, 0.03);
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
}

.contact-label {
    font-size: 10px;
    font-weight: 700;
    color: #333;
    letter-spacing: 0.5px;
}

.contact-info {
    font-size: 11px;
    color: #666;
    margin: 3px 0;
}

.back-signature-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.signature-box {
    display: flex;
    flex-direction: column;
}

.signature-text-back {
    font-family: var(--font-script);
    font-size: 28px;
    color: #333;
}

.signature-label-back {
    font-size: 9px;
    color: #999;
    text-transform: uppercase;
    margin-top: 5px;
}

.back-photo {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #ddd;
}

.back-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 1500px) {
    .cards-container {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 768px) {
    .id-card-back {
        width: 100%;
        max-width: 400px;
    }

    .cards-container {
        gap: 20px;
    }
}

/* ==================== */
/* TOP NAVIGATION BAR   */
/* ==================== */

.top-nav {
    background: rgba(12, 22, 25, 0.92);
    backdrop-filter: blur(10px);
    padding: 12px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 12px 30px rgba(3, 7, 9, 0.35);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-left,
.nav-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-center {
    display: flex;
    gap: 5px;
    background: rgba(255, 255, 255, 0.06);
    padding: 4px;
    border-radius: 10px;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--brand-0), var(--brand-2));
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(42, 161, 152, 0.35);
}

.nav-tab {
    background: transparent;
    border: none;
    color: rgba(231, 241, 242, 0.75);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.3s ease;
}

.nav-tab:hover {
    color: white;
    background: rgba(255, 255, 255, 0.08);
}

.nav-tab.active {
    background: linear-gradient(135deg, var(--brand-0), var(--brand-2));
    color: #071417;
}

.nav-btn {
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
}

.download-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.download-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.download-zip {
    background: linear-gradient(135deg, var(--accent-0), var(--accent-1));
    color: #081317;
}

.download-zip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
}

@media (max-width: 1200px) {
    .top-nav {
        flex-wrap: wrap;
        gap: 15px;
        padding: 15px;
    }

    .nav-center {
        order: 3;
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .nav-right {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-tab {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* ==================== */
/* MODE & DOC TABS      */
/* ==================== */

.nav-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-label {
    color: rgba(231, 241, 242, 0.72);
    font-size: 12px;
    font-weight: 500;
}

.mode-btn {
    background: transparent;
    border: 1px solid rgba(231, 241, 242, 0.25);
    color: rgba(231, 241, 242, 0.7);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.mode-btn.active {
    background: linear-gradient(135deg, var(--brand-0), var(--brand-2));
    border-color: transparent;
    color: #071417;
}

.doc-tab {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.8);
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 12px;
    transition: all 0.3s ease;
}

.doc-tab:hover {
    background: rgba(255, 255, 255, 0.2);
}

.doc-tab.active {
    background: var(--accent-0);
    color: #091317;
}

.nav-mode {
    background: rgba(0, 0, 0, 0.2);
    padding: 6px 12px;
    border-radius: 8px;
}

.nav-docs {
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 8px;
}

.nav-view {
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 8px;
}

/* ==================== */
/* DOCUMENT TEMPLATES   */
/* ==================== */

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.extra-docs {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.document-preview {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    font-size: 11px;
    color: #333;
}

.doc-header {
    padding: 15px 20px;
    color: white;
    text-align: center;
}

.doc-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
}

.doc-header p {
    margin: 5px 0 0;
    font-size: 10px;
    opacity: 0.9;
}

.doc-title {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    padding: 15px;
    background: #f5f5f5;
    border-bottom: 1px solid #eee;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.doc-content {
    padding: 15px 20px;
}

.doc-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px dotted #eee;
}

.doc-row span:first-child {
    font-weight: 600;
    color: #555;
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 10px;
}

.doc-table th {
    background: #f9f9f9;
    padding: 8px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.doc-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #eee;
}

.doc-table tr.total td,
.doc-table tr.balance td {
    font-weight: 700;
    background: #f9f9f9;
}

.doc-table tr.balance td {
    color: var(--success);
}

.term-header {
    background: #333;
    color: white;
    padding: 8px 12px;
    margin: 15px 0 10px;
    font-weight: 600;
    font-size: 11px;
    border-radius: 4px;
}

.gpa-box {
    display: flex;
    justify-content: space-between;
    background: #f5f5f5;
    padding: 12px;
    margin-top: 15px;
    border-radius: 6px;
    font-size: 10px;
}

.gpa-box .gpa {
    font-weight: 700;
    color: var(--brand-0);
}

.schedule-footer {
    text-align: right;
    font-weight: 600;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 2px solid #eee;
}

/* Letter/Certificate Styles */
.doc-letterhead {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border-bottom: 3px solid;
}

.letterhead-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.letterhead-info h2 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.letterhead-info p {
    margin: 3px 0 0;
    font-size: 11px;
    color: #666;
}

.letter-content,
.cert-content {
    padding: 25px 30px;
}

.letter-title,
.cert-title {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin: 0 0 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.letter-date,
.cert-date {
    color: #666;
    font-size: 11px;
    margin-bottom: 20px;
}

.letter-salutation {
    font-weight: 600;
    margin-bottom: 15px;
}

.letter-body,
.cert-body {
    margin: 12px 0;
    line-height: 1.7;
    text-align: justify;
}

.admission-box {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
}

.admission-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
}

.admission-row span:first-child {
    font-weight: 600;
}

.letter-closing {
    margin-top: 20px;
    font-style: italic;
}

.letter-signature,
.cert-signature {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
}

.sig-name {
    font-family: var(--font-script);
    font-size: 24px;
    color: #333;
}

.sig-title {
    font-size: 10px;
    color: #666;
    margin-top: 5px;
}

.cert-header {
    font-weight: 600;
    margin-bottom: 15px;
}

.cert-note {
    font-style: italic;
    color: #666;
    margin-top: 25px;
    font-size: 10px;
}

@media (max-width: 768px) {
    .documents-grid {
        grid-template-columns: 1fr;
    }

    .extra-docs {
        grid-template-columns: 1fr;
    }
}

/* Teacher Certificate Details */
.cert-details {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin: 25px 0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dotted #ddd;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row span:first-child {
    font-weight: 600;
    color: #555;
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Update button colors for dark theme */
.btn-success {
    background: linear-gradient(135deg, #16a34a, #22c55e) !important;
    color: #061015;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #f97316) !important;
    color: #140909;
}

/* Zoom Controls */
.zoom-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(8, 14, 16, 0.85);
    padding: 10px 15px;
    border-radius: 10px;
    z-index: 100;
}

.zoom-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--surface-2);
    color: white;
    font-size: 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.zoom-btn:hover {
    background: var(--surface-3);
}

.zoom-level {
    color: white;
    font-size: 13px;
    font-weight: 500;
    min-width: 45px;
    text-align: center;
}

#cardPreview {
    transform-origin: center center;
    transition: transform 0.2s ease;
    cursor: grab;
}

#cardPreview:active {
    cursor: grabbing;
}

/* Individual card dragging */
.card-wrapper {
    cursor: grab;
    transition: box-shadow 0.2s ease;
    position: relative;
}

.card-wrapper:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.card-wrapper:active {
    cursor: grabbing;
}

/* Document preview dragging */
.document-preview {
    cursor: grab;
    transition: box-shadow 0.2s ease, transform 0.1s ease;
    position: relative;
}

.document-preview:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.document-preview:active {
    cursor: grabbing;
}

/* Fix responsive - prevent extra space on right */
.documents-grid {
    max-width: 100%;
    overflow-x: hidden;
}

@media (max-width: 1200px) {
    .documents-grid {
        grid-template-columns: 1fr 1fr;
    }

    .extra-docs {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .documents-grid {
        grid-template-columns: 1fr;
    }
}

/* Fix preview section responsive */
.preview-section {
    min-width: 0;
}

#cardPreview {
    max-width: 100%;
}

/* Fix dark area on right - body scrollbar */
body::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

html,
body {
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
    overflow-x: hidden;
}

/* Ensure preview fills to edge - removed extra padding */
.preview-section {
    margin-right: 0;
    padding-right: 30px;
    box-sizing: border-box;
}

/* Container should fill entire width */
.container {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Responsive - hide dark background on narrow screens */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .preview-section {
        width: 100vw;
        min-width: 100vw;
    }
}

/* Ensure preview covers full remaining width */
.preview-section {
    background:
        radial-gradient(1200px 600px at 15% 10%, rgba(42, 161, 152, 0.25), transparent 60%),
        radial-gradient(900px 500px at 90% 20%, rgba(245, 158, 11, 0.18), transparent 60%),
        linear-gradient(135deg, #0a1417 0%, #0c2329 45%, #0b1b20 100%);
    width: 100%;
    min-width: 0;
    flex: 1;
}

/* Match body background to preview when sidebar hidden */
@media (max-width: 768px) {
    body {
        background: linear-gradient(135deg, var(--bg-0) 0%, var(--bg-2) 45%, var(--bg-1) 100%);
    }
}

/* Fix document dragging - need position for transforms */
.documents-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    position: relative;
}

.documents-grid .document-preview {
    position: relative;
    cursor: grab;
    user-select: none;
}

.documents-grid .document-preview:active {
    cursor: grabbing;
    z-index: 1000;
}

/* Allow documents to move outside container */
#cardPreview {
    overflow: visible;
}

/* ID Card dragging for Front/Back views */
.id-card,
.id-card-back {
    cursor: grab;
    position: relative;
}

.id-card:active,
.id-card-back:active {
    cursor: grabbing;
}

/* CRITICAL: Fix dark area on right side */
html {
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
    background: linear-gradient(135deg, var(--bg-0) 0%, var(--bg-2) 45%, var(--bg-1) 100%);
}

body {
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Ensure preview section fills remaining space */
.preview-section {
    flex: 1;
    min-width: 0;
    width: 100%;
}
