:root {
    --brand-blue: #d81b60;
    --brand-pink: #f06292;
    --bg-light: #f9fafb;
    --border-gray: #e5e7eb;
    --text-dark: #1f2937;
    --primary-text: #0f172a;
    min-height: 100vh;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-light);
    color: var(--primary-text);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

/* RESPONSIVE HEADER */
.header-wrapper {
    width: 95%;
    max-width: 800px;
    margin: 1rem auto;
}

@media (min-width: 768px) {
    .header-wrapper {
        width: 70%;
    }
}

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
}

@media (max-width: 640px) {
    .header-bar {
        padding: 0.25rem;
    }

    .logo-container img {
        height: 30px;
    }
}

.header-bar h1 {
    font-size: 1.125rem;
    font-weight: bold;
    color: #1f2937;
    flex-grow: 1;
    text-align: center;
    line-height: 1.2;
}

@media (min-width: 640px) {
    .header-bar h1 {
        font-size: 1.5rem;
    }
}

@media (min-width: 768px) {
    .header-bar h1 {
        font-size: 1.875rem;
    }
}

.logo-container img {
    height: 35px;
    width: auto;
}

.main-wrapper {
    margin: 0 auto;
    padding: 0 0.75rem;
    min-height: 100vh;
}

.card-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    margin-top: 1rem;
}

/* RESPONSIVE CARD */
.teacher-card {
    background: white;
    width: 100%;
    max-width: 1200px;
    border: 1px solid var(--border-gray);
    border-top: 5px solid var(--brand-blue);
    border-radius: 1rem;
    padding: 3rem 1rem 1.5rem 1rem;
    position: relative;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

@media (max-width: 767px) {
    .teacher-card {
        padding: 2.5rem 1rem 1.5rem 1rem;
        border-radius: 0.75rem;
    }

    .card-badge {
        font-size: 0.65rem;
        padding: 0.4rem 1rem;
    }
}

@media (min-width: 768px) {
    .teacher-card {
        padding: 3.5rem 2rem 2.5rem 2rem;
    }
}

.card-badge {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(to right, #ec4899, var(--brand-blue));
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 2rem;
    font-weight: 700;
    font-size: 0.75rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }
}

.label-styled {
    display: block;
    font-weight: 700;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.input-styled {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-gray);
    border-radius: 0.5rem;
    background: #fdfdfd;
    font-size: 1rem;
}

#topics-select {
    overflow-x: auto;
}

#topics-select option {
    white-space: normal;
    word-wrap: break-word;
    padding: 4px 0;
    font-size: 0.9rem;
}

/* MARKS SECTION */
.marks-container {
    display: flex;
    gap: 0.75rem;
}

.marks-display {
    flex: 1;
    border: 2px solid var(--border-gray);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    padding: 0.5rem;
}

#total-marks-input {
    font-size: 1.25rem;
    font-weight: 800;
    text-align: center;
    border: none;
    width: 100%;
}

.edit-btn {
    background-color: #f97316;
    color: white;
    border-radius: 0.5rem;
    padding: 0 1.2rem;
    font-weight: 600;
}

/* RESPONSIVE DISTRIBUTION GRID */
.dist-header {
    font-weight: 700;
    border-bottom: 1px solid var(--border-gray);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.dist-grid-labels {
    display: none;
    grid-template-columns: 1fr 1fr 2fr 40px;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #64748b;
    text-align: center;
}

.distribution-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid var(--border-gray);
    border-radius: 0.75rem;
    background: #fcfcfc;
    position: relative;
}

.distribution-row>div:nth-child(1)::before {
    content: "No. Qs";
    display: block;
    font-size: 0.7rem;
    color: #64748b;
}

.distribution-row>div:nth-child(2)::before {
    content: "Marks/Q";
    display: block;
    font-size: 0.7rem;
    color: #64748b;
}

.distribution-row>div:nth-child(3)::before {
    content: "Type";
    display: block;
    font-size: 0.7rem;
    color: #64748b;
}

.distribution-row>div:nth-child(3) {
    grid-column: span 2;
}

.distribution-row .remove-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 25px;
    height: 25px;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 640px) {
    .dist-grid-labels {
        display: grid;
    }

    .distribution-row {
        grid-template-columns: 1fr 1fr 2fr 40px;
        border: none;
        padding: 0;
        background: transparent;
        margin-bottom: 0.75rem;
    }

    .distribution-row>div::before {
        display: none;
    }

    .distribution-row>div:nth-child(3) {
        grid-column: auto;
    }

    .distribution-row .remove-btn {
        position: static;
        width: 100%;
        height: auto;
        border-radius: 0.375rem;
    }
}

.btn-add {
    width: 100%;
    padding: 0.75rem;
    background: #fdf2f8;
    border: 1px dashed var(--brand-blue);
    color: var(--brand-blue);
    border-radius: 0.5rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.btn-generate {
    width: 100%;
    padding: 1rem;
    background: var(--brand-blue);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: 0 4px 6px -1px rgba(216, 27, 96, 0.4);
    margin-top: 1.5rem;
    cursor: pointer;
}

@media (max-width: 640px) {
    .btn-generate {
        font-size: 1rem;
        padding: 0.875rem;
    }
}

.footer-text {
    text-align: center;
    padding: 2rem 0;
    color: #9ca3af;
    font-size: 0.8rem;
}

/* API OVERLAY */
#api-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--brand-blue);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none !important;
}

/* Input Classes */
.question-input,
.marks-input,
.difficulty-input,
.type-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-gray);
    border-radius: 0.4rem;
}