/* Summary Button */
.summary-button {
    position: fixed;
    top: 60px;
    left: 10px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #3b82f6;
    color: white;
    border: 2px solid white;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s;
}

.summary-button:hover {
    transform: scale(1.1);
}

/* Modal Overlay */
.summary-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Modal Container - Mobile First */
.summary-modal {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    background-color: white;
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
}

/* Header - Mobile */
.summary-modal-header {
    padding: 60px 15px 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-bottom: 2px solid #e2e8f0;
    background-color: #f8fafc;
    flex-shrink: 0;
}

.summary-modal-profile,
.summary-modal-title,
.summary-modal-logo {
    width: 100%;
    text-align: center;
}

.summary-modal-profile-img {
    display: none;
}

.summary-modal-profile-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.summary-modal-title h1 {
    font-size: 18px;
    font-weight: bold;
    color: #0f172a;
    margin: 0;
}

.summary-modal-title h2 {
    display: none;
}

.summary-school-name {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.summary-modal-logo img {
    display: none;
}

/* Close Button */
.summary-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    color: #475569;
    background: #e2e8f0;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
}

.summary-print-button {
    display: none;
}

/* Content Area */
.summary-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

/* Sections */
.summary-section {
    margin-bottom: 20px;
}

.summary-section-title {
    font-size: 16px;
    font-weight: bold;
    color: #334155;
    margin-bottom: 8px;
}

.summary-section-divider {
    height: 1px;
    background-color: #e2e8f0;
    margin-bottom: 12px;
}

/* Intro Content */
.summary-intro-content {
    background-color: #f8fafc;
    padding: 12px;
    border-radius: 6px;
    color: #64748b;
    font-size: 14px;
}

/* XP Aptitude Cards - Mobile Stack */
.xp-aptitude-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    margin-bottom: 20px !important;
    width: 100% !important;
}

.xp-aptitude-card {
    background-color: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.xp-aptitude-title {
    font-size: 15px !important;
    font-weight: 500 !important;
    color: #0f172a !important;
    margin: 0 0 5px 0 !important;
    display: flex !important;
    align-items: center !important;
}

.xp-aptitude-title:before {
    content: "" !important;
    display: block !important;
    width: 8px !important;
    height: 8px !important;
    border-radius: 2px !important;
    margin-right: 8px !important;
}

.xp-aptitude-card.superior .xp-aptitude-title:before {
    background-color: #3b82f6 !important;
}

.xp-aptitude-card.above-avg .xp-aptitude-title:before {
    background-color: #10b981 !important;
}

.xp-aptitude-card.avg .xp-aptitude-title:before {
    background-color: #f59e0b !important;
}

.xp-aptitude-card.low-avg .xp-aptitude-title:before {
    background-color: #f97316 !important;
}

.xp-aptitude-card.below-avg .xp-aptitude-title:before {
    background-color: #dc2626 !important;
}

.xp-aptitude-result {
    font-size: 13px !important;
    color: #64748b !important;
    margin: 0 0 0 16px !important;
    line-height: 1.4 !important;
}

/* Ability Items */
.summary-ability-item {
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-ability-name {
    font-size: 15px;
    font-weight: bold;
    color: #334155;
}

.summary-ability-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-ability-score {
    font-size: 14px;
    font-weight: bold;
}

.summary-ability-time {
    font-size: 12px;
    color: #64748b;
}

/* Score Colors */
.low-avg, .xp-aptitude-card.low-avg .xp-aptitude-result { color: #f97316; font-weight: 600; }
.below-avg, .xp-aptitude-card.below-avg .xp-aptitude-result { color: #dc2626; font-weight: 600; }
.avg, .xp-aptitude-card.avg .xp-aptitude-result { color: #f59e0b; font-weight: 600; }
.above-avg, .xp-aptitude-card.above-avg .xp-aptitude-result { color: #0ea5e9; font-weight: 600; }
.superior, .xp-aptitude-card.superior .xp-aptitude-result { color: #059669; font-weight: 600; }

/* Traits */
.summary-traits-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.summary-trait {
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
}

.trait-analytical { background-color: #dbeafe; color: #2563eb; }
.trait-creative { background-color: #f3e8ff; color: #9333ea; }
.trait-practical { background-color: #d1fae5; color: #059669; }

/* Job Selection Cards - Mobile Stack */
.job-selection-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    margin-bottom: 20px !important;
    width: 100% !important;
}

.job-selection-card {
    background-color: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.job-selection-title {
    font-size: 15px !important;
    font-weight: 500 !important;
    color: #0f172a !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
}

.job-selection-title:before {
    content: "" !important;
    display: block !important;
    width: 8px !important;
    height: 8px !important;
    border-radius: 2px !important;
    margin-right: 8px !important;
}

.job-selection-card:nth-child(1) .job-selection-title:before { background-color: #3b82f6 !important; }
.job-selection-card:nth-child(2) .job-selection-title:before { background-color: #10b981 !important; }
.job-selection-card:nth-child(3) .job-selection-title:before { background-color: #f59e0b !important; }
.job-selection-card:nth-child(4) .job-selection-title:before { background-color: #8b5cf6 !important; }
.job-selection-card:nth-child(5) .job-selection-title:before { background-color: #ec4899 !important; }
.job-selection-card:nth-child(6) .job-selection-title:before { background-color: #3b82f6 !important; }
.job-selection-card:nth-child(7) .job-selection-title:before { background-color: #10b981 !important; }
.job-selection-card:nth-child(8) .job-selection-title:before { background-color: #f59e0b !important; }

/* Job Items */
.summary-job-item {
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

.summary-job-title {
    font-size: 15px;
    font-weight: bold;
    color: #334155;
    margin-bottom: 12px;
}

.summary-job-subjects {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.summary-subject-group {
    width: 100%;
}

.summary-subject-heading {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 6px;
}

.compulsory-heading { color: #2563eb; }
.recommended-heading { color: #059669; }

.summary-subject-list {
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
}

/* Subject Selections - Mobile Stack */
.subject-selections-container {
    display: block !important;
    width: 100% !important;
}

.subject-selections-group {
    display: block !important;
    width: 100% !important;
    margin-bottom: 20px !important;
}

.subject-selections-group:last-child {
    margin-bottom: 0 !important;
}

.subject-selections-header {
    display: block !important;
    margin-bottom: 20px !important;
}

.subject-selections-header-col {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    margin-bottom: 15px !important;
}

.subject-selections-header-title {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    margin: 0 0 5px 0 !important;
}

.subject-selections-header-date {
    font-size: 12px !important;
    color: #64748b !important;
    font-style: italic !important;
    margin: 0 !important;
}

.subject-selections-card {
    background-color: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    padding: 12px 16px !important;
    width: 100% !important;
    margin-bottom: 10px !important;
    display: block !important;
    box-sizing: border-box !important;
}

.subject-selections-card:last-child {
    margin-bottom: 0 !important;
}

.subject-selections-title {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #0f172a !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
}

.subject-selections-title:before {
    content: "" !important;
    display: block !important;
    width: 8px !important;
    height: 8px !important;
    border-radius: 2px !important;
    margin-right: 8px !important;
    flex-shrink: 0 !important;
}

.learner-group .subject-selections-title:before { background-color: #3b82f6 !important; }
.school-group .subject-selections-title:before { background-color: #10b981 !important; }

/* Not found message */
.not-found-message {
    color: #94a3b8;
    font-style: italic;
    padding: 12px;
    background-color: #f8fafc;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}

/* Footer */
.summary-modal-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    text-align: center;
    border-top: 1px solid #e2e8f0;
    padding: 15px;
    background-color: white;
    flex-shrink: 0;
}

.summary-footer-copyright {
    font-size: 11px;
    color: #94a3b8;
}

.summary-footer-powered {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
}

.summary-footer-powered img {
    height: 18px;
}

/* Tablet (768px+) */
@media screen and (min-width: 768px) {
    .summary-button {
        top: 70px;
        left: 20px;
    }
    
    .summary-modal-overlay {
        padding: 20px;
    }
    
    .summary-modal {
        width: 90%;
        max-width: 900px;
        height: 90vh;
        border-radius: 12px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    }
    
    .summary-modal-header {
        padding: 25px 60px 25px 25px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .summary-modal-profile {
        width: 25%;
        text-align: left;
    }
    
    .summary-modal-title {
        width: 50%;
    }
    
    .summary-modal-logo {
        width: 25%;
        text-align: right;
    }
    
    .summary-modal-title h1 {
        font-size: 22px;
    }
    
    .summary-modal-profile-name,
    .summary-school-name {
        font-size: 16px;
    }
    
    .summary-modal-content {
        padding: 0 30px 30px;
    }
    
    .summary-section-title {
        font-size: 18px;
    }
    
    .summary-print-button {
        display: flex;
        position: absolute;
        top: 22px;
        right: 55px;
        background-color: #475569;
        color: white;
        border: none;
        border-radius: 20px;
        padding: 8px 16px;
        font-size: 13px;
        font-weight: bold;
        cursor: pointer;
        align-items: center;
        gap: 6px;
    }
    
    /* XP Aptitude - Grid on tablet */
    .xp-aptitude-container {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
    }
    
    .xp-aptitude-card {
        width: 33.333% !important;
    }
    
    /* Job Selection - 2 per row on tablet */
    .job-selection-container {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 12px !important;
    }
    
    .job-selection-card {
        width: calc(50% - 6px) !important;
        min-width: 180px !important;
        margin-bottom: 0 !important;
    }
    
    /* Ability items - horizontal layout */
    .summary-ability-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .summary-ability-result {
        flex-direction: column;
        align-items: flex-end;
    }
    
    /* Subject selections - SIDE BY SIDE ON DESKTOP */
    .subject-selections-container {
        display: flex !important;
        flex-direction: row !important;
        gap: 20px !important;
    }
    
    .subject-selections-group {
        display: block !important;
        flex: 1 !important;
        width: calc(50% - 10px) !important;
        margin-bottom: 0 !important;
    }
    
    .subject-selections-header {
        display: flex !important;
        flex-direction: row !important;
        margin-bottom: 20px !important;
    }
    
    .subject-selections-header-col {
        flex: 1 !important;
        text-align: left !important;
        margin-bottom: 0 !important;
    }
    
    /* Job subjects - side by side */
    .summary-job-subjects {
        flex-direction: row;
        gap: 20px;
    }
    
    .summary-subject-group {
        flex: 1;
    }
    
    /* Footer - horizontal */
    .summary-modal-footer {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

/* Print styles */
@media print {
    .summary-button,
    .summary-modal-close,
    .summary-print-button {
        display: none !important;
    }
    
    .summary-modal-overlay {
        position: static;
        background: white;
    }
    
    .summary-modal {
        box-shadow: none;
        height: auto;
    }
}
/* Subject Selection Date Padding Fix */
.subject-selections-header-date {
    font-size: 12px !important;
    color: #64748b !important;
    font-style: italic !important;
    margin: 0 0 15px 0 !important; /* Added bottom margin */
}

/* Subject Comments Section */
.subject-comments-section {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.subject-comments-title {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 15px 0;
}

.subject-comment-item {
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background-color: white;
}

.subject-comment-item:last-child {
    margin-bottom: 0;
}

.subject-comment-item p {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #334155;
}

.subject-comment-item p:last-child {
    margin-bottom: 0;
}

.subject-comment-text {
    color: #64748b !important;
    font-style: italic;
    padding-left: 15px;
}

/* Comment status colors */
.comment-status-alternative {
    background-color: #e6f3ff !important;
    border-color: #b3d9ff !important;
}

.comment-status-new {
    background-color: #e6ffe6 !important;
    border-color: #b3ffb3 !important;
}

.comment-status-default {
    background-color: #fef3c7 !important;
    border-color: #fde68a !important;
}

/* Subject comments - better spacing on tablet/desktop */
.subject-comments-section {
    margin-top: 30px;
    padding: 20px;
}

.subject-comments-title {
    font-size: 18px;
    margin-bottom: 20px;
}