/* assets/css/style.css - Main Stylesheet for Quran Tafseer Platform */

/* Local Arabic and Urdu Fonts */

/* Quranic Arabic — "Al Qalam Quran Majeed Web", the web-trimmed Al Qalam
   font shipped in the mobile app (~858KB vs the old ~24MB Publisher .ttf).
   Same Al Qalam Quranic Naskh family; the small file removes the multi-
   second download that made the Arabic text flash a fallback on load. */
@font-face {
    font-family: 'Al Qalam Quran Majeed';
    src: url('AlQalamQuranMajeedWeb.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Back-compat alias: existing rules reference 'Al Qalam Quran Publisher'
   by name. Point that name at the small Majeed Web file too so every
   reference benefits without editing each rule. */
@font-face {
    font-family: 'Al Qalam Quran Publisher';
    src: url('AlQalamQuranMajeedWeb.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Urdu Nastaliq — served as Noto Nastaliq Urdu (a real, valid webfont).
   The previous JameelNooriNastaleeq.woff/.ttf files were corrupt (HTML, not
   font data); Chrome rejected them ("OTS parsing error") and fell back to a
   serif, which mis-sized the ornate ﴿ ﴾ brackets. The family name is kept as
   'Jameel Noori Nastaleeq' so every existing rule and font variable keeps
   working without edits. */
@font-face {
    font-family: 'Jameel Noori Nastaleeq';
    src: url('NotoNastaliqUrdu.woff2') format('woff2');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Ghalib Unicode';
    src: url('GhalibUnicode.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TraditionalNaskh';
    src: url('TraditionalNaskhBold.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}


:root {
    --primary-color: #28a745;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --arabic-font: 'Al Qalam Quran Majeed', 'Al Qalam Quran Publisher', 'Lateef', 'Amiri', 'Traditional Arabic', serif;
    --urdu-font: 'Jameel Noori Nastaleeq', 'Noto Nastaliq Urdu', serif;
    --arabic-naskh-font: 'TraditionalNaskh', 'Al Qalam Quran Majeed', 'Al Qalam Quran Publisher', 'Lateef', 'Amiri', 'Traditional Arabic', serif;
    --urdu-ghalib-font: 'Ghalib Unicode', 'Jameel Noori Nastaleeq', 'Noto Nastaliq Urdu', serif;
}

/* Arabic and Urdu Font Imports */
@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Nastaliq+Urdu&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Lateef:wght@200;300;400;500;600;700;800&family=Noto+Naskh+Arabic:wght@400..700&display=swap');

/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

.arabic-font {
    font-family: var(--arabic-font);
    font-size: 1.3em;
    line-height: 2;
    direction: rtl;
    text-align: right;
}

.arabic-text {
    font-family: var(--arabic-font), 'Al Qalam Quran Publisher','Lateef', 'Amiri', 'Traditional Arabic', serif;
}

/* Ayah-number marker ﴿N﴾ — a left gap so the ornate bracket clears the
   word's trailing waqf mark. Plain margin only (no bidi isolation). */
.ayah-num {
    margin-right: 0.5em;
}


.urdu-font {
    font-family: var(--urdu-font);
    font-size: 1.2em;
    line-height: 2;
    direction: rtl;
    text-align: right;
}

.arabic-naskh-font {
    font-family: var(--arabic-naskh-font);
    font-size: 1.3em;
    line-height: 2;
    direction: rtl;
    text-align: right;
}

.urdu-ghalib-font {
    font-family: var(--urdu-ghalib-font);
    font-size: 1.2em;
    line-height: 2;
    direction: rtl;
    text-align: right;
}

/* Sidebar Styles */
.sidebar {
    min-height: 100vh;
    background: linear-gradient(180deg, #2c3e50 0%, #3498db 100%);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    z-index: 1000;
    transition: all 0.3s;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 12px 20px;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar .nav-link:hover {
    /* color: white; */
    background-color: rgba(255,255,255,0.1);
    border-left-color: var(--primary-color);
}

.sidebar .nav-link.active {
    /* color: white; */
    background-color: rgba(255,255,255,0.2);
    border-left-color: var(--primary-color);
}

.sidebar .nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Main Content Area */
.main-content {
    margin-left: 250px;
    padding: 20px;
    min-height: 100vh;
    transition: all 0.3s;
}

.sidebar.collapsed + .main-content {
    margin-left: 70px;
}

/* Dashboard Cards */
.dashboard-card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
}

.dashboard-card .card-icon {
    font-size: 3rem;
    opacity: 0.3;
    position: absolute;
    right: 15px;
    top: 15px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    /* color: white; */
}

.stat-card.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stat-card.info {
    background: linear-gradient(135deg, #2af598 0%, #009efd 100%);
}

.stat-card.warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Progress Indicators */
.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    transition: stroke-dashoffset 0.35s;
    transform-origin: 50% 50%;
}

.lesson-progress {
    position: relative;
    padding: 20px;
    /* background: white; */
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.lesson-progress .progress {
    height: 8px;
    border-radius: 4px;
}

/* Lesson Cards */
.lesson-card {
    border: none;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.lesson-card:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transform: scale(1.02);
}

.lesson-card .lesson-number {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-color);
    /* color: white; */
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.lesson-card.completed {
    border-left: 4px solid var(--success-color);
}

.lesson-card.in-progress {
    border-left: 4px solid var(--warning-color);
}

/* Buttons */
.btn-islamic {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    /* color: white; */
    border: none;
    padding: 10px 25px;
    border-radius: 25px;
    transition: all 0.3s;
}

.btn-islamic:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
    color: white;
}

/* Forms */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Tables */
.table-hover tbody tr:hover {
    background-color: rgba(40, 167, 69, 0.05);
}

.table-responsive {
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.08);
}

/* Badges */
.badge-status {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.85em;
}

.badge-active {
    background-color: #d4edda;
    color: #155724;
}

.badge-inactive {
    background-color: #f8d7da;
    color: #721c24;
}

/* Audio/Video Player */
.audio-player {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    padding: 20px;
    /* color: white; */
}

.audio-player audio {
    width: 100%;
    margin-top: 10px;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 10px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Bookmark Button */
.bookmark-btn {
    cursor: pointer;
    font-size: 1.5rem;
    color: #ddd;
    transition: color 0.3s;
}

.bookmark-btn.bookmarked {
    color: #ffc107;
}

.bookmark-btn:hover {
    color: #ffc107;
}

/* Pagination */
.pagination {
    justify-content: center;
    margin-top: 30px;
}

.page-link {
    color: var(--primary-color);
    border-radius: 5px;
    margin: 0 2px;
}

.page-link:hover {
    background-color: var(--primary-color);
    /* color: white; */
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

/* Loading Spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Mobile Responsive */
@media (max-width: 768gulpd) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar.collapsed {
        display: none;
    }
    
    .dashboard-card .card-icon {
        display: none;
    }
    
    .arabic-font {
        font-size: 1.1em;
    }
    
    .urdu-font {
        font-size: 1em;
    }
}

/* Print Styles */
@media print {
    .sidebar, .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .dashboard-card {
        box-shadow: none !important;
        page-break-inside: avoid;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Certificate Styles */
.certificate {
    /* background: white; */
    border: 10px solid #f4e4c1;
    border-radius: 15px;
    padding: 40px;
    position: relative;
    box-shadow: 0 0 30px rgba(0,0,0,0.1);
}

.certificate::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    border: 2px solid #d4af37;
    border-radius: 10px;
}

.certificate-header {
    text-align: center;
    margin-bottom: 30px;
}

.certificate-title {
    font-family: var(--arabic-font);
    font-size: 2.5rem;
    color: #d4af37;
    margin-bottom: 10px;
}

.certificate-subtitle {
    font-size: 1.5rem;
    color: #333;
    font-weight: 300;
}

/* Tooltip Styles */
.tooltip-inner {
    background-color: var(--primary-color);
    border-radius: 5px;
}

.tooltip-arrow::before {
    border-top-color: var(--primary-color);
}

/* Modal Styles */
.modal-content {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    /* color: white; */
    border-radius: 15px 15px 0 0;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.shadow-sm-hover:hover {
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075) !important;
}

.border-gradient {
    border: 2px solid;
    border-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-image-slice: 1;
}

.sidebar {
    background: linear-gradient(135deg, var(--dark-color), var(--primary-color));
    height: 100vh;          /* fixed height instead of min-height */
    overflow-y: auto;       /* enable vertical scroll */
    /* color: white; */
    position: fixed;
    width: 250px;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: all 0.3s;
}

.iframe-container {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    background: #f8f9fa;
    padding: 10px;
    position: relative;
    width: 100%;
}

.iframe-container::before {
    content: "";
    display: block;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.iframe-container iframe {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

@media (max-width: 768px) {
    .iframe-container {
        padding: 5px;
    }
    
    .iframe-container iframe {
        top: 5px;
        left: 5px;
        right: 5px;
        bottom: 5px;
        width: calc(100% - 10px);
        height: calc(100% - 10px);
    }
}