/* static/css/styles.css */

:root {
    --primary-color: #1a56db;
    --primary-hover: #1e429f;
    --navy-blue: #001f3f;
    --bg-light: #f8f9fa;
    --text-main: #333;
    --text-muted: #6b7280;
    --white: #ffffff;
}

/* General Body Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    font-size: 16px; /* Base font size for mobile readability */
}

/* Header and Navigation */
header {
    background-color: var(--navy-blue);
    color: var(--white);
    padding: 0.75rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.logo img {
    height: 40px;
    vertical-align: middle;
}

/* Mobile Nav Toggle */
.nav-toggle {
    display: none;
}

.nav-toggle-label {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

.nav-links li {
    margin-left: 1.5rem;
}

.nav-links a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
}

.nav-links a:hover {
    color: #3b82f6;
}

/* Mobile Navigation Styles */
@media (max-width: 768px) {
    .nav-toggle-label {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--navy-blue);
        padding: 1rem;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

    .nav-toggle:checked ~ .nav-links {
        display: flex;
    }

    .nav-links li {
        margin: 0.75rem 0;
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
}

/* Secondary Navigation */
.secondary-header-container {
    background-color: #333;
    width: 100%;
    overflow-x: auto; /* Allow horizontal scroll on small screens */
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.secondary-nav {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0 1rem;
}

.secondary-nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.secondary-nav-links li a {
    color: var(--white);
    text-decoration: none;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    display: block;
}

.secondary-nav-links li a.active {
    background-color: var(--primary-color);
}

/* Main Content Container */
.container {
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 1rem;
}

/* Headings */
h1, h2, h3 {
    color: var(--navy-blue);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

/* Buttons - Large touch targets */
.btn {
    display: inline-block;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    background-color: var(--primary-color);
    color: var(--white);
    text-align: center;
    font-weight: 600;
    min-width: 44px;
    min-height: 44px;
    box-sizing: border-box;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn:hover {
    background-color: var(--primary-hover);
    text-decoration: none;
}

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

/* Forms - Mobile-friendly inputs */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 0.875rem;
    margin: 0.5rem 0 1.25rem 0;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem; /* Prevents auto-zoom on iOS */
    box-sizing: border-box;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    ring: 2px solid var(--primary-color);
}

/* Footer */
footer {
    background-color: #1f2937;
    color: var(--white);
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
}

/* Utils */
.text-muted { color: var(--text-muted); }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }

/* Responsive adjustments for generic layout */
@media (max-width: 640px) {
    .container {
        padding: 0 0.75rem;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
}

/* Global Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 250px;
    background-color: var(--white);
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 4px;
    padding: 15px 20px;
    font-weight: 500;
    animation: slideIn 0.3s ease-out forwards;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toast.success { border-left-color: #10b981; }
.toast.error { border-left-color: #ef4444; }
.toast.warning { border-left-color: #f59e0b; }
.toast.info { border-left-color: #3b82f6; }

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.2rem;
    padding: 0 0 0 10px;
}

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

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background-color: var(--white);
    border-radius: 8px;
    border: 2px dashed #e5e7eb;
    color: var(--text-muted);
    margin: 1rem 0;
}

.empty-state h3 {
    color: var(--navy-blue);
    margin-bottom: 0.5rem;
}

/* Base Cards */
.card {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
    overflow: hidden;
}
.card-header {
    background-color: #f9fafb;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    color: var(--navy-blue);
}
.card-body {
    padding: 1.25rem;
}
.card-footer {
    padding: 1rem 1.25rem;
    background-color: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

/* Loading Overlay */
#global-loader {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #e5e7eb;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Standard Table Styles */
.table-responsive {
    overflow-x: auto;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
}
.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    text-align: left;
}
.table thead {
    background-color: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}
.table th {
    padding: 0.75rem 1rem;
    color: #374151;
    font-weight: 600;
}
.table td {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}
.table tbody tr {
    transition: background-color 0.15s ease;
}
.table tbody tr:hover {
    background-color: #f9fafb;
}
.table tbody tr:last-child td {
    border-bottom: none;
}
