/* Base colors for the page */
:root {
    --primary-color: #88C0B8;
    --primary-hover-color: #6FAF9A;
    --background-color: #ffffff;
    --text-color: #333333;
    --secondary-color: #0c2d48;
    --secondary-hover-color: #094072;
}

/* Dark mode colors */
[data-theme="dark"] {
    --primary-color: #1E3A8A;
    --primary-hover-color: #1D4ED8;
    --background-color: #1F2937;
    --text-color: #E5E7EB;
}

/* Global styles */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    transition: background-color 0.3s, color 0.3s;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header and Navbar Container */
.header-navbar-container {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--background-color);
}

/* Header */
.header {
    background: linear-gradient(90deg, #88C0B8, #D8E2DC);
    padding: 30px 30px; /* Adjusted padding for better layout */
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    height: 150px; /* Explicitly set a height to prevent issues */
}

.header img.logo-left, .header img.logo-right {
    height: 100px; /* Adjusted height for better fit */
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.header img.logo-left {
    left: 30px;
}

.header img.logo-right {
    right: 30px;
}

.header h1 {
    margin: 0;
    font-size: 32px; /* Adjusted font size for better responsiveness */
    color: #FFD700;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .header {
        padding: 20px 15px;
        height: 100px;
        margin-bottom: 0;
    }

    .header img.logo-left, .header img.logo-right {
        height: 60px;
    }

    .header h1 {
        font-size: 24px;
    }
}

/* Navbar Styling */
.navbar {
    background-color: #f8f9fa !important;
    border-bottom: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
    transition: all 0.3s ease;
}

.navbar .nav-link {
    color: var(--text-color) !important;
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar .nav-link:hover {
    color: var(--primary-color) !important;
}

.navbar .nav-link.active {
    color: var(--primary-color) !important;
    font-weight: 600;
}

.navbar.scrolled {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    background-color: rgba(248, 249, 250, 0.95) !important;
    backdrop-filter: blur(10px);
}

/* Fix mobile spacing: ensure navbar is flush under header */
@media (max-width: 768px) {
    .navbar {
        top: 0 !important;
        margin-top: 0 !important;
    }
}

/* Filters Section */
.filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--background-color);
    padding: 10px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0; /* Position at top when scrolling */
    z-index: 999;
    width: 100%; /* Ensure it spans the entire width */
}

.user-info {
    display: flex;
    align-items: center;
    margin-left: 20px;
}

.user-info span {
    font-size: 18px;
    color: var(--text-color);
    margin-left: 10px;
}

.logout-button {
    margin-left: 10px;
}

.filters .form-group {
    margin: 10px 20px;
}

.filters .date-picker {
    margin-left: auto;
}

@media (max-width: 1366px) {
    .filters {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters .form-group {
        width: 100%;
        margin-bottom: 10px;
    }

    .filters .date-picker {
        margin-left: 0;
    }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .header {
        padding: 20px 15px;
        height: 100px;
    }

    .header img.logo-left, .header img.logo-right {
        height: 60px;
    }

    .header h1 {
        font-size: 24px;
    }
}

/* Content Container */
.content {
    flex: 1;
    text-align: right;
    padding-top: 20px;
    padding-bottom: 70px;
    overflow-y: auto;
}

/* Factory Box */
.factory {
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.1), 0 12px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    color: inherit;
    display: block;
    height: auto;
    position: relative;
    text-align: center;
    z-index: 1;
    margin-bottom: 20px;
}

.factory:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 14px rgba(0, 0, 0, 0.2), 0 14px 28px rgba(0, 0, 0, 0.3);
}

/* Title for Totaal Vandaag */
.totaal-vandaag-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 10px 0;
    text-align: center;
    color: var(--primary-color);
}

/* Responsive Input Groups */
.responsive-input {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.responsive-input label {
    font-size: 1rem;
    flex: 1;
    text-align: right;
    margin-bottom: 0;
    margin-top: 0;
    padding: 1px;
}

.responsive-input .readonly {
    font-size: 0.8rem;
    text-align: center;
    font-weight: 600;
    margin: 0 10px;
    color: #000;
    background-color: transparent;
    border: none;
    box-shadow: none;
}

@media (max-width: 576px) {
    .responsive-input {
        flex-direction: column;
        text-align: center;
    }

    .readonly {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* Factory status */
.factory.green {
    background-color: #d4edda;
    border-color: #28a745;
}

.factory.grey {
    background-color: #f1f1f1;
    border-color: #c3c3c3;
}

.factory.red {
    background-color: #f8d7da;
    border-color: #dc3545;
}

.factory.error {
    background-color: #f8d7da;
    border-color: #dc3545;
    animation: blink 1s linear infinite;
}

@keyframes blink {
    0% {
        background-color: #f8d7da;
        border-color: #dc3545;
    }
    50% {
        background-color: #fff;
        border-color: #fff;
    }
    100% {
        background-color: #f8d7da;
        border-color: #dc3545;
    }
}

/* Popup */
.popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #ffffff;
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 8px;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.popup h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5rem;
    color: #333333;
}

.popup p {
    margin: 5px 0;
    color: #666666;
}

.popup button {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.popup button:hover {
    background-color: var(--primary-hover-color);
}

.popup.active {
    display: block;
}

/* Status bar (Sticky Footer) */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--secondary-color);
    color: white;
    padding: 10px;
    border-radius: 8px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
}

.status-bar span {
    font-weight: 500;
}

@media (max-width: 1366px) {
    .status-bar {
        font-size: 0.9rem;
    }
}

/* Responsive design for smaller screens */
@media (max-width: 576px) {
    .filters {
        flex-direction: column;
    }

    .status-bar {
        flex-direction: column;
        text-align: center;
    }
}

/* Ensure card headers have the correct background and text colors */
.card-header.bg-primary {
    background-color: var(--primary-color) !important;
    color: #ffffff !important;
}

.card-header.bg-warning {
    background-color: #ffc107 !important; /* Bootstrap's warning color */
    color: #ffffff !important;
}

.card-header.bg-danger {
    background-color: #dc3545 !important; /* Bootstrap's danger color */
    color: #ffffff !important;
}

.card-header.bg-success {
    background-color: #28a745 !important; /* Bootstrap's success color */
    color: #ffffff !important;
}

.card-header.bg-secondary {
    background-color: var(--secondary-color) !important;
    color: #ffffff !important;
}

/* Responsive utilities to prevent horizontal overflow on mobile */
img, video {
    max-width: 100%;
    height: auto;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

/* Automatically wrap any table in responsive behavior on small screens */
@media (max-width: 768px) {
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}
