:root {
    /* Dark Theme (Default) */
    --bg-dark: #dee3ef;
    --bg-card: #accbfd;
    --text-primary: #38424d;
    --text-secondary: #313842;
    --accent-color: #372367;
    /* Violet */
    --accent-glow: rgba(139, 92, 246, 0.5);
    --border-color: #334155;
    --card-hover-y: -5px;
    --transition-fast: 0.2s ease;
    --font-family: 'Calibri', 'Tahoma', 'Inter', sans-serif;
    --header-bg: linear-gradient(to bottom, #3a70f0, #6c95ee);
    direction:rtl;
}

/* Light Theme Variables */
body.light-mode {
    --bg-dark: #f0f4f8;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent-color: #7e7fd9;
    /* Indigo */
    --accent-glow: rgba(99, 102, 241, 0.3);
    --border-color: #e2e8f0;
    --header-bg: linear-gradient(to bottom, #ffffff, #f0f4f8);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme Toggle Button */
.theme-toggle {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
}

body.light-mode .theme-toggle {
    background: rgba(0, 0, 0, 0.05);
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* Header / Hero */
.hero {
    position: relative;
    padding: 4rem 1rem;
    text-align: center;
    overflow: hidden;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #4c33a7 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.hero .subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

.stats-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Background "glow" effect */
.hero-bg {
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
    z-index: 1;
    pointer-events: none;
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Controls Section (Search & Filter) */
.controls-section {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    background: rgba(30, 41, 59, 0.7);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 1rem;
    z-index: 10;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.search-wrapper {
    flex: 1 1 300px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.search-wrapper input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.75rem;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.search-wrapper input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.filters-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.select-wrapper {
    position: relative;
    min-width: 160px;
}

.select-wrapper select {
    appearance: none;
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px;
    transition: var(--transition-fast);
}

.select-wrapper select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

/* Grid Layout */
.alumni-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    min-height: 300px;
}

/* Card Styles */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(var(--card-hover-y));
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 0 20px var(--accent-glow);
    border-color: rgba(139, 92, 246, 0.3);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), #c084fc);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover::before {
    opacity: 1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.card-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: #110d27;
    margin-bottom: 0.25rem;
}

.card-degree {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-weight: 600;
    background-color: rgba(147, 115, 222, 0.1);
    color: #242033;
    border: 1px solid rgba(139, 92, 246, 0.2);
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.card-body {
    flex-grow: 1;
}

.info-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.info-icon {
    width: 16px;
    height: 16px;
    margin-right: 0.5rem;
    flex-shrink: 0;
    opacity: 0.7;
}

.card-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.email-link {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.email-link:hover {
    color: #c084fc;
}

.grad-year {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Loading & Empty States */
.loading-state,
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(139, 92, 246, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.page-btn {
    padding: 0.5rem 1rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    background-color: var(--border-color);
    color: #fff;
}

.page-btn.active {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
}

/* Mobile Tweaks */
@media (max-width: 640px) {
    .hero h1 {
        font-size: 2rem;
    }

    .controls-section {
        position: static;
        top: auto;
    }

    .search-wrapper,
    .select-wrapper {
        width: 100%;
    }
}