:root {
    --primary-color: #0f4c75;    /* أزرق طبي داكن */
    --secondary-color: #00b4d8;  /* أزرق تركوازي */
    --accent-color: #ff6b6b;     /* أحمر تحذيري */
    --text-color: #1b262c;       /* رمادي غامق */
    --bg-color: #f8f9fa;         /* خلفية فاتحة */
}
header {
    background: linear-gradient(90deg, #0f4c75, #1b6ca8);
}


body, html {
    height: 100%;
    margin: 0;
    font-family: 'Roboto', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    padding-top: 0; 
}

main {
    margin-top: 10px; /* تعويض ارتفاع الهيدر */
}



.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    height: 120px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}


header h1 {
    font-size: 2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

header h1 i {
    font-size: 2.2rem;
    color: var(--secondary-color);
    margin-right: 10px;
}

/* Navigation Styles */
.main-nav {
    display: flex;
    list-style-type: none;
    padding: 0;
    margin: 0;
    margin-left: -50px; /* تحريك القائمة إلى اليسار */
}

.main-nav > li {
    position: relative;
}

.main-nav > li > a {
    display: block;
    padding: 10px 15px;
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8rem; /* حجم الخط - يمكنك تغيير القيمة (مثلاً: 0.8rem أصغر، 1rem أكبر) */
    border-radius: 8px;
    transition: all 0.3s ease;
    margin: 0 5px;
}

.main-nav > li > a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.main-nav i {
    margin-right: 5px;
    width: 20px;
    text-align: center;
}

/* Dropdown Styles */
.dropdown-menu {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 160px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 1;
}

.dropdown-menu a {
    color: #333;
    padding: 10px 16px;
    font-size: 0.9rem;
    text-decoration: none;
    display: block;
    transition: background 0.2s ease;
}

.dropdown-menu a:hover {
    background: #f1f3f5;
}

.dropdown-menu i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

.dropdown.active .dropdown-menu {
    display: block;
}

/* Main Content */
main {
    min-height: calc(100vh - 150px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 0; /* تقليل المسافة العلوية إلى 24px تقريبًا */
}

/* Login Form */
.login-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-container h2 {
    margin: 0 0 1.5rem;
    color: var(--primary-color);
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.btn {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: #2980b9;
}

.error-message {
    color: var(--accent-color);
    text-align: center;
    margin-bottom: 1rem;
}

/* Dashboard */
.dashboard-container {
    padding: 40px 20px;
    background-color: #f8f9fa;
}

.dashboard-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.tile {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    padding: 30px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tile:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.tile h2 {
    font-size: 2.8em;
    margin: 0 0 10px;
    color: #fff;
    font-weight: 700;
}

.tile p {
    margin: 15px 0;
    font-size: 1.2em;
    color: rgba(255, 255, 255, 0.9);
}

.tile i {
    font-size: 3em;
    margin-bottom: 15px;
    display: block;
    color: rgba(255, 255, 255, 0.85);
}

.more-info {
    display: inline-block;
    margin-top: 15px;
    padding: 8px 16px;
    background-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.more-info:hover {
    background-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.more-info i {
    margin-left: 8px;
    font-size: 1.3em;
    transition: transform 0.3s ease;
}

.more-info:hover i {
    transform: translateX(6px);
}

/* Tile Colors */
.blue { background-color: #3498db; }
.green { background-color: #2ecc71; }
.orange { background-color: #e67e22; }
.purple { background-color: #9b59b6; }
.red { background-color: #e74c3c; }
.teal { background-color: #1abc9c; }
.yellow { background-color: #f1c40f; }
.pink { background-color: #e84393; }

/* Table Styles */
.table-container {
    overflow-x: auto;
    margin: 2rem 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    text-align: left;
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
}

thead {
    background-color: var(--primary-color);
    color: white;
}

th {
    font-weight: 600;
}

tr:nth-child(even) {
    background-color: #f8f9fa;
}

tr:hover {
    background-color: #f1f3f5;
}

/* Action Buttons */
.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    text-decoration: none;
    display: inline-block;
    margin-right: 5px;
    margin-bottom: 10px;
    transition: background-color 0.3s ease, opacity 0.3s ease;
}

.action-btn:hover {
    opacity: 0.8;
}

.action-btn i {
    margin-right: 5px;
}

.view-btn { background-color: #3498db; color: white; }
.edit-btn { background-color: #f39c12; color: white; }
.delete-btn { background-color: #e74c3c; color: white; }
.viewR-btn { background-color: #5ee73c; color: white; }

/* Date Filter Form */
.date-filter-form {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.date-filter-form .form-group {
    display: inline-block;
    margin-right: 15px;
}

.date-filter-form label {
    margin-right: 5px;
}

.date-filter-form input[type="date"] {
    padding: 5px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.date-filter-form button {
    padding: 5px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.date-filter-form button:hover {
    background-color: #0056b3;
}

/* Edit Item Form */
.edit-item-form .form-row {
    margin-bottom: 10px;
}

.edit-item-form .form-control {
    font-size: 0.9rem;
}

.edit-item-form .btn {
    font-size: 0.9rem;
}

/* Chat Container */
.chat-container {
    display: flex;
    height: calc(100vh - 150px);
    margin-top: 20px;
}

.user-list {
    width: 250px;
    border-right: 1px solid #ccc;
    overflow-y: auto;
}

.user-list h3 {
    padding: 10px;
    margin: 0;
    background-color: #f8f9fa;
    border-bottom: 1px solid #ccc;
}

.user-item {
    padding: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.user-item:hover {
    background-color: #f1f3f5;
}

.user-item.active {
    background-color: #e9ecef;
    font-weight: bold;
}

.user-item .unread {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #007bff;
    border-radius: 50%;
    margin-left: 5px;
}

.chat-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

#chat-window {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #fff;
}

.message {
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 5px;
    max-width: 70%;
}

.message.sent {
    background-color: #dcf8c6;
    align-self: flex-end;
    margin-left: auto;
}

.message.received {
    background-color: #f1f0f0;
    align-self: flex-start;
}

.message .sender {
    font-weight: bold;
    margin-bottom: 5px;
}

.message .time {
    font-size: 0.8em;
    color: #888;
    text-align: right;
}

.chat-input {
    padding: 20px;
    background-color: #f8f9fa;
    border-top: 1px solid #ccc;
}

#chat-form {
    display: flex;
}

#message {
    flex-grow: 1;
    margin-right: 10px;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 1rem 0;
    position: relative;
    bottom: 0;
    width: 100%;
}

/* Loading Indicator */
.loading {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #888;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    header {
        height: 120px; /* تقليل ارتفاع الهيدر للشاشات الصغيرة */
    }


    header .container {
        flex-direction: column;
        text-align: center;
    }

    .main-nav {
        flex-direction: column;
        margin-top: 1rem;
    }

    .main-nav li {
        margin: 0 10px;
    }

    .dropdown-menu {
        position: static;
        background-color: #f1f1f1;
        padding-left: 15px;
    }

    .chat-container {
        flex-direction: column;
        height: auto;
    }

    .user-list {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #ccc;
        max-height: 200px;
    }

    .chat-area {
        height: calc(100vh - 240px); /* تحديث ليعكس ارتفاع الهيدر الجديد */
    }
}

@media screen and (max-width: 600px) {
    table {
        font-size: 0.8rem;
    }

    th, td {
        padding: 8px 10px;
    }

    .action-btn {
        padding: 4px 8px;
        font-size: 0.7rem;
    }

    .button-container {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
}

