:root {
    --primary-gradient: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    --card-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Cairo', 'Traditional Arabic', sans-serif;
    background-color: #f0f2f5;
}

.transcript-wrapper {
    padding: 20px;
    max-width: 100%;
    overflow-x: auto;
}

.page-header {
    background: var(--primary-gradient);
    border-radius: 20px;
    padding: 25px 30px;
    margin-bottom: 25px;
    color: white;
    box-shadow: var(--card-shadow);
}

.page-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.page-header p {
    margin: 5px 0 0;
    opacity: 0.9;
}

.filter-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--card-shadow);
}

.form-label {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.required-field::after {
    content: " *";
    color: #e53e3e;
}

.form-select, .form-control {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 8px 12px;
}

.btn-gradient {
    background: var(--primary-gradient);
    border: none;
    color: white;
    padding: 10px 25px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
}

.btn-reset {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
}

.btn-toggle {
    background: linear-gradient(135deg, #00b09b, #96c93d);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    margin-left: 10px;
}

.btn-toggle.final {
    background: linear-gradient(135deg, #fc6767, #ec008c);
}

.transcript-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: var(--card-shadow);
    overflow-x: auto;
}

.university-header {
    text-align: center;
    border-bottom: 2px solid #1e3c72;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.university-name {
    font-size: 22px;
    font-weight: bold;
    font-family: 'Traditional Arabic', serif;
}

.college-name {
    font-size: 18px;
    font-weight: bold;
    margin-top: 5px;
}

.dept-name {
    font-size: 14px;
}

.filter-info {
    background: #f0f4f8;
    border: 1px solid #cbd5e0;
    border-radius: 10px;
    padding: 12px 15px;
    margin: 15px 0;
    font-size: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.filter-tag {
    background: white;
    border-radius: 20px;
    padding: 5px 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.filter-tag i {
    color: #1e3c72;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 25px;
    font-size: 10px;
    direction: rtl;
    min-width: 100%;
}

.report-table th {
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    border: 1px solid #cbd5e0;
    padding: 8px 4px;
    text-align: center;
    font-weight: 700;
    color: #2d3748;
}

.report-table td {
    border: 1px solid #cbd5e0;
    padding: 6px 4px;
    text-align: center;
    white-space: nowrap;
}

.report-table td.text-right {
    text-align: right;
    white-space: normal;
    word-break: break-word;
}

.table-header {
    background: #1e3c72;
    color: white;
    padding: 10px;
    margin: 15px 0 5px;
    border-radius: 8px;
    font-weight: bold;
}

/* Grade colors */
.grade-A, .grade-Bplus, .grade-B { 
    background-color: #d4edda; 
    color: #155724; 
    font-weight: bold; 
}
.grade-Cplus, .grade-C { 
    background-color: #fff3cd; 
    color: #856404; 
    font-weight: bold; 
}
.grade-Dplus, .grade-D, .grade-F { 
    background-color: #f8d7da; 
    color: #721c24; 
    font-weight: bold; 
}

.summary-footer {
    margin-top: 20px;
    padding: 10px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 11px;
    white-space: nowrap;
}

.status-excellent { background: #d4edda; color: #155724; }
.status-verygood { background: #cfe2ff; color: #084298; }
.status-good { background: #fff3cd; color: #856404; }
.status-pass { background: #d1e7dd; color: #0f5132; }
.status-fail { background: #f5c6cb; color: #721c24; }
.status-warning { background: #ffe5b4; color: #856404; }

/* Action buttons */
.action-buttons {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.btn-floating {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin: 5px;
    cursor: pointer;
}

/* Scroll wrapper */
.scroll-wrapper {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

/* PDF Loading Message */
.pdf-loading-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 20px 40px;
    border-radius: 12px;
    font-size: 16px;
    text-align: center;
    z-index: 10000;
    font-weight: bold;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: none;
    font-family: 'Cairo', sans-serif;
}

/* Print and PDF Optimization */
@media print {
    body {
        background: white;
        padding: 0;
        margin: 0;
        width: 100%;
    }
    
    .no-print {
        display: none !important;
    }
    
    .transcript-card {
        box-shadow: none;
        padding: 5px;
        margin: 0;
        width: 100%;
        overflow: visible !important;
    }
    
    .scroll-wrapper {
        overflow: visible !important;
        width: 100%;
    }
    
    .report-table {
        width: 100% !important;
        min-width: 100% !important;
        font-size: 7px !important;
        border-collapse: collapse;
        page-break-inside: avoid;
    }
    
    .report-table th,
    .report-table td {
        padding: 2px 2px !important;
        border: 1px solid #000;
        white-space: normal !important;
        word-break: break-word;
    }
    
    .report-table th {
        background: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .summary-footer {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        font-size: 7px;
        padding: 5px;
    }
    
    .filter-info, .filter-card, .page-header, .action-buttons {
        display: none !important;
    }
    
    .report-table tr {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    .university-header .university-name {
        font-size: 14px;
    }
    
    .university-header .college-name {
        font-size: 12px;
    }
    
    .university-header .dept-name {
        font-size: 9px;
    }
    
    .table-header {
        font-size: 10px;
        padding: 5px;
    }
    
    h4 {
        font-size: 12px;
        margin: 5px 0;
    }
    
    .report-table {
        table-layout: auto;
    }
    
    @page {
        size: landscape;
        margin: 0.3in;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 1.2rem;
    }
    
    .report-table {
        font-size: 8px;
    }
    
    .report-table th,
    .report-table td {
        padding: 3px 2px;
    }
    
    .btn-floating {
        width: 40px;
        height: 40px;
    }
}