@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Nrt:wght@400;700&display=swap');
/* Example Kurdish font if needed, usually NRT or UniKurd */

:root {
    --primary-color: #4f46e5;
    /* Indigo */
    --primary-dark: #4338ca;
    --secondary-color: #f3f4f6;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --bg-body: #f9fafb;
    --border-color: #e5e7eb;
    --danger: #ef4444;
    --success: #10b981;
    --radius: 12px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

[dir="rtl"] {
    font-family: 'Tahoma', 'Arial', sans-serif;
    /* Simplified for compatibility */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-link {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.nav-link:hover {
    color: var(--primary-color);
    background-color: var(--secondary-color);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
    padding: 0.5rem;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
    }

    .mobile-menu-btn {
        display: block;
    }

    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border-color);
        margin-top: 1rem;
        animation: slideDown 0.3s ease-out;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-link {
        display: block;
        width: 100%;
        text-align: center;
        padding: 0.75rem;
    }

    .nav-links .btn {
        width: 100%;
        text-align: center;
        margin-top: 0.5rem;
    }

    .logo {
        font-size: 1.25rem;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

.main-content {
    padding: 2rem 0;
    flex: 1;
}

.section {
    padding: 4rem 0;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Grid System */
.grid {
    display: grid;
    gap: 2rem;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, 1fr);
}

.grid-cols-3-md {
    grid-template-columns: 1fr;
}

.grid-cols-2-md {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .grid-cols-3-md {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-cols-2-md {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet Optimization */
@media (min-width: 768px) and (max-width: 1024px) {
    .grid-cols-3-md {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: #e5e7eb;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Utilities */
.text-center {
    text-align: center;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.text-muted {
    color: var(--text-muted);
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.alert-error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}


/* Language Switcher Icons */
.lang-switch {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    background: rgba(243, 244, 246, 0.5);
    padding: 0.25rem 0.5rem;
    border-radius: 99px;
    border: 1px solid var(--border-color);
}

.lang-icon {
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.5rem;
    border-radius: 99px;
    color: var(--text-muted);
    font-weight: 500;
}

.lang-icon:hover {
    background-color: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.lang-icon.active {
    background-color: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

.flag-icon {
    width: 1.4rem;
    height: 1rem;
    display: inline-block;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
}

/* UK/English Flag */
.flag-en {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3CclipPath id='s'%3E%3Cpath d='M0,0 v30 h60 v-30 z'/%3E%3C/clipPath%3E%3Cpath d='M0,0 v30 h60 v-30 z' fill='%23012169'/%3E%3Cpath d='M0,0 L60,30 M60,0 L0,30' stroke='%23fff' stroke-width='6'/%3E%3Cpath d='M0,0 L60,30 M60,0 L0,30' stroke='%23C8102E' stroke-width='4'/%3E%3Cpath d='M30,0 v30 M0,15 h60' stroke='%23fff' stroke-width='10'/%3E%3Cpath d='M30,0 v30 M0,15 h60' stroke='%23C8102E' stroke-width='6'/%3E%3C/svg%3E");
}

/* Kurdistan Flag */
.flag-ku {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 900 600'%3E%3Crect width='900' height='600' fill='%23278e43'/%3E%3Crect width='900' height='400' y='0' fill='%23ffffff'/%3E%3Crect width='900' height='200' y='0' fill='%23ce1126'/%3E%3Ccircle cx='450' cy='300' r='100' fill='%23ffc000'/%3E%3Cg fill='%23ffc000'%3E%3Cpolygon points='450,165 470,260 450,300 430,260' /%3E%3Cpolygon points='450,435 470,340 450,300 430,340' /%3E%3Cpolygon points='585,300 490,320 450,300 490,280' /%3E%3Cpolygon points='315,300 410,320 450,300 410,280' /%3E%3C/g%3E%3C/svg%3E");
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #4338ca 100%);
    color: white;
    padding: 8rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: white;
    line-height: 1.2;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

/* Search Box */
.search-box {
    background: white;
    padding: 0.5rem;
    border-radius: 99px;
    display: inline-flex;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 100%;
    position: relative;
}

.search-box input {
    border: none;
    outline: none;
    padding: 0.75rem 1.5rem;
    flex: 1;
    border-radius: 99px;
    font-size: 1rem;
    min-width: 0;
    /* Prevent overflow */
}

.search-box button {
    border-radius: 99px;
    padding: 0.75rem 2rem;
    flex-shrink: 0;
}

/* Category Pills */
.category-pill {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 99px;
    color: var(--text-main);
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
}

.category-pill:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Course Cards */
.card-course {
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    /* Override default card padding */
    height: 100%;
}

.card-img-top {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
}

.card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.card-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.card-text {
    flex: 1;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .section {
        padding: 2.5rem 0;
    }

    .hero {
        padding: 4rem 0;
    }

    .hero h1 {
        font-size: 2.25rem;
    }

    .hero p {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .search-box {
        flex-direction: column;
        padding: 0.75rem;
        border-radius: 1rem;
        gap: 0.5rem;
    }

    .search-box input {
        width: 100%;
        padding: 0.75rem;
        border: 1px solid var(--border-color);
        border-radius: 0.5rem;
    }

    .search-box button {
        width: 100%;
        border-radius: 0.5rem;
    }
}

/* Premium Table Styles */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    background: white;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.custom-table th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

[dir="rtl"] .custom-table th {
    text-align: right;
}

.custom-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.95rem;
    vertical-align: middle;
}

.custom-table tbody tr:last-child td {
    border-bottom: none;
}

.custom-table tbody tr:hover {
    background-color: #f9fafb;
    transition: background-color 0.2s ease;
}

.badge {
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    letter-spacing: 0.025em;
}

.badge-admin {
    background-color: #e0e7ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
}

.badge-student {
    background-color: #d1fae5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.user-info-cell {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: var(--shadow-sm);
}