@import url('theme.css');

/* ============================================================
 * Main Stylesheet - Academy Management System
 * Zid-Inspired Design Language, Responsive Layout & RTL
 * ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    direction: rtl;
    text-align: right;
    background-color: var(--bg-base);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent);
}

/* Layout Container */
.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Glass Card Component */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
}

/* Navbar Component */
.app-navbar {
    background: var(--bg-card);
    backdrop-filter: var(--glass-backdrop);
    border-bottom: 1px solid var(--border-color);
    padding: 0.85rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
}

.nav-brand-img {
    height: 42px;
    width: auto;
    object-fit: contain;
    border-radius: 6px;
}

.nav-brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #ffffff;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

/* Hero Section */
.hero-section {
    padding: 4rem 0 3rem 0;
    text-align: center;
    position: relative;
}

.hero-title {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.hero-title span {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 750px;
    margin: 0 auto 2rem auto;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.hero-features-bar {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.tab-btn {
    padding: 0.6rem 1.4rem;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.tab-btn:hover, .tab-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 14px var(--primary-glow);
}

/* Course Cards Grid */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.8rem;
    margin-bottom: 3rem;
}

.course-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.course-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary);
    box-shadow: var(--shadow-card);
}

.course-img-wrapper {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: var(--bg-surface);
}

.course-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.course-card:hover .course-img {
    transform: scale(1.06);
}

.course-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 0.35rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    color: var(--accent);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.course-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.course-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.course-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    line-height: 1.5;
    flex: 1;
}

.course-details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    padding: 0.85rem 0;
    border-top: 1px dashed var(--border-color);
    border-bottom: 1px dashed var(--border-color);
    margin-bottom: 1.25rem;
    font-size: 0.82rem;
    text-align: center;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.detail-label {
    color: var(--text-dim);
}

.detail-val {
    font-weight: 700;
    color: var(--text-main);
}

/* Floating WhatsApp Button */
.floating-whatsapp {
    position: fixed;
    bottom: 25px;
    left: 25px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25d366;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4);
    z-index: 999;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
}

.floating-whatsapp:hover {
    transform: scale(1.1);
    color: #ffffff;
    box-shadow: 0 15px 30px rgba(37, 211, 102, 0.6);
}

.floating-whatsapp::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.5);
    animation: pulse-ring 2s infinite;
    z-index: -1;
}

@keyframes pulse-ring {
    0% { transform: scale(0.95); opacity: 0.8; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-backdrop.show {
    display: flex;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    box-shadow: var(--shadow-card);
}

.modal-close-btn {
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close-btn:hover {
    color: var(--text-main);
}

/* ============================================================
 * ZID-INSPIRED ADMIN DASHBOARD LAYOUT
 * ============================================================ */

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Right Sidebar (Fixed, Zid-style) */
.admin-sidebar {
    width: 270px;
    background: var(--bg-surface);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    transition: transform 0.3s ease, width 0.3s ease;
}

.admin-sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border-bottom: 1px solid var(--border-color);
}

.admin-sidebar-nav {
    padding: 1.25rem 0.85rem;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.92rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.admin-nav-item:hover, .admin-nav-item.active {
    background: var(--primary-glow);
    color: var(--primary);
}

.admin-nav-item.active {
    border-right: 4px solid var(--primary);
    font-weight: 700;
}

.admin-nav-icon {
    font-size: 1.25rem;
}

/* Admin Main Content Wrapper */
.admin-main-wrapper {
    flex: 1;
    margin-right: 270px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-right 0.3s ease;
}

.admin-topbar {
    background: var(--bg-card);
    backdrop-filter: var(--glass-backdrop);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 90;
}

.admin-content {
    padding: 2rem;
    flex: 1;
}

/* Table Export Toolbar */
.export-toolbar {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.btn-export-excel {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-size: 0.85rem;
    padding: 0.45rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-export-excel:hover {
    background: #10b981;
    color: #ffffff;
}

.btn-export-pdf {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    font-size: 0.85rem;
    padding: 0.45rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-export-pdf:hover {
    background: #ef4444;
    color: #ffffff;
}

/* Table Styling */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-top: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th, .data-table td {
    padding: 0.9rem 1.1rem;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-surface);
    color: var(--text-muted);
    font-weight: 700;
}

.data-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Forms & Controls */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.45rem;
}

.form-control {
    width: 100%;
    padding: 0.8rem 1.1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.92rem;
    transition: all 0.25s ease;
    direction: ltr;
    text-align: left;
}

.form-control.rtl-input {
    direction: rtl;
    text-align: right;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 0.35rem;
}

/* Color Picker Row */
.color-picker-group {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.color-input-preview {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    cursor: pointer;
    padding: 0;
    background: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.6rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-accent {
    background: var(--accent);
    color: #0f172a;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.btn-accent:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-block {
    width: 100%;
}

/* Grid System */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.25rem;
    margin: 1.8rem 0;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    display: flex;
    align-items: center;
    gap: 1.1rem;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: var(--primary-glow);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.stat-val {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text-main);
}

.stat-title {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Alerts & Badges */
.alert {
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--text-main);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--text-main);
}

.alert-info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--text-main);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--text-main);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
}

.badge-success { background: rgba(16, 185, 129, 0.2); color: var(--primary); }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.badge-info { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }

/* Responsive Media Queries */
@media (max-width: 992px) {
    .admin-sidebar { transform: translateX(100%); }
    .admin-sidebar.show { transform: translateX(0); }
    .admin-main-wrapper { margin-right: 0; }
}

@media (max-width: 768px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .glass-card { padding: 1.25rem; }
    .admin-content { padding: 1rem; }
}
