/* ============================================
   نظام إدارة أعضاء هيئة التدريس - NCN
   ملف CSS الرئيسي - تصميم متجاوب
   ============================================ */

/* إعدادات عامة */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #7c3aed;
    --primary-dark: #5b21b6;
    --primary-light: #a78bfa;
    --secondary-color: #ec4899;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --bg-color: #f9fafb;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --card-bg: #ffffff;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 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);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    direction: rtl;
}

/* Header */
.main-header {
    background: var(--card-bg);
    box-shadow: var(--shadow);
    padding: 1rem 0 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    height: 50px;
    width: auto;
}

.site-title {
    font-size: 1.25rem;
    color: var(--primary-color);
    font-weight: 600;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s;
    font-weight: 500;
    position: relative;
}

.nav-link:hover {
    background-color: var(--primary-color);
    color: white;
}

.nav-link.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1.5rem;
    right: 50%;
    transform: translateX(50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 3px 3px 0 0;
    box-shadow: 0 -2px 8px rgba(124, 58, 237, 0.4);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 50px;
        opacity: 1;
    }
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--bg-color);
    border-radius: 0.5rem;
}

.username {
    font-weight: 600;
    color: var(--primary-color);
}

.user-role {
    color: var(--text-light);
    font-size: 0.875rem;
}

.logout-btn {
    background-color: var(--danger-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.3s;
}

.logout-btn:hover {
    background-color: #dc2626;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.05) 0%, rgba(236, 72, 153, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: var(--primary-light);
}

.card:hover::before {
    opacity: 1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(124, 58, 237, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-secondary {
    background-color: var(--text-light);
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* Tables */
.table-container {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scroll-behavior: smooth;
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
}

/* Scrollbar styling for better UX */
.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
    transition: background 0.3s;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Firefox scrollbar */
.table-container {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-color);
}

table {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 0.5rem;
    overflow: hidden;
    table-layout: auto;
}

table thead {
    background-color: var(--primary-color);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

table th,
table td {
    padding: 0.75rem 1rem;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap; /* Keep content in single line */
    vertical-align: middle;
}

table th {
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table td {
    font-size: 0.9rem;
    color: var(--text-color);
}

/* Handle long text with ellipsis */
table td:not(:last-child) {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
}

/* Tooltip for truncated text - only show if text is actually truncated */
table td:not(:last-child):hover {
    overflow: visible;
    z-index: 100;
}

table td:not(:last-child):hover::after {
    content: attr(data-full-text);
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--text-color);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    white-space: normal;
    min-width: 200px;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    word-wrap: break-word;
    pointer-events: none;
    animation: fadeInTooltip 0.2s ease-out;
}

@keyframes fadeInTooltip {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hide tooltip on mobile */
@media (max-width: 768px) {
    table td:not(:last-child):hover::after {
        display: none;
    }
}

/* Last column (actions) should not truncate */
table td:last-child {
    max-width: none;
    overflow: visible;
    white-space: nowrap;
}

table tbody tr {
    transition: all 0.2s ease;
}

table tbody tr:hover {
    background-color: var(--bg-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* Better spacing for table cells on mobile */
@media (max-width: 768px) {
    table th,
    table td {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    table th {
        font-size: 0.75rem;
    }
    
    /* Allow some columns to wrap on very small screens */
    table td:not(:last-child) {
        max-width: 150px;
    }
}

/* Very small screens - stack or hide less important columns */
@media (max-width: 480px) {
    table {
        font-size: 0.75rem;
    }
    
    table th,
    table td {
        padding: 0.4rem 0.5rem;
        font-size: 0.75rem;
    }
    
    /* Hide less critical columns on very small screens */
    table th:nth-child(n+6):not(:last-child),
    table td:nth-child(n+6):not(:last-child) {
        display: none;
    }
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    position: relative;
    overflow: hidden;
    padding: 1rem;
}

.login-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.bg-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 20s infinite ease-in-out;
}

.bg-shape-1 {
    width: 200px;
    height: 200px;
    top: -50px;
    right: -50px;
    animation-delay: 0s;
}

.bg-shape-2 {
    width: 150px;
    height: 150px;
    bottom: -30px;
    left: -30px;
    animation-delay: 5s;
}

.bg-shape-3 {
    width: 100px;
    height: 100px;
    top: 50%;
    left: 10%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(30px, -30px) rotate(120deg);
    }
    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 0.5rem;
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease-out;
}

@media (max-width: 480px) {
    .login-container {
        max-width: 100%;
        padding: 0.25rem;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 1.25rem;
    padding: 1.75rem 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

.login-box:hover {
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .login-box {
        padding: 1.5rem 1.25rem;
        border-radius: 1rem;
    }
}

@media (max-width: 480px) {
    .login-box {
        padding: 1.25rem 1rem;
    }
}

.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.logo-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    margin-bottom: 0.75rem;
    animation: pulse 2s infinite;
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.25);
    width: 70px;
    height: 70px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .logo-wrapper {
        width: 65px;
        height: 65px;
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 480px) {
    .logo-wrapper {
        width: 60px;
        height: 60px;
        padding: 0.45rem;
        margin-bottom: 0.5rem;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 20px rgba(124, 58, 237, 0.25);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 10px 25px rgba(124, 58, 237, 0.35);
    }
}

.login-logo {
    height: 40px;
    width: auto;
    max-width: 40px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

@media (max-width: 768px) {
    .login-logo {
        height: 38px;
        max-width: 38px;
    }
}

@media (max-width: 480px) {
    .login-logo {
        height: 35px;
        max-width: 35px;
    }
}

.login-header h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.login-header p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

@media (max-width: 768px) {
    .login-header h2 {
        font-size: 1.35rem;
        margin-bottom: 0.4rem;
    }
    
    .login-header p {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .login-header h2 {
        font-size: 1.25rem;
    }
    
    .login-header p {
        font-size: 0.8rem;
    }
}

.login-form {
    margin-bottom: 1.5rem;
}

.login-form .form-group {
    margin-bottom: 1.25rem;
    position: relative;
}

@media (max-width: 480px) {
    .login-form .form-group {
        margin-bottom: 1rem;
    }
}

.login-form label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.label-icon {
    font-size: 1.2rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper::before {
    content: '';
    position: absolute;
    right: 1rem;
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.4;
    transition: opacity 0.3s;
    z-index: 1;
    pointer-events: none;
}

.input-wrapper:has(#username)::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%237c3aed'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z'/%3E%3C/svg%3E");
}

.input-wrapper:has(#password)::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%237c3aed'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z'/%3E%3C/svg%3E");
}

.input-wrapper.focused::before {
    opacity: 0.7;
}

.login-form .form-control {
    width: 100%;
    padding: 1rem 1.25rem;
    padding-right: 3rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #ffffff;
    color: var(--text-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.login-form .form-control::placeholder {
    color: #9ca3af;
    opacity: 0.8;
}

.login-form .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1), 0 4px 12px rgba(124, 58, 237, 0.15);
    transform: translateY(-2px);
}

.login-form .form-control:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.input-focus-line {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

.input-wrapper.focused .input-focus-line {
    width: 100%;
}

.password-toggle {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(124, 58, 237, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0.7;
    transition: all 0.3s ease;
    z-index: 2;
}

.password-toggle:hover {
    opacity: 1;
    background: rgba(124, 58, 237, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

.password-toggle .eye-icon {
    display: block;
    font-size: 1.1rem;
}

.login-submit {
    margin-top: 1.25rem;
    padding: 0.875rem;
    font-size: 1rem;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    transition: all 0.3s ease;
}

@media (max-width: 480px) {
    .login-submit {
        margin-top: 1rem;
        padding: 0.75rem;
        font-size: 0.95rem;
    }
}

.login-submit::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.login-submit:hover::before {
    width: 300px;
    height: 300px;
}

.login-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.4);
}

.login-submit:active {
    transform: translateY(0);
}

.spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.login-footer {
    text-align: center;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
}

.footer-copyright {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.copyright-text {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: center;
}

.copyright-icon {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 600;
}

@media (max-width: 480px) {
    .login-footer {
        padding-top: 1rem;
        margin-top: 0.75rem;
    }
    
    .copyright-text {
        font-size: 0.8rem;
        flex-direction: row;
        gap: 0.3rem;
    }
    
    .copyright-icon {
        font-size: 0.85rem;
    }
}

.shake-animation {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.alert-icon {
    margin-left: 0.5rem;
    font-size: 1.2rem;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border-right: 4px solid var(--primary-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    transition: width 0.3s ease;
    z-index: 0;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(124, 58, 237, 0.25);
    border-right-color: var(--secondary-color);
}

.stat-card:hover::after {
    width: 100%;
}

.stat-card:hover .stat-card-title,
.stat-card:hover .stat-card-value {
    position: relative;
    z-index: 1;
    color: white;
}

.stat-card-title {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-card-change {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.stat-card-change.positive {
    color: var(--success-color);
}

.stat-card-change.negative {
    color: var(--danger-color);
}

/* Performance Indicators Page */
.performance-indicators-page .indicator-card {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.performance-indicators-page .card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.performance-indicators-page table {
    border: 1px solid var(--border-color);
}

.performance-indicators-page table thead {
    background: #f3f4f6 !important;
    color: var(--text-color) !important;
}

.performance-indicators-page table thead th {
    font-weight: 600;
    border: 1px solid var(--border-color);
}

.performance-indicators-page table tbody td {
    border: 1px solid var(--border-color);
    background: white;
}

.performance-indicators-page table tbody tr:hover {
    background-color: #f9fafb;
}

/* Print and Export Buttons */
.print-export-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-left: auto;
}

.print-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-color);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.print-export-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(124, 58, 237, 0.2);
}

.print-export-btn:active {
    transform: translateY(0);
}

.print-export-btn .icon {
    font-size: 1rem;
}

/* Responsive for print/export buttons */
@media (max-width: 768px) {
    .print-export-buttons {
        flex-direction: column;
        width: 100%;
        margin-left: 0;
        margin-top: 1rem;
    }
    
    .print-export-btn {
        width: 100%;
        justify-content: center;
    }
    
    .card-header {
        flex-direction: column !important;
        align-items: stretch !important;
    }
}

/* Footer */
.main-footer {
    background: var(--card-bg);
    padding: 1.5rem 0;
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
    color: var(--text-light);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        padding: 0 0.75rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 1.25rem;
    }
    
    .table-container {
        margin: 0 -0.75rem;
        padding: 0 0.75rem;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        padding: 0.75rem;
    }
    
    .main-nav {
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
        gap: 0.5rem;
        justify-content: center;
    }
    
    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .nav-link.active::after {
        display: none; /* Hide indicator on mobile */
    }
    
    .user-menu {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .main-content {
        margin: 1rem auto;
        padding: 0 0.5rem;
    }
    
    .card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .card-title {
        font-size: 1.125rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card-value {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .btn-sm {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .table-container {
        margin: 0 -0.5rem;
        padding: 0 0.5rem;
        border-radius: 0;
    }
    
    table {
        border-radius: 0.5rem;
    }
    
    table th,
    table td {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    table th {
        font-size: 0.75rem;
        padding: 0.5rem;
    }
    
    /* Show scroll indicator on mobile */
    .table-container::after {
        content: '← اسحب للتمرير →';
        position: absolute;
        bottom: -25px;
        right: 50%;
        transform: translateX(50%);
        font-size: 0.75rem;
        color: var(--text-light);
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .main-header {
        padding: 0.5rem 0 1rem 0;
    }
    
    .logo {
        height: 40px;
    }
    
    .site-title {
        font-size: 1rem;
    }
    
    .main-nav {
        gap: 0.25rem;
    }
    
    .nav-link {
        padding: 0.4rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .main-content {
        margin: 0.75rem auto;
        padding: 0 0.25rem;
    }
    
    .card {
        padding: 0.75rem;
        border-radius: 0.5rem;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .form-control {
        padding: 0.625rem;
        font-size: 0.875rem;
    }
    
    .table-container {
        margin: 0 -0.25rem;
        padding: 0 0.25rem;
    }
    
    table {
        font-size: 0.75rem;
        min-width: 600px; /* Force horizontal scroll on very small screens */
    }
    
    table th,
    table td {
        padding: 0.4rem 0.5rem;
        font-size: 0.7rem;
    }
    
    table th {
        font-size: 0.65rem;
    }
    
    /* Hide less important columns on very small screens */
    table th:nth-child(n+6):not(:last-child),
    table td:nth-child(n+6):not(:last-child) {
        display: none;
    }
    
    /* Keep important columns visible */
    table th:first-child,
    table td:first-child,
    table th:nth-child(2),
    table td:nth-child(2),
    table th:last-child,
    table td:last-child {
        display: table-cell;
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Search Filter */
.search-filter-container {
    margin-bottom: 1.5rem;
    position: relative;
}

.search-filter-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-filter-input {
    flex: 1;
    padding: 0.75rem 3rem 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s;
    background: var(--card-bg);
}

.search-filter-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.search-filter-input::placeholder {
    color: var(--text-light);
}

.search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
    font-size: 1.2rem;
}

.search-clear-btn {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    display: none;
    transition: all 0.3s;
}

.search-filter-input:not(:placeholder-shown) ~ .search-clear-btn {
    display: block;
}

.search-clear-btn:hover {
    color: var(--danger-color);
}

.no-results-message {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-size: 1rem;
    background: var(--bg-color);
    border-radius: 0.5rem;
    margin-top: 1rem;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Highlight search results */
.search-highlight {
    background-color: rgba(124, 58, 237, 0.1) !important;
    transition: background-color 0.2s ease;
}

/* Smooth transition for row visibility */
table tbody tr {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

table tbody tr.search-hidden {
    opacity: 0;
    transform: scale(0.98);
}

/* Charts */
.chart-container {
    position: relative;
    width: 100%;
    height: 200px;
    margin-top: 1rem;
}

.chart-svg {
    width: 100%;
    height: 100%;
}

.chart-bar {
    transition: all 0.6s ease-out;
    transform-origin: bottom;
    animation: chartGrow 0.8s ease-out forwards;
}

@keyframes chartGrow {
    from {
        transform: scaleY(0);
        opacity: 0;
    }
    to {
        transform: scaleY(1);
        opacity: 1;
    }
}

.chart-pie {
    transition: all 0.6s ease-out;
    animation: chartFadeIn 0.8s ease-out forwards;
}

@keyframes chartFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.stat-card-with-chart {
    position: relative;
    overflow: hidden;
}

.stat-card-chart {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    opacity: 0.3;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

