
/* Dark Theme */
[data-theme="dark"] {
  --color-base-100: oklch(14% 0 0);
  --color-base-200: oklch(20% 0 0);
  --color-base-300: oklch(26% 0 0);
  --color-base-content: oklch(97% 0 0);
  --color-primary: oklch(86% 0.005 56.366);
  --color-primary-content: oklch(14% 0.004 49.25);
  --color-secondary: oklch(0% 0 0);
  --color-secondary-content: oklch(100% 0 0);
  --color-accent: oklch(86% 0.022 252.894);
  --color-accent-content: oklch(12% 0.042 264.695);
  --color-neutral: oklch(43% 0 0);
  --color-neutral-content: oklch(98% 0 0);
  --color-info: oklch(78% 0.154 211.53);
  --color-info-content: oklch(30% 0.056 229.695);
  --color-success: oklch(79% 0.209 151.711);
  --color-success-content: oklch(26% 0.065 152.934);
  --color-warning: oklch(82% 0.189 84.429);
  --color-warning-content: oklch(27% 0.077 45.635);
  --color-error: oklch(70% 0.191 22.216);
  --color-error-content: oklch(25% 0.092 26.042);
}

/* Futuristic Light Theme */
[data-theme="light"] {
  --color-base-100: oklch(98% 0.01 210);
  --color-base-200: oklch(95% 0.02 220);
  --color-base-300: oklch(90% 0.03 225);
  --color-base-content: oklch(25% 0.05 240);
  --color-primary: oklch(65% 0.25 270);
  --color-primary-content: oklch(98% 0.01 270);
  --color-secondary: oklch(75% 0.18 180);
  --color-secondary-content: oklch(20% 0.05 180);
  --color-accent: oklch(70% 0.22 320);
  --color-accent-content: oklch(98% 0.01 320);
  --color-neutral: oklch(85% 0.05 240);
  --color-neutral-content: oklch(25% 0.05 240);
  --color-info: oklch(70% 0.20 200);
  --color-info-content: oklch(98% 0.01 200);
  --color-success: oklch(70% 0.18 140);
  --color-success-content: oklch(98% 0.01 140);
  --color-warning: oklch(75% 0.20 50);
  --color-warning-content: oklch(20% 0.05 50);
  --color-error: oklch(65% 0.22 15);
  --color-error-content: oklch(98% 0.01 15);
}

/* Custom styles for JABNET with Tailwind CSS and DaisyUI */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Custom animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Custom hover effects */
.hover-lift:hover {
    transform: translateY(-2px);
    transition: transform 0.3s ease;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: oklch(var(--b2));
}

::-webkit-scrollbar-thumb {
    background: oklch(var(--p));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: oklch(var(--pf));
}

/* Table column specific styles for better spacing */
.col-id { min-width: 80px; }
.col-nama { min-width: 150px; }
.col-telepon { min-width: 120px; }
.col-status { min-width: 100px; }
.col-kecamatan { min-width: 120px; }
.col-kelurahan { min-width: 120px; }
.col-sn { min-width: 150px; }
.col-olt { min-width: 80px; }
.col-jenis_onu { min-width: 100px; }
.col-mitra { min-width: 100px; }
.col-odp { min-width: 100px; }
.col-port_odp { min-width: 90px; }
.col-vip { min-width: 60px; }
.col-latitude { min-width: 100px; }
.col-longitude { min-width: 100px; }
.col-alamat { min-width: 200px; }
.col-email { min-width: 150px; }
.col-paket { min-width: 150px; }
.col-jatuh_tempo { min-width: 100px; }
.col-isolir { min-width: 100px; }
.col-slot { min-width: 60px; }
.col-pon { min-width: 60px; }
.col-ont_index { min-width: 90px; }
.col-tempat_lahir { min-width: 120px; }
.col-tanggal_lahir { min-width: 120px; }
.col-nik { min-width: 120px; }
.col-username_pppoe { min-width: 120px; }
.col-bulan_aktivasi { min-width: 120px; }
.col-aksi { min-width: 100px; }

/* Custom gradient backgrounds */
.gradient-primary {
    background: linear-gradient(135deg, oklch(var(--p)), oklch(var(--s)));
}

.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Improve modal backdrop */
.modal-backdrop {
    backdrop-filter: blur(4px);
}

/* Custom table styles */
.table th {
    font-weight: 600;
    letter-spacing: 0.025em;
}

/* Loading animation enhancement */
.loading-enhanced {
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive improvements */
@media (max-width: 768px) {
    .col-alamat,
    .col-email,
    .col-paket,
    .col-jatuh_tempo,
    .col-isolir,
    .col-odp,
    .col-port_odp,
    .col-latitude,
    .col-longitude,
    .col-slot,
    .col-pon,
    .col-ont_index,
    .col-tempat_lahir,
    .col-tanggal_lahir,
    .col-nik,
    .col-username_pppoe,
    .col-bulan_aktivasi {
        display: none;
    }
}

/* Enhanced focus states */
.input:focus,
.select:focus,
.textarea:focus {
    outline: 2px solid oklch(var(--p));
    outline-offset: 2px;
}

/* Custom button hover effects */
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Enhanced stat cards */
.stat {
    border-radius: 1rem;
    transition: all 0.3s ease;
}

.stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Screen reader only content */
.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;
}

/* Enhanced Filter Dropdown Styles */
.dropdown {
    position: relative;
    z-index: 50;
}

.dropdown .dropdown-content {
    animation: slideDown 0.2s ease-out;
    background-color: oklch(var(--b1)) !important;
    opacity: 1 !important;
    border: 1px solid oklch(var(--bc) / 0.2);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 9999 !important;
    position: absolute;
    pointer-events: auto !important;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Filter dropdown button styles */
.dropdown [role="button"] {
    transition: all 0.2s ease;
    min-height: 2.25rem;
}

/* Filter dropdown button min-height for larger screens */
@media (min-width: 1024px) {
    .dropdown [role="button"] {
        min-height: 2.5rem;
    }
}

.dropdown [role="button"]:hover {
    background-color: oklch(var(--b2));
    border-color: oklch(var(--p));
}

.dropdown [role="button"]:focus {
    outline: 2px solid oklch(var(--p));
    outline-offset: 2px;
}

/* Filter search input styles */
.dropdown-content .input {
    background-color: oklch(var(--b1));
    border: 1px solid oklch(var(--bc) / 0.2);
    transition: border-color 0.2s ease;
    min-height: 2.25rem;
    padding: 0.5rem 0.75rem;
}

/* Filter search input min-height for larger screens */
@media (min-width: 1024px) {
    .dropdown-content .input {
        min-height: 2.5rem;
    }
}

.dropdown-content .input:focus {
    border-color: oklch(var(--p));
    outline: none;
    box-shadow: 0 0 0 3px oklch(var(--p) / 0.1);
}

/* Filter option list styles */
.dropdown-content ul {
    border-radius: 0.5rem;
    background-color: oklch(var(--b1)) !important;
    opacity: 1 !important;
}

.dropdown-content ul li {
    background-color: transparent;
}

.dropdown-content ul li a {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.5rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    background-color: transparent;
}

.dropdown-content ul li a:hover {
    background-color: oklch(var(--p) / 0.1) !important;
    color: oklch(var(--pc));
    transform: translateX(2px);
}

.dropdown-content ul li a:active {
    background-color: oklch(var(--p) / 0.2) !important;
}

/* Filter dropdown content max height and scrolling */
.dropdown-content ul {
    max-height: 24rem; /* 384px - match with max-h-96 in HTML */
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: oklch(var(--p)) oklch(var(--b2));
    background-color: oklch(var(--b1)) !important;
}

/* Increase max-height for filter dropdowns specifically */
.collapse-content .dropdown-content ul {
    max-height: 30rem; /* 480px - much more space for filter options */
}

/* Ensure dropdown menu has solid background */
.dropdown-content .menu {
    background-color: oklch(var(--b1)) !important;
    opacity: 1 !important;
}

/* Prevent click-through when filter dropdown is open */
.dropdown:focus-within {
    z-index: 9998;
}

/* Light theme specific fixes for filter dropdowns */
[data-theme="light"] .dropdown .dropdown-content {
    background-color: oklch(var(--b1)) !important;
    box-shadow: 0 10px 25px rgba(100, 126, 234, 0.2), 0 0 0 1px oklch(var(--bc) / 0.1) !important;
}

[data-theme="light"] .dropdown-content .menu,
[data-theme="light"] .dropdown-content ul {
    background-color: oklch(var(--b1)) !important;
}

/* Enhanced filter button text truncation */
.dropdown [role="button"] span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: calc(100% - 24px);
}

/* Filter button icon styles */
.dropdown [role="button"] i {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.dropdown[open] [role="button"] i {
    transform: rotate(180deg);
}

/* Filter search placeholder enhancement */
.dropdown-content .input::placeholder {
    color: oklch(var(--bc) / 0.6);
    font-style: italic;
}

/* Enhanced focus states for accessibility */
.dropdown-content ul li a:focus {
    outline: 2px solid oklch(var(--p));
    outline-offset: -2px;
    background-color: oklch(var(--p) / 0.1);
}

/* Active filter indicator */
.dropdown [role="button"].filter-active {
    background-color: oklch(var(--p) / 0.1);
    border-color: oklch(var(--p));
    color: oklch(var(--p));
}

/* Filter dropdown responsive improvements */
@media (max-width: 768px) {
    .dropdown-content {
        width: 100% !important;
        min-width: unset !important;
        left: 0 !important;
        right: 0 !important;
    }

    .dropdown-content ul {
        max-height: 250px;
    }

    .dropdown-content ul li a {
        padding: 1rem;
        min-height: 3rem;
        font-size: 1rem;
    }
}

/* Ensure dropdown-end positioning works correctly */
.dropdown-end .dropdown-content {
    right: 0;
    left: auto;
}

/* Map styles */
#map {
    width: 100%;
    height: 500px;
    min-height: 500px;
    border-radius: 0.5rem;
}

/* Tab content transition */
.tab-content {
    transition: opacity 0.3s ease-in-out;
}

/* Ensure map renders properly when tab becomes visible */
.leaflet-container {
    z-index: 1;
}

/* Theme transition */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme toggle button animations */
#themeToggle {
    transition: transform 0.3s ease;
}

#themeToggle:hover {
    transform: scale(1.1);
}

#themeIcon {
    transition: transform 0.5s ease;
}

/* Futuristic light theme specific styles */
[data-theme="light"] .gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

[data-theme="light"] .gradient-primary {
    background: linear-gradient(135deg, oklch(var(--p)), oklch(var(--s)));
}

/* Light theme shadows for depth */
[data-theme="light"] .card {
    box-shadow: 0 10px 25px rgba(100, 126, 234, 0.1);
}

[data-theme="light"] .btn {
    box-shadow: 0 2px 8px rgba(118, 75, 162, 0.1);
}

/* Light theme enhanced table styling */
[data-theme="light"] .table th {
    background: linear-gradient(135deg, oklch(var(--p) / 0.1), oklch(var(--s) / 0.1));
    border-bottom: 2px solid oklch(var(--p) / 0.3);
}

/* Light theme input focus glow */
[data-theme="light"] .input:focus,
[data-theme="light"] .select:focus,
[data-theme="light"] .textarea:focus {
    box-shadow: 0 0 0 3px oklch(var(--p) / 0.2), 0 0 20px oklch(var(--p) / 0.1);
}

/* Required field label styling */
.label-text-required::after {
    content: " *";
    color: #ef4444;
    font-weight: 600;
}

/* Fix filter dropdown overlap with table */
.card-body > section {
    position: relative;
    overflow: visible !important;
}

/* Ensure filter section stays above table */
.card-body > section:has(.collapse) {
    z-index: 100;
    position: relative;
    overflow: visible !important;
}

/* Table section should not overlap filters */
.overflow-x-auto {
    position: relative;
    z-index: 1;
    overflow-x: auto;
    overflow-y: visible;
}

/* Main app wrapper should not clip content */
#mainApp {
    overflow: visible !important;
}

main {
    overflow: visible !important;
}

/* Article card should not clip dropdown */
article.card {
    overflow: visible !important;
}

/* Card sections should not clip content */
.card > .card-body {
    overflow: visible !important;
}

.card .card-body > section {
    overflow: visible !important;
}

/* Ensure dropdowns in filter section are always on top */
.collapse-content {
    overflow: visible !important;
}

.collapse-content .dropdown {
    z-index: 100;
    position: relative;
}

.collapse-content .dropdown .dropdown-content {
    z-index: 9999 !important;
    position: absolute !important;
}

/* Ensure collapse doesn't clip dropdown content */
.collapse.collapse-open {
    overflow: visible !important;
}

.collapse .collapse-content {
    overflow: visible !important;
}

/* Filter section should not have height restrictions */
.collapse.collapse-open .collapse-content {
    max-height: none !important;
    height: auto !important;
}

/* Ensure filter dropdowns can expand beyond section boundaries */
.bg-base-200:has(.collapse) {
    overflow: visible !important;
}

/* Filter section parent should allow overflow */
section:has(.collapse) {
    overflow: visible !important;
}

/* Card body should allow dropdown overflow */
.card-body {
    overflow: visible !important;
}

/* Specific fix for filter grid container */
.collapse-content > div {
    overflow: visible !important;
}

/* Fix dropdown transparency issue in modal forms */
.modal-box .dropdown {
    position: relative;
    z-index: 50;
}

.modal-box .dropdown-content {
    background-color: oklch(var(--b1)) !important;
    opacity: 1 !important;
    z-index: 9999 !important;
    position: absolute;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3) !important;
    border: 1px solid oklch(var(--bc) / 0.2);
    pointer-events: auto !important;
}

/* Ensure dropdown menu items have solid background */
.modal-box .dropdown-content .menu {
    background-color: oklch(var(--b1)) !important;
    opacity: 1 !important;
}

.modal-box .dropdown-content ul {
    background-color: oklch(var(--b1)) !important;
    opacity: 1 !important;
}

.modal-box .dropdown-content ul li {
    background-color: transparent;
}

.modal-box .dropdown-content ul li a {
    background-color: transparent;
}

.modal-box .dropdown-content ul li a:hover {
    background-color: oklch(var(--p) / 0.1) !important;
}

/* Prevent click-through when dropdown is open */
.modal-box .dropdown:focus-within {
    z-index: 9998;
}

/* Add backdrop effect to prevent clicks on elements below */
.modal-box .dropdown[open]::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9997;
    pointer-events: none;
}

/* Light theme specific fixes for modal dropdowns */
[data-theme="light"] .modal-box .dropdown-content {
    background-color: oklch(var(--b1)) !important;
    box-shadow: 0 10px 25px rgba(100, 126, 234, 0.2), 0 0 0 1px oklch(var(--bc) / 0.1) !important;
}

[data-theme="light"] .modal-box .dropdown-content .menu,
[data-theme="light"] .modal-box .dropdown-content ul {
    background-color: oklch(var(--b1)) !important;
}
