/* project/css/style.css */

/* Global Styles */
:root {
    --primary-color: #4CAF50; /* Green */
    --secondary-color: #2196F3; /* Blue */
    --accent-color: #FFC107; /* Amber */
    --text-color: #333;
    --light-text-color: #f4f7f6;
    --bg-color: #f4f7f6;
    --card-bg: #fff;
    --border-color: #ddd;
    --danger-color: #f44336; /* Red */
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.message {
    margin-top: 15px;
    font-weight: bold;
    text-align: center;
}

.success-message {
    color: var(--primary-color);
}

.error-message {
    color: var(--danger-color);
}

/* Authentication Container */
.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(to bottom right, var(--primary-color), var(--secondary-color));
}

.auth-form {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 450px;
    text-align: center;
    margin-top: 20px;
    animation: fadeIn 0.8s ease-out;
}

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

.auth-form h3 {
    margin-bottom: 25px;
    color: var(--primary-color);
    font-size: 1.8em;
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"],
.auth-form select {
    width: calc(100% - 20px);
    padding: 14px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 17px;
    transition: border-color 0.3s ease;
}

.auth-form input:focus,
.auth-form select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 5px rgba(33, 150, 243, 0.3);
}

.auth-form button {
    background-color: var(--primary-color);
    color: white;
    padding: 14px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: 100%;
    margin-top: 10px;
}

.auth-form button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

.toggle-link {
    color: var(--secondary-color);
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.toggle-link:hover {
    color: #1976d2;
    text-decoration: underline;
}

.role-selection {
    margin-bottom: 25px;
}

.role-selection button {
    background-color: #eee;
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    margin: 0 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    min-width: 120px;
}

.role-selection button.active,
.role-selection button:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-color);
}

.sidebar {
    width: 280px;
    background-color: #2c3e50;
    color: white;
    padding: 25px 20px;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.sidebar .logo {
    font-size: 28px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 40px;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.sidebar nav {
    flex-grow: 1;
}

.sidebar nav ul {
    list-style: none;
}

.sidebar nav ul li {
    padding: 15px 15px;
    margin-bottom: 10px;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1em;
}

.sidebar nav ul li:hover,
.sidebar nav ul li.active {
    background-color: #34495e;
    transform: translateX(5px);
}

.sidebar nav ul li button {
    background: none;
    border: none;
    color: white;
    font-size: 1.1em;
    cursor: pointer;
    width: 100%;
    text-align: left;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar nav ul li button:hover {
    color: var(--primary-color);
}

.main-content {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
}

.main-content header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    background-color: var(--card-bg);
    padding: 25px 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.main-content h1 {
    color: var(--primary-color);
    font-size: 2em;
}

.header-actions {
    display: flex;
    align-items: center;
    position: relative;
}

.dashboard-section {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    animation: slideIn 0.6s ease-out;
}

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

.dashboard-section h2 {
    color: var(--secondary-color);
    margin-bottom: 25px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 12px;
    font-size: 1.8em;
}

/* Common Form/Input Styles within Sections */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 5px rgba(33, 150, 243, 0.2);
}

.dashboard-section button {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 10px;
    margin-right: 10px;
}

.dashboard-section button:hover {
    background-color: #45a049;
    transform: translateY(-1px);
}

.dashboard-section button.danger {
    background-color: var(--danger-color);
}
.dashboard-section button.danger:hover {
    background-color: #d32f2f;
}
.dashboard-section button.secondary {
    background-color: var(--secondary-color);
}
.dashboard-section button.secondary:hover {
    background-color: #1976d2;
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 25px;
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden; /* Ensures rounded corners */
}

table th, table td {
    border: 1px solid var(--border-color);
    padding: 15px;
    text-align: left;
    font-size: 0.95em;
}

table th {
    background-color: #e0e0e0;
    font-weight: bold;
    color: #555;
    text-transform: uppercase;
}

table tr:nth-child(even) {
    background-color: #f9f9f9;
}

table tr:hover {
    background-color: #f0f0f0;
}

table button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 5px;
    transition: background-color 0.3s ease;
}

table button.edit-btn {
    background-color: var(--accent-color);
}
table button.edit-btn:hover {
    background-color: #e0b000;
}

table button.delete-btn {
    background-color: var(--danger-color);
}
table button.delete-btn:hover {
    background-color: #d32f2f;
}

/* Profile Section */
#profileImage {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 25px;
    border: 4px solid var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    display: block;
    margin-left: auto;
    margin-right: auto;
}

#profileImageUpload {
    display: block;
    margin: 15px auto 25px auto;
    width: fit-content;
}

.profile-info p {
    font-size: 1.1em;
    margin-bottom: 10px;
    padding: 5px 0;
    border-bottom: 1px dashed #eee;
}

.profile-info p span {
    font-weight: bold;
    color: var(--secondary-color);
}

/* Notifications */
.notification-bell {
    position: relative;
    font-size: 28px;
    cursor: pointer;
    margin-right: 25px;
    color: var(--secondary-color);
}

.notification-bell .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--danger-color);
    color: white;
    border-radius: 50%;
    padding: 3px 8px;
    font-size: 13px;
    font-weight: bold;
    min-width: 25px;
    text-align: center;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

.notification-dropdown {
    position: absolute;
    top: 70px; /* Adjust based on header height */
    right: 20px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    width: 350px;
    max-height: 350px;
    overflow-y: auto;
    padding: 15px;
    z-index: 1000;
    display: none;
    animation: dropdownFadeIn 0.3s ease-out;
}

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

.notification-dropdown.show {
    display: block;
}

.notification-dropdown h4 {
    margin-bottom: 15px;
    color: var(--primary-color);
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.notification-dropdown .notification-item {
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
    font-size: 15px;
    color: #555;
}

.notification-dropdown .notification-item:last-child {
    border-bottom: none;
}

/* Search & Filter */
.search-filter {
    margin-bottom: 25px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.search-filter input[type="text"],
.search-filter select {
    flex-grow: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 16px;
    min-width: 150px; /* Ensure input is not too small */
}

.search-filter button {
    background-color: var(--secondary-color);
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.search-filter button:hover {
    background-color: #1976d2;
}

/* Modals (for Add/Edit forms) */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-content .close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #888;
    transition: color 0.3s ease;
}

.modal-content .close-button:hover {
    color: var(--danger-color);
}

.modal-content h3 {
    margin-bottom: 25px;
    color: var(--primary-color);
    font-size: 1.6em;
}

/* Responsive Design */
@media (max-width: 992px) {
    .dashboard-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        padding: 15px 20px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    }

    .sidebar .logo {
        margin-bottom: 20px;
    }

    .sidebar nav ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .sidebar nav ul li {
        flex-grow: 1;
        max-width: 150px; /* Limit size for smaller screens */
        text-align: center;
        padding: 12px 10px;
        font-size: 0.95em;
    }

    .sidebar nav ul li button {
        justify-content: center;
    }

    .main-content {
        padding: 20px 15px;
    }

    .main-content header {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px 20px;
    }

    .main-content header h1 {
        margin-bottom: 10px;
        font-size: 1.8em;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .notification-dropdown {
        top: auto;
        bottom: 20px; /* Position above on small screens */
        right: 15px;
        left: 15px;
        width: auto;
        max-width: unset;
    }
}

@media (max-width: 768px) {
    .auth-form {
        padding: 25px;
    }

    .auth-form h3 {
        font-size: 1.6em;
    }

    .auth-form input,
    .auth-form select,
    .auth-form button {
        font-size: 15px;
        padding: 12px;
    }

    .role-selection button {
        font-size: 14px;
        padding: 10px 15px;
        min-width: 100px;
    }

    .dashboard-section {
        padding: 20px;
    }

    .dashboard-section h2 {
        font-size: 1.5em;
    }

    table th, table td {
        padding: 10px;
        font-size: 0.9em;
    }

    table button {
        padding: 6px 10px;
        font-size: 0.85em;
    }

    .modal-content {
        padding: 25px;
    }
    .modal-content h3 {
        font-size: 1.4em;
    }
}

@media (max-width: 480px) {
    .auth-form {
        padding: 15px;
    }

    .auth-form h3 {
        font-size: 1.4em;
    }

    .role-selection button {
        margin: 5px;
        width: 100%; /* Stack buttons */
    }

    .main-content {
        padding: 10px;
    }

    .main-content header {
        padding: 10px;
    }

    .main-content h1 {
        font-size: 1.5em;
    }

    .dashboard-section {
        padding: 15px;
    }

    .dashboard-section h2 {
        font-size: 1.3em;
    }

    .search-filter {
        flex-direction: column;
        gap: 10px;
    }

    .notification-bell {
        font-size: 24px;
        margin-right: 15px;
    }
    .notification-bell .badge {
        font-size: 11px;
        min-width: 20px;
        padding: 2px 5px;
    }

    .notification-dropdown {
        width: calc(100% - 30px);
        right: 15px;
        left: 15px;
    }
}