:root {
    --primary-color: #2c3e50;
    --hover-color: #34495e;
    --text-color: #333;
    --bg-color: #f8f9fa;
    --border-color: #dee2e6;
}

/* Normalize text auto-sizing across browsers (particularly iOS Safari) */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: rtl;
    background-color: var(--bg-color);
}

/* Layout */
.container {
    display: flex;
    min-height: 100vh;
}

/* Content Header */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    position: fixed;
    height: 100vh;
    right: 0;
}

.sidebar-header {
    padding: 1rem 0;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* Ensure consistent typography for the sidebar title across browsers */
.sidebar-header h1 {
    font-family: 'Cairo', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    font-weight: 700;
    font-size: 1.75rem; /* adjust as needed to match your design */
    line-height: 1.2;
    margin: 0.25rem 0 0;
}

.sidebar-logo {
    display: block;          /* allows margin auto to work */
    width: 200px;            /* pick a size that looks good */
    max-width: 90%;          /* keeps it responsive in narrow sidebars */
    margin: 0 auto 20px;     /* center horizontally, add space below */
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
}

.sidebar-menu li {
    margin: 0.5rem 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 1rem; /* Add consistent spacing between elements */
    padding: 0.75rem 1rem;
    color: #fff;
    text-decoration: none;
    transition: background-color 0.3s;
}

.sidebar-menu a i {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0; /* Prevent icon from shrinking */
}

.sidebar-menu a:hover {
    background-color: var(--hover-color);
}

.sidebar-menu a.active {
    background-color: var(--hover-color);
    border-right: 4px solid #fff;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-right: 250px;
    padding: 2rem;
}
/* Card */
.card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.data-table th {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    text-align: center;
    white-space: nowrap;
    border: 1px solid var(--border-color);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    border: 1px solid var(--border-color);
}

td.righttext {
    text-align: right !important;
}

.data-table tr:nth-child(even) {
    background-color: #f2f2f2;
}

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

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    font-size: 14px;
}

.btn:hover {
    transform: scale(1.05);
}

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

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

/* Icons */
.icon {
    width: 1.2em;
    height: 1.2em;
}

/* Form Styles */
.form {
    max-width: 800px;
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.form-control {
    width: 100%;
    height: 40px; /* Fixed height for consistency */
    padding: 0 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
    line-height: 40px; /* Match height for text alignment */
}

.search-box {
    position: relative;
    max-width: 500px;
}

.search-input {
    width: 100%;
    padding: 0 40px 0 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    height: 40px;
    line-height: 40px;
    font-family: inherit;
    transition: border-color 0.3s;
}

/* Specific height for select elements to match input height in all browsers */
select.form-control {
    padding: 0 0.5rem; /* Slightly less padding for select elements */
    -webkit-appearance: none; /* Remove default styling */
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232c3e50' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 0.5rem center;
    background-size: 16px;
    padding-left: 2rem; /* Space for the arrow */
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Additional Button Styles */
.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-icon {
    padding: 0.5rem;
    border-radius: 50%;
}

/* Search Box */
.search-box {
    margin-bottom: 1.5rem;
}

.search-box input {
    width: 100%;
    max-width: 400px;
}

/* Table Actions */
.actions {
    display: flex;
    gap: 0.5rem;
}

.fit-column {
    width: 1px;       /* Collapse to smallest possible width */
    white-space: nowrap; /* Prevent wrapping */
    text-align: right; /* Align buttons to the right edge */
}

/* Exam Period Tabs */
.exam-period-tabs {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.tab {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 4px 4px 0 0;
    transition: all 0.3s ease;
}

.tab:hover {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

.tab.active {
    background-color: var(--primary-color);
    color: white;
}

.timeframe-tabs {
    display: flex;
    margin-bottom: 20px;
    background-color: #f8f9fa;
    border-radius: 4px;
    overflow: hidden;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}
.timeframe-tab {
    padding: 10px 20px;
    text-decoration: none;
    color: #333;
    flex: 1;
    text-align: center;
    transition: all 0.3s;
}
.timeframe-tab:hover {
    background-color: #e9ecef;
}
.timeframe-tab.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
}

/* Empty Table */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}
.empty-state-icon {
    font-size: 48px;
    color: #6c757d;
    margin-bottom: 20px;
}
.empty-state-text {
    font-size: 18px;
    color: #495057;
    margin-bottom: 20px;
}

/* Notification styles */
#notification-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.notification {
    margin-top: 10px;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.5s ease;
    min-width: 300px;
    max-width: 80%;
    text-align: center;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.notification.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-right: 0;
    }
    
    .container {
        flex-direction: column;
    }
    
    .data-table {
        display: block;
        overflow-x: auto;
    }

    .form {
        padding: 1rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .content-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}
