/* 
   Modern Premium Design System for NIAS SDM 
   Theme: Emerald Tech (Glassmorphism + Emerald Green)
*/

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&display=swap');

:root {
    --primary: #009b77;
    --primary-dark: #007d60;
    --primary-light: #dcfce7;
    --accent: #ffd700;
    --bg-page: #f0f4f3;
    --text-main: #2d3436;
    --text-muted: #636e72;
    --white: #ffffff;
    --card-shadow: 0 10px 30px rgba(0, 155, 119, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.3);
    --radius-lg: 20px;
    --radius-md: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--card-shadow);
    border-radius: var(--radius-lg);
}

/* Typography Overrides */
h1,
h2,
h3,
h4,
h5,
h6,
.brand,
.btn,
.nav>li>a {
    font-family: 'Tajawal', sans-serif !important;
    font-weight: 700;
}

/* Layout Helpers */
.pull-right {
    float: right !important;
}

.pull-left {
    float: left !important;
}

.text-right {
    text-align: right !important;
}

.text-left {
    text-align: left !important;
}

.text-center {
    text-align: center !important;
}

/* Blocks as Modern Cards */
.block {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--card-shadow);
    margin-bottom: 25px;
    overflow: hidden;
    transition: var(--transition);
}

.block:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 155, 119, 0.12);
}

.block-header {
    background: linear-gradient(to left, var(--white), #f9fdfc);
    border-bottom: 1.5px solid #eee;
    padding: 18px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.block-header .muted {
    color: var(--primary);
    font-size: 17px;
    font-weight: 800;
    margin: 0;
}

.block-content {
    padding: 25px;
}

/* Breadcrumb Styling */
.breadcrumb {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 12px 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    margin-bottom: 30px;
    border: 1px solid #f0f0f0;
    font-size: 14px;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.breadcrumb a:hover {
    color: var(--primary-dark);
}

.breadcrumb .divider {
    color: var(--text-muted);
    padding: 0 8px;
}

/* Button Improvements */
.btn {
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: 700;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.btn-info {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 155, 119, 0.3);
    opacity: 0.95;
}

.btn-success {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: var(--white);
}

.btn-danger {
    background: linear-gradient(135deg, #ff7675, #d63031);
    color: var(--white);
}

/* Table Styling */
.table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.table th {
    background: #f8fbfa !important;
    color: var(--primary-dark);
    font-weight: 800;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 15px;
    border-bottom: 2px solid #e1f5f1 !important;
}

.table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 15px;
    vertical-align: middle;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background-color: #f9fdfc;
}

/* Animations */
@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-up {
    animation: fadeInSlideUp 0.6s ease forwards;
}

/* RTL Specifics */
[dir="rtl"] {
    text-align: right;
}

/* Stats Summary Grid */
.stats-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.premium-stat-card {
    padding: 25px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.premium-stat-card:hover {
    transform: translateY(-8px);
}

.stat-icon {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 15px;
    opacity: 0.8;
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 900;
    color: var(--primary-dark);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Table Enhancements */
.modern-table {
    margin-bottom: 0;
}

.modern-table tbody tr {
    transition: var(--transition);
}

.modern-table tbody tr:hover {
    background: rgba(0, 155, 119, 0.03) !important;
}

@media print {

    .navbar-student-wrapper,
    #sidebar,
    .filter-bar,
    .results-banner .btn,
    .print-ignore,
    .stats-summary-grid {
        display: none !important;
    }

    .print-footer {
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        margin-top: 50px;
        padding: 20px;
        border-top: 2px solid #333;
    }

    .print-visible {
        display: flex !important;
    }

    .main-content-wrapper {
        padding: 0;
        margin: 0;
    }

    .glass-panel {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }

    .span9 {
        width: 100% !important;
        margin: 0 !important;
    }

    .qr-box {
        text-align: center;
    }

    .qr-box img {
        width: 110px;
        height: 110px;
    }

    .sig-box {
        min-width: 180px;
        text-align: center;
    }

    .sig-line {
        margin-top: 40px;
        border-top: 2.5px solid #333;
    }

    /* Official Document Look */
    body {
        background: white !important;
        font-size: 12pt;
    }

    .modern-table th {
        background: #f0f0f0 !important;
        border: 1.5pt solid #333 !important;
    }

    .modern-table td {
        border: 1pt solid #ccc !important;
    }

    .badge-year {
        border: 1pt solid #333 !important;
        padding: 2pt 8pt;
    }

    .term-block {
        page-break-inside: avoid;
        border: 2pt solid #333 !important;
        margin-bottom: 20pt;
    }

    .term-header {
        background: #eee !important;
        border-bottom: 2pt solid #333 !important;
    }

    /* Watermark for official look */
    .results-list::after {
        content: 'سجل أكاديمي رسمي - غير قابل للتعديل';
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) rotate(-45deg);
        font-size: 60pt;
        color: rgba(0, 0, 0, 0.03);
        white-space: nowrap;
        pointer-events: none;
        z-index: -1;
    }
}

.badge-outline {
    background: transparent;
    border: 1.5px solid var(--primary-light);
    color: var(--primary-dark);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
}

/* Responsive Grid Fixes */
@media screen and (max-width: 979px) {

    .span9,
    .span3 {
        width: 100% !important;
        margin-left: 0 !important;
        margin-bottom: 20px;
    }
}

@media screen and (max-width: 768px) {
    .block-content {
        padding: 15px;
    }

    .table-responsive {
        border: none;
    }

    .stats-summary-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media screen and (max-width: 480px) {
    .stats-summary-grid {
        grid-template-columns: 1fr;
    }
}

/* Dashboard Components (Moved from dashboard_student.php) */
.welcome-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    color: #fff;
    box-shadow: 0 10px 30px rgba(0, 155, 119, 0.2);
}

.stat-icon-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-icon-wrapper.blue {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.stat-icon-wrapper.orange {
    background: rgba(243, 156, 18, 0.1);
    color: #f39c12;
}

.stat-icon-wrapper.green {
    background: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
}

.card-header-img {
    height: 120px;
    background: linear-gradient(45deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
}

.class-card {
    transition: var(--transition);
}

.class-card:hover {
    transform: translateY(-8px);
}

.class-card:nth-child(3n+1) .card-header-img {
    background: linear-gradient(45deg, #009b77, #7bed9f);
}

.class-card:nth-child(3n+2) .card-header-img {
    background: linear-gradient(45deg, #3498db, #70a1ff);
}

.class-card:nth-child(3n+3) .card-header-img {
    background: linear-gradient(45deg, #e67e22, #ffa502);
}

/* Materials Components (Moved from student_materials.php) */
.material-card-premium {
    transition: var(--transition);
}

.material-card-premium:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 155, 119, 0.12) !important;
}

.file-preview-premium {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-preview-premium.pdf {
    background: #fff5f5;
    color: #e74c3c;
}

.file-preview-premium.word {
    background: #f0f4ff;
    color: #2980b9;
}

.file-preview-premium.powerpoint {
    background: #fffaf0;
    color: #e67e22;
}

.file-preview-premium.excel {
    background: #f0fff4;
    color: #27ae60;
}

.file-preview-premium.other {
    background: #f8fbfa;
    color: var(--primary);
}

.border-dashed {
    border-style: dashed !important;
}