@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --primary-light: #7c8ef7;
    --secondary: #764ba2;
    --secondary-dark: #6b4190;
    --secondary-light: #8b5cb8;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-light: linear-gradient(135deg, #7c8ef7 0%, #8b5cb8 100%);
    --gradient-dark: linear-gradient(135deg, #5a67d8 0%, #6b4190 100%);
    --champagne: #667eea;
    --champagne-dark: #5a67d8;
    --champagne-light: #7c8ef7;
    --teal: #667eea;
    --teal-light: #7c8ef7;
    --bs-teal: #667eea;
}

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
    min-height: 100vh;
}

.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

#sidebar {
    min-width: 250px;
    max-width: 250px;
    background: var(--gradient);
    color: #fff;
    transition: all 0.3s;
    min-height: 100vh;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

#sidebar.active {
    margin-left: -250px;
}

#sidebar .sidebar-header {
    padding: 20px;
    background: var(--gradient-dark);
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#sidebar .sidebar-header .logo {
    max-width: 120px;
    margin-bottom: 10px;
}

#sidebar ul.components {
    padding: 20px 0;
}

#sidebar ul li a {
    padding: 15px 20px;
    font-size: 1.1em;
    display: block;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s;
}

#sidebar ul li a:hover,
#sidebar ul li.active > a {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 8px;
    margin: 0 10px;
    transform: translateX(5px);
}

#sidebar ul li a i {
    margin-right: 10px;
}

#sidebar ul li ul.collapse {
    padding-left: 20px;
}

#sidebar ul li ul.collapse li a {
    padding: 10px;
    font-size: 0.9em;
}

#sidebar ul li ul.collapse li.active > a {
    background: rgba(255, 255, 255, 0.2);
}

#sidebar .dropdown-toggle::after {
    float: right;
    margin-top: 8px;
}

/* Nested submenu styling */
#sidebar ul li.active > a[data-bs-toggle="collapse"] {
    background: rgba(255, 255, 255, 0.1);
}

#sidebar ul li > a[data-bs-toggle="collapse"] {
    position: relative;
}

#sidebar ul li > a[data-bs-toggle="collapse"]:after {
    content: '\f107';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

#sidebar ul li > a[data-bs-toggle="collapse"][aria-expanded="true"]:after {
    transform: translateY(-50%) rotate(180deg);
}

#content {
    width: 100%;
    padding: 0;
    min-height: 100vh;
    transition: all 0.3s;
}

.navbar {
    padding: 15px 10px;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(102, 126, 234, 0.1);
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.btn-champagne {
    background: var(--gradient);
    color: #fff;
    border: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-champagne:hover {
    background: var(--gradient-dark);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.current-time {
    font-size: 1.1em;
    color: var(--primary);
    font-weight: 500;
}

.current-time i {
    margin-right: 5px;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(102, 126, 234, 0.1);
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-header {
    background: var(--gradient);
    color: #fff;
    border-bottom: none;
    padding: 15px 20px;
    border-radius: 15px 15px 0 0;
}

.card-body {
    padding: 20px;
}

/* Table Styles */
.table-responsive {
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    box-shadow: 0 5px 25px rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.table thead th {
    background: var(--gradient);
    color: #fff;
    border: none;
    font-weight: 600;
    padding: 15px;
}

.table-hover tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* Filter Styles */
.filter-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 25px rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#advancedFilters {
    transition: all 0.3s ease-in-out;
    padding-top: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.filter-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .filter-actions {
        flex-direction: column;
    }
    
    .filter-actions .btn {
        width: 100%;
    }
}

/* Select2 Bootstrap 5 Theme Customization */
.select2-container--bootstrap-5 .select2-selection {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    min-height: 38px;
}

.select2-container--bootstrap-5 .select2-selection--single {
    background-color: #fff;
    border: 1px solid #dee2e6;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: #212529;
    line-height: 1.5;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
    height: 36px;
    position: absolute;
    top: 1px;
    right: 1px;
    width: 20px;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow b {
    border-color: #6c757d transparent transparent transparent;
}

.select2-container--bootstrap-5 .select2-dropdown {
    border-color: #dee2e6;
    border-radius: 0.375rem;
}

.select2-container--bootstrap-5 .select2-results__option--highlighted[aria-selected] {
    background-color: #0d6efd;
    color: #fff;
}

.select2-container--bootstrap-5 .select2-results__option[aria-selected=true] {
    background-color: #e9ecef;
}

/* Radio Button Groups Styling */
.btn-group-ukuran,
.btn-group-shift {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.btn-group-ukuran .btn,
.btn-group-shift .btn {
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 80px;
    text-align: center;
}

.btn-check:checked + .btn-outline-primary {
    background: var(--gradient);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.btn-check + .btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
    transition: all 0.3s ease;
}

.btn-check + .btn-outline-primary:hover {
    background: var(--gradient-light);
    border-color: var(--primary-light);
    color: white;
    transform: translateY(-1px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .btn-group-ukuran .btn,
    .btn-group-shift .btn {
        padding: 6px 12px;
        font-size: 0.9rem;
        min-width: 70px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    #sidebar {
        margin-left: -250px;
    }
    #sidebar.active {
        margin-left: 0;
    }
    #content {
        width: 100%;
        padding: 10px;
    }
    #sidebarCollapse span {
        display: none;
    }

    /* Dashboard Cards */
    .card {
        margin-bottom: 15px;
    }
    .card-body {
        padding: 15px;
    }
    .row {
        margin-right: -10px;
        margin-left: -10px;
    }
    .col-xl-3, .col-md-6, .col-xl-6, .col-lg-6 {
        padding-right: 10px;
        padding-left: 10px;
    }

    /* Typography */
    h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    .h5 {
        font-size: 1.1rem;
    }
    .text-xs {
        font-size: 0.7rem;
    }

    /* Table Styles */
    .table-responsive {
        padding: 10px;
        margin-bottom: 15px;
    }
    .table {
        font-size: 0.9rem;
    }
    .table td, .table th {
        padding: 0.5rem;
    }

    /* Icons */
    .fa-2x {
        font-size: 1.5em;
    }

    /* Mobile Button Styles */
    .btn {
        padding: 10px 15px;
        font-size: 14px;
        margin: 5px 2px;
        width: 100%;
        max-width: 300px;
        display: block;
    }

    .btn-group .btn {
        width: auto;
        display: inline-block;
    }

    .table-responsive .btn {
        padding: 6px 12px;
        font-size: 13px;
        margin: 3px 1px;
        width: auto;
        display: inline-block;
    }

    .filter-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    .filter-section .btn {
        margin-bottom: 8px;
    }
}

/* Additional Modern Styling */
.btn-primary {
    background: var(--gradient);
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--gradient-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    border: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-success:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    border: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #dd6b20 0%, #c05621 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(237, 137, 54, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    border: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 101, 101, 0.3);
}

.form-control {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-select {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Bottom Navigation Styles */
.mobile-nav {
    display: none; /* Default hidden */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1030; /* Higher than content */
    padding: 8px 0;
}

.mobile-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #666;
    text-decoration: none;
    font-size: 0.75rem;
    padding: 4px 0;
    transition: all 0.3s ease;
    position: relative;
}

.mobile-nav .nav-item i {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.mobile-nav .nav-item.active {
    color: var(--primary);
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    #sidebar {
        display: none !important;
    }
    
    #content {
        margin-left: 0 !important;
        padding-bottom: 80px !important; /* Increased space for bottom nav */
        width: 100% !important;
    }
    
    .mobile-nav {
        display: flex !important;
        justify-content: space-around;
        align-items: center;
        height: 65px;
    }
    
    .wrapper {
        padding-bottom: 65px;
    }
}

/* Active state animation */
.mobile-nav .nav-item.active i {
    transform: translateY(-2px);
    transition: transform 0.3s ease;
}

/* Touch feedback */
.mobile-nav .nav-item:active {
    opacity: 0.7;
}

/* Active indicator */
.mobile-nav .nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 25%;
    width: 50%;
    height: 3px;
    background: var(--gradient);
    border-radius: 2px;
}

/* Mobile Popup Menu */
.mobile-popup {
    display: none;
    position: fixed;
    bottom: 65px;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.5);
    height: calc(100vh - 65px);
    z-index: 1000;
}

.popup-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.popup-header h5 {
    margin: 0;
    font-weight: 600;
    color: #333;
}

.close-popup {
    border: none;
    background: none;
    padding: 5px;
    font-size: 1.2rem;
    color: #666;
    cursor: pointer;
}

.popup-body {
    max-height: 70vh;
    overflow-y: auto;
}

.popup-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 5px;
    transition: all 0.2s ease;
}

.popup-item i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

.popup-item.active {
    background: var(--gradient);
    color: white;
}

.popup-item:hover {
    background-color: #f5f5f5;
    color: var(--primary);
}

.popup-item.active:hover {
    background: var(--gradient-dark);
    color: white;
}

/* Show popup only on mobile */
@media (min-width: 769px) {
    .mobile-popup {
        display: none !important;
    }
}

#advancedFilters {
    transition: all 0.3s ease;
}

.filter-buttons-container {
    margin-top: 1rem;
}

.btn-group-merek,
.btn-group-ukuran,
.btn-group-shift {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.btn-outline-secondary.active {
    background-color: #6c757d;
    color: white;
}

/* Mobile popup menus */
.mobile-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    display: none;
}

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

.popup-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #fff;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    overflow: hidden;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.popup-header h5 {
    margin: 0;
    font-weight: 600;
}

.popup-header .close-popup {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #666;
}

.popup-body {
    padding: 10px 0;
    max-height: 70vh;
    overflow-y: auto;
}

.popup-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f5f5f5;
}

.popup-item:last-child {
    border-bottom: none;
}

.popup-item i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

.popup-item.active {
    background: var(--gradient-light);
    color: white;
    font-weight: 500;
}
