/* ==========================================================================
   NYDTTA BD Result System - Modern Compact Stylesheet
   ========================================================================== */

.nydtta-main-container {
    width: 100%;
    max-width: 820px;
    margin: 20px auto 40px auto;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1e293b;
    box-sizing: border-box;
}

/* 1. Search Portal Card (Ultra Sleek & Compact) */
.nydtta-search-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.05);
    overflow: hidden;
    margin-bottom: 24px;
}

.nydtta-card-header-bar {
    background: #004d25; /* Deep Green Header */
    color: #ffffff;
    padding: 14px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.nydtta-card-title {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.2px;
}

.nydtta-card-subtitle {
    margin: 4px 0 0 0;
    font-size: 12.5px;
    color: #d1fae5;
    font-weight: 600;
}

.nydtta-form-body {
    padding: 18px 22px;
    background: #ffffff;
}

.nydtta-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 18px;
    margin-bottom: 16px;
}

@media (max-width: 600px) {
    .nydtta-form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.nydtta-form-group {
    display: flex;
    flex-direction: column;
}

.nydtta-label {
    font-size: 12.5px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 5px;
}

.nydtta-label .req {
    color: #dc2626;
    font-weight: 800;
}

.nydtta-label .opt {
    color: #94a3b8;
    font-weight: 500;
    font-size: 11px;
    margin-left: 2px;
}

.nydtta-input,
.nydtta-select {
    width: 100%;
    height: 38px;
    padding: 6px 12px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    font-size: 13.5px;
    color: #0f172a;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.nydtta-input:focus,
.nydtta-select:focus {
    background: #ffffff;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.nydtta-btn-row {
    text-align: center;
    margin-top: 8px;
}

.nydtta-btn-primary {
    background: #004d25;
    color: #ffffff;
    border: none;
    padding: 10px 32px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(0, 77, 37, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nydtta-btn-primary:hover {
    background: #00381b;
    box-shadow: 0 4px 14px rgba(0, 77, 37, 0.35);
    transform: translateY(-1px);
}

.nydtta-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: nydtta-spin 0.8s linear infinite;
    margin-left: 6px;
}

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

.nydtta-demo-hint {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: #64748b;
    flex-wrap: wrap;
}

.nydtta-chip {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #047857;
    padding: 3px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.nydtta-chip:hover {
    background: #e2e8f0;
    border-color: #059669;
}

/* 2. Output Area & Viewport Architecture */
.nydtta-output-area {
    width: 100%;
}

.nydtta-result-wrapper {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    margin-top: 15px;
    box-sizing: border-box !important;
    animation: nydttaFadeIn 0.35s ease-out;
}

@keyframes nydttaFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.nydtta-toolbar {
    margin-bottom: 12px;
    text-align: center;
}

.nydtta-print-btn {
    background: #004d25;
    color: #ffffff;
    border: none;
    padding: 8px 20px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.nydtta-print-btn:hover {
    background: #003318;
}

.nydtta-scaler-viewport {
    width: 760px;
    position: relative;
    margin: 0 auto;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
}

.nydtta-scaler-box {
    width: 760px;
    transform-origin: 0 0;
    margin: 0;
    position: relative;
    flex-shrink: 0;
}

/* 3. Marksheet Canvas (Compact & Space-Optimized) */
.nydtta-sheet {
    width: 760px;
    background: #ffffff;
    border: 2px solid #004d25;
    border-radius: 4px;
    padding: 22px 28px;
    box-sizing: border-box;
    box-shadow: 0 4px 18px rgba(0,0,0,0.06);
    color: #333333;
}

.nydtta-sheet-header {
    text-align: center;
    border-bottom: 2px solid #004d25;
    padding-bottom: 10px;
    margin-bottom: 16px;
}

.nydtta-sheet-title {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #004d25;
    letter-spacing: -0.2px;
}

.nydtta-sheet-subtitle {
    margin: 3px 0 0 0;
    font-size: 13px;
    color: #475569;
    font-weight: 600;
}

/* 4. Top Profile Section: Summary + Photo (Matching Screenshot & User Markup) */
.nydtta-top-profile-container {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    margin-bottom: 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.nydtta-top-summary {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    font-size: 14.5px !important;
    line-height: 1.65 !important;
    color: #800020 !important; /* Burgundy/Maroon */
    font-weight: 500 !important;
}

.nydtta-summary-row {
    margin-bottom: 2px !important;
}

.nydtta-summary-row .sum-label {
    font-weight: 700 !important;
    color: #800020 !important;
    display: inline-block !important;
    min-width: 105px !important;
}

.nydtta-summary-row .sum-val {
    color: #800020 !important;
    font-weight: 600 !important;
}

.nydtta-summary-row .sum-val.highlight {
    font-weight: 800 !important;
}

.nydtta-student-photo-box {
    flex: 0 0 115px !important;
    width: 115px !important;
    min-width: 115px !important;
    max-width: 115px !important;
    height: 135px !important;
    min-height: 135px !important;
    max-height: 135px !important;
    margin-left: 15px !important;
    box-sizing: border-box !important;
}

.photo-frame {
    width: 115px !important;
    height: 135px !important;
    min-width: 115px !important;
    max-width: 115px !important;
    min-height: 135px !important;
    max-height: 135px !important;
    border: 2px solid #004d25 !important;
    border-radius: 4px !important;
    padding: 2px !important;
    background: #ffffff !important;
    box-shadow: 0 3px 10px rgba(0, 77, 37, 0.12) !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

.nydtta-student-photo-img,
.photo-frame img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    object-fit: cover !important;
    object-position: center top !important;
    border-radius: 2px !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 5. Details Section (Compact 2-Column Grid Matching Screenshot 1) */
.nydtta-details-section {
    margin-top: 10px;
}

.nydtta-details-heading {
    color: #800020;
    font-size: 16px;
    font-weight: 800;
    margin: 0 0 8px 0;
    border-bottom: 1.5px solid #800020;
    display: inline-block;
    padding-bottom: 2px;
}

.nydtta-details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.nydtta-details-table tr {
    border-bottom: 1px solid #f1f5f9;
}

.nydtta-details-table td {
    padding: 5px 4px;
    vertical-align: middle;
    color: #111827;
}

.nydtta-details-table .dt-label {
    font-weight: 700;
    width: 135px;
    color: #1e293b;
}

.nydtta-details-table .dt-val {
    color: #0f172a;
}

/* 6. Footer Signatures (Compact) */
.nydtta-sheet-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 35px;
    padding-top: 12px;
    border-top: 1px dashed #cbd5e1;
}

.nydtta-sig-block {
    text-align: center;
    width: 190px;
}

.nydtta-sig-block .sig-line {
    border-top: 1.5px solid #334155;
    margin-bottom: 3px;
}

.nydtta-sig-block span {
    font-size: 11.5px;
    font-weight: 700;
    color: #334155;
}

.nydtta-seal-block .seal-badge {
    border: 1.5px solid #059669;
    color: #059669;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

/* 7. Error Alert */
.nydtta-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 14px 18px;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    font-size: 13.5px;
    margin-top: 15px;
}

/* 8. Pure A4 Print Method */
@media print {
    body * { visibility: hidden; }
    #nydtta-printable-sheet, #nydtta-printable-sheet * { visibility: visible; }
    .no-print { display: none !important; }
    .nydtta-main-container { padding: 0 !important; margin: 0 !important; width: 100% !important; max-width: 100% !important; }
    .nydtta-result-wrapper { padding: 0 !important; margin: 0 !important; width: 100% !important; }
    .nydtta-scaler-viewport { width: 100% !important; height: auto !important; position: static !important; }
    .nydtta-scaler-box { transform: none !important; width: 100% !important; position: static !important; }
    #nydtta-printable-sheet {
        position: absolute;
        left: 50%;
        top: 15px;
        transform: translateX(-50%);
        width: 185mm !important;
        border: 2px solid #004d25 !important;
        box-shadow: none !important;
        padding: 15mm 12mm !important;
    }
    @page { size: A4 portrait; margin: 10mm; }
}
