/*// templates/static/styles.css */

/* General styles using the new color scheme */
body {
    background-color: #ffffff;
    color: #2F4728;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

#entity-form-popup {
    width: 300px;
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.2);
}

#entity-form-popup h2 {
    margin-top: 0;
    font-size: 20px;
    color: #333;
}


/* Navigation bar */
.navbar {
    background-color: #2F4728;
    color: #ffffff;
    padding: 10px;
    text-align: center;
}

.navbar a {
    color: #ffffff;
    text-decoration: none;
    padding: 0 15px;
}

/* Modern Flexible Sidebar */
.sidebar {
    background-color: #2F4728;
    color: #ffffff;
    width: clamp(200px, 15vw, 280px);
    /* Responsive width */
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    padding: 0;
    /* Let children handle padding */
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar h2 {
    text-align: center;
    margin: 0;
    padding: 1.5rem;
    /* ~p-6 */
    font-size: 1rem;
    /* ~text-xl */
    font-weight: 700;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem 0.25rem;
    /* ~py-4 px-3 */
    gap: 0.5rem;
    /* ~space-y-2 */
}

/* Base list styles (Legacy/Super Admin) */
/* Base list styles (Legacy/Super Admin) */
.sidebar nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
    /* Push footer/logout to bottom */
    gap: 0.25rem;
}

.sidebar nav ul li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.25rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.75rem;
    line-height: normal;
}

.sidebar nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.sidebar nav ul li a.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-left: 4px solid #5C7AEA;
}

/* Category Section Styles (New Design) */
.category-section {
    display: flex;
    flex-direction: column;
}

.sidebar button,
.sidebar a {
    text-decoration: none;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

/* Category Button */
.sidebar button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.6rem;
    border-radius: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s;
}

.sidebar button:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.sidebar button .flex {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Category Label */
.font-semibold {
    font-weight: 600;
}

.uppercase {
    text-transform: uppercase;
}

.tracking-wider {
    letter-spacing: 0.05em;
}

.text-xs {
    font-size: 0.65rem;
}

.text-sm {
    font-size: 0.75rem;
}

/* Material Icons helpers */
.material-icons-round {
    font-size: 1rem;
}

.sidebar button .material-icons-round {
    font-size: 1rem;
}

.sidebar .category-content a .material-icons-round {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.2s;
}

.sidebar .category-content a:hover .material-icons-round,
.sidebar .category-content a.active .material-icons-round {
    color: #ffffff;
}

/* Expanding Content */
.category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.category-content.open {
    max-height: 500px;
    transition: max-height 0.3s ease-in;
    margin-top: 0.25rem;
}

/* Sub-links indent */
.sidebar .category-content a {
    padding-left: 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    padding-right: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
}

.sidebar .category-content a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.sidebar .category-content a.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-weight: 600;
}

/* Chevron Rotation */
.chevron {
    transition: transform 0.3s ease;
}

.chevron.rotate {
    transform: rotate(180deg);
}

/* Standalone Links (Dashboard) */
/* Standalone Links (Dashboard) */
/* Standalone Links (Dashboard) */
.dashboard-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.6rem;
    border-radius: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s;
    text-decoration: none;
    /* Ensure no underline */
}

.dashboard-link .flex {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    /* Match button gap */
}

.dashboard-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.dashboard-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-weight: 600;
}

/* Logout Item Special Styling */
.logout-item {
    margin-top: auto !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 0;
    /* Reduced padding for alignment */
    width: 100%;
}

.logout-item a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.25rem;
    /* Match other items padding */
    border-radius: 0.5rem;
    color: #ffb3b3 !important;
    text-decoration: none;
    transition: all 0.2s;
}

.logout-item a:hover {
    background-color: rgba(255, 0, 0, 0.1) !important;
    color: #ffcccc !important;
}

/* Navigation dividers (Legacy) */
.nav-divider {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 1rem 0 0.5rem 0;
    padding: 0 0.75rem;
}

/* Main content area - now handled by base.html flexbox */
.main-content {
    padding: clamp(1rem, 3vw, 1.5rem);
    /* Responsive padding */
    background-color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Enhanced Buttons with Better Contrast */
.btn {
    background-color: #2F4728;
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    text-transform: uppercase;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.btn:hover {
    background-color: #1e2f1a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(47, 71, 40, 0.3);
}

/* Button Variants for Better Hierarchy */
.btn-primary {
    background-color: #2F4728;
    border-color: #2F4728;
}

.btn-primary:hover {
    background-color: #1e2f1a;
    border-color: #1e2f1a;
}

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #545b62;
    border-color: #545b62;
}

.btn-success {
    background-color: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    background-color: #1e7e34;
    border-color: #1e7e34;
}

/* Form Styles */
form {
    margin: 50px auto;
    padding: 30px;
    border: 1px solid #2F4728;
    border-radius: 10px;
    background-color: #ffffff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Form Input Fields with Better Contrast */
input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    border-color: #2F4728;
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(47, 71, 40, 0.25);
}

/* Headings and Labels */
h1 {
    color: #2F4728;
    text-align: center;
    font-size: 28px;
    margin-top: 20px;
    font-weight: 600;
}

h2,
h3,
h4,
h5,
h6 {
    color: #2F4728;
    font-weight: 600;
}

label {
    color: #2F4728;
    font-weight: 600;
    font-size: 14px;
}

/* Footer */
footer {
    background-color: #2F4728;
    color: #ffffff;
    text-align: center;
    padding: 10px;
    position: fixed;
    width: 100%;
    bottom: 0;
    font-size: 14px;
}

/* Login Page Custom Styles */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.login-header {
    font-size: 32px;
    color: #2F4728;
    margin-bottom: 20px;
    font-weight: 700;
}

.login-header span {
    font-weight: bold;
}

.login-form {
    width: 100%;
    max-width: 400px;
    background-color: #ffffff;
    padding: 40px;
    border-radius: 12px;
    border: 1px solid #dee2e6;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.login-form input {
    margin-bottom: 20px;
    padding: 14px;
    font-size: 16px;
}

.login-form .btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
}

/* Adjustments for Mobile */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        box-shadow: none;
    }

    .main-content {
        margin-left: 0;
    }

    .login-container {
        padding: 20px;
    }

    .sidebar nav ul li a {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* Enhanced Pop-up Messages */
.popup-message {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 20px;
    background-color: #28a745;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slideIn 0.5s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 400px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.popup-message.show {
    display: block;
}

.popup-message.hide {
    animation: slideOut 0.5s ease forwards;
}

.close-button {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.close-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Alert Styles with Better Contrast */
.alert {
    border-radius: 8px;
    border: none;
    padding: 16px 20px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

/* Badge Styles */
.badge {
    font-size: 0.8em;
    font-weight: 600;
    padding: 0.5em 0.75em;
    border-radius: 6px;
}

/* Table Enhancements */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #2F4728;
    padding: 12px;
}

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

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    color: #2F4728;
}

/* Progress Bar Enhancements */
.progress {
    border-radius: 8px;
    background-color: #e9ecef;
    overflow: hidden;
}

.progress-bar {
    border-radius: 8px;
    transition: width 0.6s ease;
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Indicators */
button:focus,
input:focus,
select:focus,
textarea:focus,
a:focus {
    outline: 2px solid #2F4728;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .sidebar {
        background-color: #000;
    }

    .btn {
        background-color: #000;
        border: 2px solid #fff;
    }

    .sidebar nav ul li a.active {
        background-color: #fff;
        color: #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

    .btn,
    .sidebar nav ul li a,
    .card,
    .popup-message {
        transition: none;
    }

    .popup-message {
        animation: none;
    }
}