/* Modern UI/UX CSS for المستشار */
:root {
    /* Primary Colors */
    --primary-color: #5e35b1; /* Slightly more vibrant purple */
    --primary-light: #9162e4;
    --primary-dark: #280680;

    /* Secondary Colors */
    --secondary-color: #03a9f4; /* Brighter blue */
    --secondary-light: #67daff;
    --secondary-dark: #007ac1;

    /* Text Colors */
    --text-on-primary: #ffffff;
    --text-on-secondary: #000000;
    --text-muted: rgba(255, 255, 255, 0.7);

    /* Background Colors */
    --background-light: #f8f9fa;
    --background-dark: #121212;
    --card-bg: #ffffff;

    /* Status Colors */
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --danger-color: #f44336;
    --info-color: #2196f3;

    /* Design Elements */
    --border-radius: 10px;
    --border-radius-lg: 15px;
    --border-radius-sm: 6px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --box-shadow-hover: 0 10px 20px rgba(0, 0, 0, 0.2);
    --transition-speed: 0.3s;
    --gradient-bg: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 35%, var(--secondary-color) 100%);
    --gradient-btn: linear-gradient(45deg, var(--primary-color), var(--primary-light));
    --gradient-btn-hover: linear-gradient(45deg, var(--primary-dark), var(--primary-color));
}

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

::selection {
    background-color: var(--primary-light);
    color: white;
}

body {
    font-family: 'Cairo', sans-serif;
    background: var(--gradient-bg);
    color: var(--text-on-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow-x: hidden;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Modern Card Styling */
.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: all var(--transition-speed) ease-in-out;
    overflow: hidden;
    height: 100%;
    border: none;
    position: relative;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background: var(--gradient-btn);
    transition: height var(--transition-speed) ease;
}

.card:hover::before {
    height: 100%;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}


.card-img-top {
    padding: 1.5rem;
    height: 150px;
    object-fit: contain;
    background-color: var(--background-light);
}

.card-body {
    padding: 1rem;
    text-align: center;
}

.card-text {
    font-weight: 600;
    color: var(--primary-color);
}

/* Modern Button Styling */
.btn {
    border-radius: 50px;
    padding: 0.6rem 1.8rem;
    font-weight: 600;
    transition: all var(--transition-speed);
    border: none;
    box-shadow: var(--box-shadow);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: all 0.5s ease;
    z-index: -1;
}

.btn:hover::before {
    width: 100%;
}

.btn-primary {
    background: var(--gradient-btn);
    color: var(--text-on-primary);
}

.btn-primary:hover {
    background: var(--gradient-btn-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: linear-gradient(45deg, var(--secondary-dark), var(--secondary-color));
    color: var(--text-on-primary);
}

.btn-secondary:hover {
    background: linear-gradient(45deg, var(--secondary-color), var(--secondary-light));
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.btn-success {
    background: linear-gradient(45deg, #388e3c, #4caf50);
    color: white;
}

.btn-danger {
    background: linear-gradient(45deg, #d32f2f, #f44336);
    color: white;
}

.btn-warning {
    background: linear-gradient(45deg, #f57c00, #ff9800);
    color: white;
}

.btn-info {
    background: linear-gradient(45deg, #0288d1, #03a9f4);
    color: white;
}

.btn .bi {
    margin-left: 0.5rem;
    vertical-align: middle;
    font-size: 1.1em;
}

/* Form Styling */
.form-container {
    background-color: var(--card-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    padding: 2.5rem;
    width: 100%;
    max-width: 550px;
    margin: 2rem auto;
    position: relative;
    overflow: hidden;
}

.form-container::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient-btn);
}

.form-control {
    border-radius: var(--border-radius);
    padding: 0.85rem 1.2rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all var(--transition-speed);
    font-size: 1rem;
    background-color: rgba(0, 0, 0, 0.02);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(94, 53, 177, 0.15);
    background-color: white;
}

.form-control::placeholder {
    color: rgba(0, 0, 0, 0.4);
    font-size: 0.9rem;
}

label {
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: block;
    color: var(--primary-dark);
    font-size: 0.95rem;
}

/* Navigation Bar */
.modern-navbar {
    background-color: var(--card-bg);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    padding: 0.85rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all var(--transition-speed);
}

.modern-navbar.scrolled {
    padding: 0.6rem 1.5rem;
}

.modern-navbar .navbar-brand {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.5rem;
    position: relative;
    padding-right: 0.5rem;
}

.modern-navbar .navbar-brand::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    width: 30px;
    height: 3px;
    background: var(--gradient-btn);
    border-radius: 3px;
}

.modern-navbar .nav-link {
    color: var(--primary-dark);
    font-weight: 600;
    padding: 0.5rem 1.2rem;
    transition: all var(--transition-speed);
    position: relative;
    margin: 0 0.2rem;
}

.modern-navbar .nav-link:hover {
    color: var(--primary-color);
}

.modern-navbar .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-light);
    transition: all var(--transition-speed);
    transform: translateX(50%);
}

.modern-navbar .nav-link:hover::before {
    width: 70%;
}

.modern-navbar .nav-link:hover {
    color: var(--primary-color);
}

.modern-navbar .dropdown-menu {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-hover);
    border: none;
    padding: 0.75rem 0.5rem;
    margin-top: 0.5rem;
    animation: fadeIn 0.3s ease-in-out;
    border-top: 3px solid var(--primary-light);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.modern-navbar .dropdown-item {
    padding: 0.7rem 1.2rem;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-speed);
    margin-bottom: 0.2rem;
    font-weight: 500;
    position: relative;
    padding-right: 2rem;
}

.modern-navbar .dropdown-item:hover {
    background-color: rgba(94, 53, 177, 0.1);
    color: var(--primary-color);
    transform: translateX(5px);
}

.modern-navbar .dropdown-item::before {
    content: '•';
    position: absolute;
    right: 1rem;
    color: var(--primary-light);
    opacity: 0;
    transition: all var(--transition-speed);
}

.modern-navbar .dropdown-item:hover::before {
    opacity: 1;
}

/* Dashboard Items */
.dashboard-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 2rem;
    justify-content: center;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.dashboard-card {
    flex: 0 0 calc(25% - 2rem);
    max-width: calc(25% - 2rem);
    min-width: 220px;
    transition: all var(--transition-speed);
}

.dashboard-card:nth-child(even) .card::before {
    background: linear-gradient(to top, var(--secondary-color), var(--secondary-light));
}

.dashboard-card:hover {
    transform: scale(1.03);
}

/* Page Title */
.page-title {
    text-align: center;
    margin: 2.5rem 0;
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    display: inline-block;
    padding-bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--secondary-light);
    border-radius: 4px;
}

/* Table Styling */
.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background-color: var(--card-bg);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
}

.modern-table thead {
    position: relative;
}

.modern-table thead::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(0, 0, 0, 0.05);
}

.modern-table th {
    background: linear-gradient(45deg, var(--primary-dark), var(--primary-color));
    color: white;
    padding: 1.2rem 1.5rem;
    text-align: right;
    font-weight: 600;
    position: relative;
    transition: all var(--transition-speed);
}

.modern-table th:first-child {
    border-top-right-radius: var(--border-radius);
}

.modern-table th:last-child {
    border-top-left-radius: var(--border-radius);
}

.modern-table td {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all var(--transition-speed);
}

.modern-table tr:last-child td {
    border-bottom: none;
}

.modern-table tr {
    transition: all var(--transition-speed);
}

.modern-table tr:hover {
    background-color: rgba(94, 53, 177, 0.05);
}

.modern-table tr:hover td {
    transform: translateX(5px);
}

/* Responsive Design */
@media (max-width: 992px) {
    .dashboard-card {
        flex: 0 0 calc(33.333% - 2rem);
        max-width: calc(33.333% - 2rem);
    }

    .modern-navbar .nav-link {
        padding: 0.5rem 0.8rem;
    }

    .modern-table th,
    .modern-table td {
        padding: 1rem 1.2rem;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .dashboard-card {
        flex: 0 0 calc(50% - 1.5rem);
        max-width: calc(50% - 1.5rem);
    }

    .form-container {
        padding: 1.5rem;
        margin: 1.5rem auto;
        border-radius: var(--border-radius);
    }

    .page-title {
        font-size: 2rem;
        margin: 1.5rem 0;
    }

    .btn {
        padding: 0.5rem 1.2rem;
    }

    .modern-table {
        border-radius: var(--border-radius);
    }
}

@media (max-width: 576px) {
    .dashboard-card {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .page-title {
        font-size: 1.75rem;
    }

    .form-control {
        padding: 0.75rem 1rem;
    }
}

/* Alert Styling */
.alert {
    border: none;
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.alert::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 4px;
}

.alert-success {
    background-color: rgba(76, 175, 80, 0.1);
    color: #388e3c;
}

.alert-success::before {
    background-color: var(--success-color);
}

.alert-danger {
    background-color: rgba(244, 67, 54, 0.1);
    color: #d32f2f;
}

.alert-danger::before {
    background-color: var(--danger-color);
}

.alert-warning {
    background-color: rgba(255, 152, 0, 0.1);
    color: #f57c00;
}

.alert-warning::before {
    background-color: var(--warning-color);
}

.alert-info {
    background-color: rgba(3, 169, 244, 0.1);
    color: #0288d1;
}

.alert-info::before {
    background-color: var(--info-color);
}

/* Badge Styling */
.badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 50px;
    transition: all var(--transition-speed);
}

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

.badge-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.badge-success {
    background-color: var(--success-color);
    color: white;
}

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

.badge-warning {
    background-color: var(--warning-color);
    color: white;
}

.badge-info {
    background-color: var(--info-color);
    color: white;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1060;
}

.toast {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-hover);
    overflow: hidden;
    margin-bottom: 10px;
    width: 350px;
    max-width: 100%;
    animation: slideInLeft 0.3s ease-out;
}

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

.toast-header {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.toast-body {
    padding: 1rem;
}

/* Login Footer */
.login-footer {
    margin-top: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    animation: fadeIn 1s ease-out;
}

/* Login Page Styles */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    max-width: 100%;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.8s ease-out;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    z-index: -1;
}

.login-container::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    z-index: -1;
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
    animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-title {
    font-size: 3.2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    display: inline-block;
}

.login-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--secondary-light);
    border-radius: 3px;
}

.login-subtitle {
    font-size: 1.3rem;
    color: var(--text-muted);
    margin-bottom: 0;
    font-weight: 300;
}

.login-form {
    width: 100%;
    max-width: 450px;
    background-color: var(--card-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-hover);
    padding: 2.75rem;
    margin-bottom: 2rem;
    position: relative;
    animation: fadeInUp 0.8s ease-out;
}

.login-form::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient-btn);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.login-form h2 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 1.75rem;
    position: relative;
    display: inline-block;
    padding-bottom: 0.5rem;
}

.login-form h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 3px;
    background: var(--primary-light);
    border-radius: 3px;
}

.login-form .form-control {
    padding: 0.85rem 1.2rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all var(--transition-speed);
    background-color: rgba(0, 0, 0, 0.02);
    margin-bottom: 1.25rem;
}

.login-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(69, 39, 160, 0.25);
}

.login-form label {
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.login-form .btn-primary {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    margin-top: 1rem;
}

.login-footer {
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    font-size: 0.9rem;
}

@media (max-width: 576px) {
    .dashboard-card {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .modern-table {
        font-size: 0.875rem;
    }

    .modern-table th,
    .modern-table td {
        padding: 0.75rem;
    }

    .page-title {
        font-size: 1.75rem;
    }

    .login-title {
        font-size: 2.5rem;
    }

    .login-form {
        padding: 1.5rem;
    }
}

/* Search Result Styles */
.table-container {
    padding: 20px;
    margin: 20px auto;
    max-width: 95%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-title {
    color: #333;
    font-size: 24px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
}

.table-responsive {
    max-height: 70vh; /* Limit table height to 70% of viewport height */
    overflow-y: auto; /* Enable vertical scrolling */
}

.data-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table th {
    background-color: var(--background-light);
    color: var(--text-on-secondary);
    font-weight: bold;
    padding: 12px;
    text-align: right;
    border-bottom: 2px solid var(--secondary-light);
    /* Add shadow to make header stand out */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
    text-align: right;
}

.data-table tr:hover {
    background-color: #f5f5f5;
    transition: background-color 0.2s ease;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.no-results {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

/* Responsive table */
@media screen and (max-width: 1200px) {
    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Add some spacing between cells */
.data-table th,
.data-table td {
    min-width: 120px;
    color: black;
}

/* Style for specific columns */
.data-table td:first-child {
    font-weight: bold;
    color: #007bff;
}

/* Style for expired date */
.data-table td:last-child {
    color: #dc3545;
}
thead{
    position: static;
}
