* {
    box-sizing: border-box;
}

:root {
    --color-bg-page: #E5E5E5;
    --color-text: #333333;
    --color-border: #e9ecef;
    --color-muted: #6c757d;
    --color-link: #007bff;
    --color-link-hover: #0d6efd;
    --color-accent: #17a2b8;
    --color-accent-hover: #138496;
    --radius-sm: 6px;
    --radius-md: 8px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.sidebar {
    width: 200px;
    background-color: #f8f9fa;
    border-right: 1px solid #e9ecef;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

.sidebar-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
    font-weight: bold;
}

.about-logo {
    max-width: 160px;
    height: auto;
    margin-right: 8px;
    border-radius: 4px;
}

/* Responsive logo sizing */
@media (max-width: 992px) {
    .about-logo {
        max-width: 28px;
    }
}

@media (max-width: 576px) {
    .about-logo {
        max-width: 24px;
        margin-right: 6px;
    }
    
    .logo-text {
        font-size: 14px;
    }
}

.logo-icon {
    background-color: #28a745;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    font-size: 18px;
}

.logo-text {
    font-size: 16px;
    font-weight: 600;
}

.sidebar-content {
    padding: 1rem 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem;
    border-top: 1px solid #e9ecef;
    background-color: #ffffff;
    flex-shrink: 0;
}

.sidebar-login {
    margin-bottom: 1rem;
    font-size: 14px;
}

.sidebar-login a {
    color: #007bff;
    text-decoration: none;
    font-size: 12px;
}

.sidebar-login a:hover {
    text-decoration: underline;
}

.sidebar-footer-info {
    font-size: 11px;
    color: #6c757d;
    line-height: 1.4;
}

.sidebar-footer-info a {
    color: #007bff;
    text-decoration: none;
}

.sidebar-footer-info a:hover {
    text-decoration: underline;
}

.nav-section {
    padding: 0.5rem 1rem;
    margin-bottom: 0.5rem;
}

.nav-label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    font-weight: 500;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav .nav-item {
    margin-bottom: 2px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 0;
}

.sidebar-nav .nav-link:hover {
    background-color: #e9ecef;
    color: #007bff;
}

.sidebar-nav .nav-item.active .nav-link {
    background-color: #E0F2FA;
    color: #003975;
}

.nav-icon {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

.main-content {
    margin-left: 200px;
    width: calc(100% - 200px);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.top-navbar {
    background-color: white;
    border-bottom: 1px solid #e9ecef;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 999;
    width: 100%;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    padding: 4px;
}

.hamburger-line {
    display: block;
    width: 20px;
    height: 2px;
    background-color: #333;
    margin: 2px 0;
    transition: 0.3s;
}

.navbar-right {
    display: flex;
    align-items: center;
}

.page-content {
    flex: 1;
    padding: 1.5rem;
    background-color: #E5E5E5;
    min-height: calc(100vh - 60px);
}

.footer-content a {
    color: #007bff;
    text-decoration: none;
}

.footer-content a:hover {
    text-decoration: underline;
}

/* ---------------------------------------------
   Shared Styling
---------------------------------------------- */

.admin-container,
.pharmacist-container,
.pharmacy-container,
.forms-container {
    padding: 20px;
    background-color: var(--color-bg-page);
    min-height: 100vh;
}

.admin-header,
.pharmacist-header,
.pharmacy-header,
.forms-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.admin-header h2,
.pharmacist-header h2,
.pharmacy-header h2,
.forms-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

.btn-add-pharmacy,
.btn-add-form {
    background-color: var(--color-accent, #17a2b8);
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-add-pharmacy:hover,
.btn-add-form:hover {
    background-color: var(--color-accent-hover, #138496);
}

button:disabled,
.btn:disabled {
    background-color: #6c757d;
    color: #ffffff;
    cursor: not-allowed;
    opacity: 0.6;
    border-color: #6c757d;
}

button:disabled:hover,
.btn:disabled:hover {
    background-color: #6c757d;
}

.btn-add-pharmacy:disabled,
.btn-add-form:disabled {
    background-color: var(--color-accent, #17a2b8);
    border-color: transparent;
    color: #ffffff;
    opacity: 0.65;
    cursor: not-allowed;
}

.btn-add-pharmacy:disabled:hover,
.btn-add-form:disabled:hover {
    background-color: var(--color-accent-hover, #138496);
}

.search-container {
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    font-size: 14px;
    background-color: #ffffff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.1);
}

.search-input::placeholder {
    color: #999999;
}

.admin-table,
.pharmacist-table,
.pharmacy-table {
    background-color: #ffffff;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: none;
}

.admin-table thead,
.pharmacist-table thead,
.pharmacy-table thead {
    background-color: #FAFAFA;
}

.admin-table th,
.pharmacist-table th,
.pharmacy-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: #555555;
    font-size: 14px;
    border-bottom: 2px solid var(--color-border);
    border-top: none;
}

.admin-table tbody tr,
.pharmacist-table tbody tr,
.pharmacy-table tbody tr {
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.2s ease;
}

.admin-table tbody tr:hover,
.pharmacist-table tbody tr:hover,
.pharmacy-table tbody tr:hover {
    background-color: #f8f9fa;
}

.admin-table tbody tr:nth-of-type(odd),
.pharmacist-table tbody tr:nth-of-type(odd),
.pharmacy-table tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

.admin-table tbody tr:nth-of-type(odd):hover,
.pharmacist-table tbody tr:nth-of-type(odd):hover,
.pharmacy-table tbody tr:nth-of-type(odd):hover {
    background-color: #f8f9fa;
}

.admin-table td,
.pharmacist-table td,
.pharmacy-table td {
    padding: 16px 20px;
    font-size: 14px;
    color: var(--color-text);
    vertical-align: middle;
    border-top: none;
}

.actions {
    white-space: nowrap;
}

.actions .btn {
    margin-right: 5px;
    margin-bottom: 5px;
    font-size: 12px;
    padding: 4px 8px;
}

.actions .btn:last-child {
    margin-right: 0;
}

@media (max-width: 768px) {
    .admin-container,
    .pharmacist-container,
    .pharmacy-container,
    .forms-container {
        padding: 15px;
    }

    .admin-header,
    .pharmacist-header,
    .pharmacy-header,
    .forms-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .admin-table,
    .pharmacist-table,
    .pharmacy-table {
        font-size: 12px;
    }

    .admin-table th,
    .admin-table td,
    .pharmacist-table th,
    .pharmacist-table td,
    .pharmacy-table th,
    .pharmacy-table td {
        padding: 12px 10px;
    }

    .search-input {
        max-width: 100%;
    }

    .actions .btn {
        font-size: 10px;
        padding: 2px 6px;
        margin-right: 3px;
        margin-bottom: 3px;
    }
}

@media (max-width: 480px) {
    .actions .btn {
        display: block;
        width: 100%;
        margin-bottom: 3px;
        margin-right: 0;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1050;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .page-content {
        padding: 1rem;
    }
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
}

.sidebar-overlay.show {
    display: block;
}

.container {
    max-width: none;
    padding: 0;
}

.page-content .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.answer-correct {
    color: #28a745 !important;
    font-weight: 500;
}

.answer-incorrect {
    color: #dc3545 !important;
    font-weight: 500;
}