/* ==================== GLOBAL STYLES ==================== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Modern Color Palette */
    --primary-color: #4F46E5;
    /* Indigo 600 */
    --primary-hover: #4338CA;
    /* Indigo 700 */
    --secondary-color: #8B5CF6;
    /* Violet 500 */
    --accent-color: #EC4899;
    /* Pink 500 */

    --bg-page: #F3F4F6;
    --bg-card: #FFFFFF;

    --text-main: #111827;
    --text-muted: #6B7280;

    --border-color: #E5E7EB;

    /* Gradients */
    --main-gradient: linear-gradient(135deg, #4F46E5 0%, #8B5CF6 100%);
    --card-gradient: linear-gradient(to right bottom, #ffffff, #f9fafb);
}

* {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* Header Gradient Background */
.header-bg {
    background: var(--main-gradient);
    padding-bottom: 4rem;
    margin-bottom: -3rem;
    /* Overlap effect */
    border-bottom-left-radius: 2rem;
    border-bottom-right-radius: 2rem;
}

/* Breadcrumb */
.breadcrumb a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: opacity 0.2s;
}

.breadcrumb a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* ==================== MODERN CARD STYLES ==================== */
.modern-card {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(229, 231, 235, 0.5);
    transition: transform 0.2s, box-shadow 0.2s;
}

.modern-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
}

/* ==================== INPUT FIELDS ==================== */
.modern-input {
    width: 100%;
    background-color: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.modern-input:focus {
    background-color: #FFFFFF;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    outline: none;
}

.modern-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}

/* ==================== UPLOAD ZONE ==================== */
.upload-zone {
    background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='12' ry='12' stroke='%23CBD5E0FF' stroke-width='2' stroke-dasharray='10%2c 10' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
    transition: all 0.3s;
    background-color: #F9FAFB;
}

.upload-zone:hover {
    background-color: #EEF2FF;
    background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='12' ry='12' stroke='%236366F1' stroke-width='2' stroke-dasharray='10%2c 10' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
}

/* ==================== NOTIFICATION TOAST ==================== */
.notification-toast {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10000;
    transform: translateX(150%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.notification-toast.show {
    transform: translateX(0);
}

/* ==================== QUESTION CARD (List Item) ==================== */
.question-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid #E5E7EB;
    position: relative;
    transition: all 0.2s ease;
}

.question-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Difficulty Badges */
.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-easy {
    background: #ECFDF5;
    color: #059669;
}

.badge-medium {
    background: #EEF2FF;
    color: #4F46E5;
}

.badge-hard {
    background: #FEF2F2;
    color: #DC2626;
}

/* ==================== BUTTONS ==================== */
.btn-primary {
    background: var(--main-gradient);
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(79, 70, 229, 0.25);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1px solid #E5E7EB;
    font-weight: 500;
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
}

.btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

/* ==================== QUESTION BANK STYLES ==================== */
.bank-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 400px;
    max-width: 90vw;
    background: white;
    box-shadow: -4px 0 25px rgba(0, 0, 0, 0.1);
    z-index: 5000;
    transform: translateX(110%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.bank-drawer.open {
    transform: translateX(0);
}

.bank-item {
    padding: 1rem;
    border-bottom: 1px solid #F3F4F6;
    transition: background 0.2s;
    cursor: pointer;
}

.bank-item:hover {
    background: #F9FAFB;
}

.bank-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: #6B7280;
}

.bank-item-text {
    font-size: 0.95rem;
    color: #1F2937;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Search Bar in Bank */
.bank-search {
    position: relative;
}

.bank-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
}

.bank-search input {
    padding-left: 2.5rem;
}

/* Hide lines control in preview (only for editors, not for final output) */
.lines-control {
    display: none !important;
}

/* ==================== PRINT & PREVIEW OVERRIDES ==================== */
@media print {

    .header-bg,
    .no-print,
    .modern-card,
    .btn-primary,
    .bank-drawer {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .pdf-page {
        margin: 0;
        padding: 0;
        box-shadow: none;
        border: none;
    }
}

/* Re-use previous print definitions but cleaned up */
.pdf-page {
    position: relative;
    width: 210mm;
    min-height: 297mm;
    padding: 20mm;
    background: white;
    margin: 0 auto;
    overflow: hidden;
}

.pdf-header {
    text-align: center;
    border-bottom: 3px double #000;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.pdf-header img {
    max-height: 80px;
    margin-bottom: 10px;
}

.pdf-meta-table {
    width: 100%;
    margin-top: 10px;
    border-collapse: collapse;
}

.pdf-meta-table td {
    padding: 4px;
    vertical-align: top;
}

.pdf-question {
    margin-bottom: 20px;
    break-inside: avoid;
}

.pdf-line {
    width: 100%;
    height: 30px;
    margin-bottom: 5px;
}

.pdf-line.solid {
    border-bottom: 1px solid #000;
}

.pdf-line.dashed {
    border-bottom: 1px dashed #000;
}

.pdf-line.dotted {
    border-bottom: 1px dotted #000;
}