/* style.css - Custom CSS for Dark UI */

/* CSS Variables for Colors */
:root {
    --bg-dark: #1a202c;
    --bg-card: #2d3748;
    --bg-navbar: #000000;
    --text-light: #e2e8f0;
    --text-medium: #a0aec0;
    --text-dark: #4a5568;
    --border-color: #4a5568;
    --focus-color: #63b3ed; /* Cyan-400 */
    --primary-color: #4299e1; /* Blue-500 */
    --primary-hover: #3182ce; /* Blue-600 */
    --success-color: #48bb78; /* Green-500 */
    --success-hover: #38a169; /* Green-600 */
    --danger-color: #ef4444; /* Red-500 */
    --danger-hover: #dc2626; /* Red-600 */
    --secondary-color: #a0aec0; /* Gray-400 */
    --secondary-hover: #718096; /* Gray-500 */
    --message-info-bg: #2b6cb0;
    --message-info-border: #3182ce;
    --message-error-bg: #c53030;
    --message-error-border: #e53e3e;
}

/* Global Styles */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container for full-width content */
.container {
    width: 100%;
    background-color: var(--bg-card);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 2rem;
    margin: 0;
    border-radius: 0; /* Sharp corners */
}

/* Specific styling for cards/sections within containers */
.card-section {
    background-color: var(--bg-dark);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
    border-radius: 0; /* Sharp corners */
    border: 1px solid var(--border-color);
}

/* Input, Select, Textarea Field Styles */
.input-field {
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-light);
    padding: 0.75rem;
    width: 100%;
    font-size: 1rem;
    transition: border-color 0.2s, background-color 0.2s;
    border-radius: 0; /* Sharp corners */
    -webkit-appearance: none; /* Remove default select arrow for WebKit */
    -moz-appearance: none; /* Remove default select arrow for Mozilla */
    appearance: none; /* Remove default select arrow */
}

.input-field:focus {
    outline: none;
    border-color: var(--focus-color);
    box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.5); /* Focus ring */
}

/* Custom select arrow for dark theme */
select.input-field {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3e%3cpath fill='%23e2e8f0' d='M6 8l4 4 4-4H6z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem; /* Space for the custom arrow */
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: none;
    text-decoration: none;
    border-radius: 0; /* Sharp corners */
}

.btn-primary {
    background-color: var(--primary-color);
    color: #ffffff;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px -1px rgba(0, 0, 0, 0.15), 0 3px 5px -1px rgba(0, 0, 0, 0.08);
}

.btn-success {
    background-color: var(--success-color);
    color: #ffffff;
}
.btn-success:hover {
    background-color: var(--success-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px -1px rgba(0, 0, 0, 0.15), 0 3px 5px -1px rgba(0, 0, 0, 0.08);
}

.btn-danger {
    background-color: var(--danger-color);
    color: #ffffff;
}
.btn-danger:hover {
    background-color: var(--danger-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px -1px rgba(0, 0, 0, 0.15), 0 3px 5px -1px rgba(0, 0, 0, 0.08);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--bg-card);
}
.btn-secondary:hover {
    background-color: var(--secondary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px -1px rgba(0, 0, 0, 0.15), 0 3px 5px -1px rgba(0, 0, 0, 0.08);
}

/* Navbar styles */
.navbar {
    background-color: var(--bg-navbar);
    color: var(--text-light);
    padding: 1rem 2rem;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.navbar .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.navbar a, .navbar button {
    color: var(--text-light);
    padding: 0.75rem 1rem;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
    border-radius: 0; /* Sharp corners for nav links */
    font-weight: 500;
    background: none; /* Ensure buttons don't have default background */
}

.navbar a:hover, .navbar button:hover {
    background-color: var(--border-color);
    color: #ffffff;
}

/* Table styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-light);
}

th {
    background-color: var(--bg-dark);
    font-weight: 600;
    color: var(--text-medium);
    text-transform: uppercase;
    font-size: 0.875rem;
}

tr:last-child td {
    border-bottom: none;
}

/* Message Box Styles */
.message-box {
    background-color: var(--message-info-bg);
    color: #ffffff;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
    border-radius: 0; /* Sharp corners */
    border: 1px solid var(--message-info-border);
}

.message-box.error {
    background-color: var(--message-error-bg);
    color: #ffffff;
    border: 1px solid var(--message-error-border);
}

.message-box button {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: inherit;
    padding: 0.25rem;
    border-radius: 0; /* Sharp corners */
    transition: background-color 0.2s;
}

.message-box button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Loading Spinner */
.loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-left-color: var(--focus-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin: auto; /* Center spinner */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Specific adjustments for dashboard loading card */
.loading-card {
    background-color: var(--bg-card);
    border-radius: 0; /* Sharp corners */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    color: var(--text-light);
}

/* Chart.js specific styles (if needed) */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
    margin-top: 2rem;
    background-color: var(--bg-dark);
    padding: 1rem;
    border-radius: 0; /* Sharp corners */
    border: 1px solid var(--border-color);
}

/* Print styles for export.html */
@media print {
    .page-break {
        page-break-after: always;
    }
    body {
        background-color: #ffffff;
        color: #000000;
    }
    .navbar, .btn, .card-section, .message-box {
        display: none;
    }
    .container {
        box-shadow: none;
        padding: 0;
        margin: 0;
        background-color: #ffffff;
        color: #000000;
    }
    table, th, td {
        border-color: #e2e8f0;
        color: #000000;
        background-color: #ffffff;
    }
    th {
        background-color: #f0f0f0;
        color: #000000;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
    }
    .navbar .nav-links {
        margin-top: 1rem;
        flex-direction: column;
        width: 100%;
    }
    .navbar a, .navbar button {
        width: 100%;
        text-align: left;
    }
    /* Grid adjustments for smaller screens */
    .grid-2-col-md {
        grid-template-columns: 1fr;
    }
    .grid-3-col-md {
        grid-template-columns: 1fr;
    }
    .col-span-md-2 {
        grid-column: auto;
    }
    .w-full-md {
        width: 100%;
    }
}

/* Generic grid classes to replace Tailwind's grid system */
.grid-cols-1 { display: grid; grid-template-columns: 1fr; }
.grid-cols-2 { display: grid; grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { display: grid; grid-template-columns: repeat(4, 1fr); }
.gap-4 { gap: 1rem; } /* 16px */
.gap-8 { gap: 2rem; } /* 32px */

/* Generic spacing classes */
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

/* Widths */
.w-full { width: 100%; }
.max-w-md { max-width: 28rem; } /* 448px */
.max-w-xl { max-width: 36rem; } /* 576px */
.max-w-4xl { max-width: 56rem; } /* 896px */
.max-w-7xl { max-width: 80rem; } /* 1280px */

/* Text alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }

/* Font sizes and weights */
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }
.text-6xl { font-size: 3.75rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.font-extrabold { font-weight: 800; }

/* Display and positioning */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.block { display: block; }
.hidden { display: none; }
.overflow-x-auto { overflow-x: auto; }

/* Other utilities */
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }
.shadow-inner { box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06); }
.transition { transition-property: all; transition-duration: 150ms; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
.transform { transform: var(--tw-transform); }
.hover\:scale-105:hover { transform: scale(1.05); }
.opacity-90 { opacity: 0.9; }
.antialiased { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.leading-tight { line-height: 1.25; }

/* Specific styles for login page */
.login-body {
    background-color: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

/* Media queries for responsiveness */
@media (min-width: 640px) { /* sm breakpoint */
    .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
    .sm\:text-5xl { font-size: 3rem; }
    .sm\:text-xl { font-size: 1.25rem; }
    .sm\:flex-row { flex-direction: row; }
}

@media (min-width: 768px) { /* md breakpoint */
    .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .md\:col-span-2 { grid-column: span 2 / span 2; }
    .md\:w-auto { width: auto; }
    .md\:mb-0 { margin-bottom: 0; }
    .md\:justify-between { justify-content: space-between; }
    .md\:items-center { align-items: center; }
}

@media (min-width: 1024px) { /* lg breakpoint */
    .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
    .lg\:text-6xl { font-size: 3.75rem; }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Print styles for page breaks */
@media print {
  .page-break {
    page-break-after: always;
  }
}
