@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;800&display=swap');

:root {
    --bg-primary: #0b0f19;
    --bg-secondary: #121826;
    --glass-bg: rgba(18, 24, 38, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --accent-primary: #3b82f6;
    --accent-hover: #2563eb;
    --accent-purple: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --accent-gradient-hover: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --sidebar-width: 280px;
    --border-radius-lg: 16px;
    --border-radius-md: 10px;
    --border-radius-sm: 6px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    direction: rtl;
    text-align: right;
    background-image: 
        radial-gradient(at 10% 10%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 90% 90%, rgba(139, 92, 246, 0.12) 0px, transparent 50%);
    background-attachment: fixed;
}

/* Glassmorphism utility card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    padding: 2.5rem;
    transition: var(--transition);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
}

/* Login Page Layout */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 480px;
    animation: fadeIn 0.6s ease-out;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

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

.input-control {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(18, 24, 38, 0.8);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
    text-align: right;
}

.input-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.8rem;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: var(--border-radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-gradient-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-full {
    width: 100%;
}

/* Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-left: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    position: fixed;
    height: 100vh;
    right: 0;
    top: 0;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 3rem;
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-md);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
}

.nav-item a {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius-md);
    transition: var(--transition);
    gap: 12px;
    font-weight: 600;
}

.nav-item.active a, .nav-item a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active a {
    border-right: 4px solid var(--accent-primary);
    background: rgba(59, 130, 246, 0.08);
}

.user-info-widget {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 1rem;
    margin-top: auto;
}

.user-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    margin-right: var(--sidebar-width);
    padding: 2.5rem;
    min-height: 100vh;
}

/* Header Banner */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.page-title h2 {
    font-size: 1.8rem;
    font-weight: 800;
}

.page-title p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 4px;
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--border-radius-md);
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info {
    text-align: left;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-align: right;
}

/* Selection Section Styles */
.selection-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
}

@media (max-width: 1024px) {
    .selection-grid {
        grid-template-columns: 1fr;
    }
}

.course-selector-box {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.selector-field {
    background: rgba(18, 24, 38, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
}

.wishes-summary-box {
    position: sticky;
    top: 2.5rem;
}

.wishes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 1.5rem 0;
}

.wish-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease-out;
}

.wish-priority-badge {
    background: var(--accent-gradient);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.wish-details {
    flex-grow: 1;
    margin-right: 15px;
}

.wish-course-title {
    font-weight: 700;
    font-size: 0.95rem;
}

.wish-course-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.remove-wish-btn {
    background: transparent;
    border: none;
    color: var(--error);
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-wish-btn:hover {
    transform: scale(1.15);
}

/* Admin Upload Panel */
.admin-upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

@media (max-width: 768px) {
    .admin-upload-grid {
        grid-template-columns: 1fr;
    }
}

.file-upload-card {
    text-align: center;
}

.file-dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius-md);
    padding: 2rem;
    margin: 1.5rem 0;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.01);
}

.file-dropzone:hover {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.04);
}

.file-dropzone input[type="file"] {
    display: none;
}

.dropzone-text {
    color: var(--text-secondary);
    margin-top: 10px;
    font-size: 0.9rem;
}

.dropzone-selected-name {
    color: var(--success);
    font-weight: 700;
    margin-top: 10px;
}

/* Semester indicator / switch badge */
.status-indicator {
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

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

/* Alert Notification messages */
.alert-messages {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.alert-item {
    background: rgba(18, 24, 38, 0.95);
    border-right: 5px solid var(--accent-primary);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-md);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    backdrop-filter: blur(10px);
    animation: slideInLeft 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.alert-item.success {
    border-right-color: var(--success);
}

.alert-item.error {
    border-right-color: var(--error);
}

.alert-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: bold;
}

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

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
}

.custom-table th {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 2px solid var(--glass-border);
}

.custom-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-secondary);
}

.custom-table tr:hover td {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.table-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
}

.table-badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.table-badge-pending {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

/* Empty selection message */
.empty-placeholder {
    padding: 3rem;
    text-align: center;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.empty-placeholder i {
    font-size: 2.5rem;
    color: var(--glass-border);
}

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

@keyframes slideIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

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