/* toolStyles.css - Updated for Full Responsiveness */

:root {
    --brand-blue: #2563eb; 
    --brand-gradient-start: #3b82f6;
    --brand-gradient-end: #06b6d4;
    --bg-light: #f9fafb;
    --border-gray: #e5e7eb;
    --text-dark: #1f2937;
    --primary-text: #0f172a; 
}

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;
    min-height: 100vh;
}

/* 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 0.5rem;
}

.header-bar h1 {
    font-size: 1.25rem; 
    font-weight: bold;
    color: var(--text-dark);
    flex-grow: 1; 
    text-align: center; 
}

@media (min-width: 640px) {
    .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 (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, var(--brand-gradient-start), var(--brand-gradient-end)); 
    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; color: #4b5563; }

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

/* 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;
    background: #f9fafb;
}
#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; cursor: pointer; }

/* 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: 2fr 2fr 3fr 4fr 1fr; 
    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;
}

/* Mobile labels via CSS */
.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: "Difficulty"; display: block; font-size: 0.7rem; color: #64748b; }
.distribution-row > div:nth-child(4)::before { content: "Type"; display: block; font-size: 0.7rem; color: #64748b; }

.distribution-row > div:nth-child(4) { 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;
    padding: 0;
}

@media (min-width: 640px) {
    .dist-grid-labels { display: grid; }
    .distribution-row { 
        grid-template-columns: 2fr 2fr 3fr 4fr 1fr; 
        border: none; 
        padding: 0; 
        background: transparent;
        margin-bottom: 0.75rem;
    }
    .distribution-row > div::before { display: none; } 
    .distribution-row > div:nth-child(4) { 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: #eff6ff; border: 1px dashed var(--brand-blue);
    color: var(--brand-blue); border-radius: 0.5rem; font-weight: 600; margin-top: 0.5rem; cursor: pointer;
}

.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(37, 99, 235, 0.4); margin-top: 1.5rem; cursor: pointer;
}

.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.8); 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); } }

/* Output styling */
#output-section { overflow-x: auto; }
.prose { max-width: 100% !important; }