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

:root {
    /* Light Mode (default) */
    --bg-color: #f0f4f9;
    --card-bg: #ffffff;
    --card-border: #e3e3e3;
    --primary-color: #0b57d0;
    --primary-glow: rgba(11, 87, 208, 0.08);
    --accent-color: #1a73e8;
    --text-main: #1f1f1f;
    --text-muted: #5f6368;
    
    --success: #137333;
    --warning: #b06000;
    --danger: #c5221f;
    --pending: #0b57d0;
}

:root.dark-mode {
    /* Dark Mode */
    --bg-color: #131314;
    --card-bg: #1e1e20;
    --card-border: #2e3032;
    --primary-color: #a8c7fa;
    --primary-glow: rgba(168, 199, 250, 0.15);
    --accent-color: #d3e3fd;
    --text-main: #e3e3e3;
    --text-muted: #c4c7c5;
    
    --success: #34d399;
    --warning: #f59e0b;
    --danger: #f87171;
    --pending: #a8c7fa;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 50% 100%, rgba(194, 231, 255, 0.45) 0%, transparent 60%);
    background-attachment: fixed;
    transition: background-color 0.3s, color 0.3s;
}

:root.dark-mode body {
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(155, 114, 203, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(66, 133, 244, 0.04) 0%, transparent 50%);
}

/* Sidebar & Main Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--bg-color);
    border-right: 1px solid var(--card-border);
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 10;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s, border-color 0.3s;
}

:root.dark-mode .sidebar {
    background: #1e1e20;
}

.logo-section {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    background: linear-gradient(90deg, #4285f4, #9b72cb, #d96570);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-section span {
    margin-left: 2px;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-item.active a {
    color: #041e49;
    background: #d3e3fd;
    font-weight: 600;
}

:root.dark-mode .nav-item.active a {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.nav-item a:hover {
    color: var(--text-main);
    background: #e8f0fe;
}

:root.dark-mode .nav-item a:hover {
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
}

.logout-btn {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid rgba(197, 34, 31, 0.2);
    color: #c5221f;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(197, 34, 31, 0.05);
}

/* Main Content Section */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 40px;
    max-width: 100%;
}

header.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.header-title h1 {
    font-size: 28px;
    font-weight: 600;
}

.header-title p {
    color: var(--text-muted);
    margin-top: 4px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--card-border);
}

/* Cards & Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 24px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-title {
    color: var(--text-muted);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-top: 10px;
    color: var(--text-main);
}

/* Table Card & Filter Bar */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    overflow: hidden;
    margin-bottom: 30px;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.search-bar {
    position: relative;
    width: 300px;
}

.search-bar input {
    width: 100%;
    padding: 10px 20px;
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 20px;
    color: var(--text-main);
    outline: none;
    transition: all 0.3s ease;
}

.search-bar input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-glow);
}

.filter-group {
    display: flex;
    gap: 10px;
}

.filter-select {
    padding: 8px 16px;
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 20px;
    color: var(--text-main);
    outline: none;
    cursor: pointer;
}

/* Beautiful Custom Tables */
.table-responsive {
    overflow-x: auto;
}

table.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    table-layout: fixed; /* Ensures column widths align identically across different tables */
}

table.custom-table th {
    padding: 16px 24px;
    background: #f8fafd;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid var(--card-border);
    text-align: left; /* Explicitly align all table headers to left for consistent layout formatting */
}

:root.dark-mode table.custom-table th {
    background: rgba(255, 255, 255, 0.02);
}

table.custom-table td {
    padding: 18px 24px;
    border-bottom: 1px solid var(--card-border);
    font-size: 15px;
    color: var(--text-main);
}

table.custom-table tbody tr {
    transition: background 0.3s ease;
    cursor: pointer;
}

table.custom-table tbody tr:hover {
    background: rgba(11, 87, 208, 0.04);
}

table.custom-table tbody tr.alert-row {
    background: #fef7e0;
}

table.custom-table tbody tr.alert-row:hover {
    background: #feefc3;
}

:root.dark-mode table.custom-table tbody tr.alert-row {
    background: rgba(245, 158, 11, 0.06);
}

:root.dark-mode table.custom-table tbody tr.alert-row:hover {
    background: rgba(245, 158, 11, 0.12);
}

table.custom-table tbody tr.alert-row td:first-child {
    border-left: 3px solid var(--warning);
}

/* Overdue Passed Date Rows */
table.custom-table tbody tr.overdue-row {
    background: #fee2e2 !important; /* solid prominent red */
}

table.custom-table tbody tr.overdue-row:hover {
    background: #fecaca !important;
}

:root.dark-mode table.custom-table tbody tr.overdue-row {
    background: rgba(220, 38, 38, 0.25) !important;
}

:root.dark-mode table.custom-table tbody tr.overdue-row:hover {
    background: rgba(220, 38, 38, 0.35) !important;
}

table.custom-table tbody tr.overdue-row td {
    color: #991b1b !important;
    font-weight: 500;
}

table.custom-table tbody tr.overdue-row td:first-child {
    border-left: 5px solid #dc2626;
}


.case-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.case-link:hover {
    text-decoration: underline;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-court_case {
    background: rgba(168, 199, 250, 0.15);
    color: var(--primary-color);
    border: 1px solid rgba(168, 199, 250, 0.2);
}

.badge-land_record {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.status-indicator {
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

.status-active { background: rgba(52, 211, 153, 0.12); color: var(--success); }
.status-pending { background: rgba(245, 158, 11, 0.12); color: var(--warning); }
.status-danger { background: rgba(248, 113, 113, 0.12); color: var(--danger); }

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 15, 15, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.modal-container {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
    color: var(--text-main);
}

/* Grouped Table Section Banner */
.table-section-title {
    padding: 16px 24px;
    border-bottom: 1px solid var(--card-border);
    background: #e8f0fe;
    margin-top: 24px;
    transition: background-color 0.3s, border-color 0.3s;
}

:root.dark-mode .table-section-title {
    background: rgba(255, 255, 255, 0.02);
}

.table-section-title h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-overlay.open {
    display: flex;
    opacity: 1;
}

.modal-overlay.open .modal-container {
    transform: scale(1);
}

.modal-header {
    padding: 24px 30px;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.case-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.detail-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    padding: 16px;
    border-radius: 12px;
}

.detail-label {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.detail-value {
    font-size: 16px;
    font-weight: 600;
    margin-top: 6px;
}

/* Tabs */
.tab-container {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    gap: 20px;
}

/* World-Class segmented tab control bar */
.filter-group {
    display: flex;
    background: #f1f3f4;
    padding: 6px;
    border-radius: 16px;
    border: 2px solid #e0e0e0;
    gap: 8px;
    align-items: center;
    transition: background-color 0.3s, border-color 0.3s;
}

:root.dark-mode .filter-group {
    background: #1f1f20;
    border-color: #2e3032;
}

.tab-btn {
    padding: 14px 28px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.3px;
    cursor: pointer;
    border-radius: 12px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: none;
    border: 2px solid transparent;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-btn i {
    font-size: 19px;
    opacity: 0.95;
    transition: transform 0.25s ease;
}

.tab-btn:hover {
    color: var(--text-main);
    background: #e8eaed;
}

.tab-btn:hover i {
    transform: translateY(-1px);
}

:root.dark-mode .tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Active tab style with world-class premium highlights */
.tab-btn.active {
    color: #ffffff !important;
    background: linear-gradient(135deg, #1a73e8, #0b57d0);
    box-shadow: 0 8px 20px rgba(11, 87, 208, 0.35);
    border-color: rgba(255, 255, 255, 0.1);
}

.tab-btn.active i {
    color: #ffffff !important;
}

:root.dark-mode .tab-btn.active {
    color: #0b57d0 !important;
    background: #a8c7fa;
    box-shadow: 0 8px 24px rgba(168, 199, 250, 0.3);
    border-color: rgba(0, 0, 0, 0.15);
}

:root.dark-mode .tab-btn.active i {
    color: #0b57d0 !important;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Action button */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    box-shadow: 0 0 20px rgba(168, 199, 250, 0.4);
    transform: translateY(-1px);
}

/* Landing / Login Page Split Styling */
.login-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.landing-left {
    flex: 1.2;
    background: linear-gradient(135deg, #f0f4f9, #ffffff), 
                radial-gradient(circle at 30% 30%, rgba(194, 231, 255, 0.3) 0%, transparent 60%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 80px;
    border-right: 1px solid var(--card-border);
}

.landing-right {
    flex: 0.8;
    background: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.landing-right::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(11, 87, 208, 0.04) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(11, 87, 208, 0.06);
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
    width: fit-content;
    border: 1px solid rgba(11, 87, 208, 0.12);
}

.landing-title {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
    color: #1f1f1f;
}

.landing-title span {
    color: var(--primary-color);
}

.landing-subtitle {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 40px;
    line-height: 1.6;
    max-width: 500px;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.feature-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.feature-icon-wrapper {
    width: 42px;
    height: 42px;
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 18px;
    flex-shrink: 0;
}

.feature-text h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #1f1f1f;
}

.feature-text p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.4;
}

.login-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 40px;
    border-radius: 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.05);
    z-index: 1;
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
    color: #1f1f1f;
}

/* Responsive adjustments for landing page */
@media (max-width: 992px) {
    .login-wrapper {
        flex-direction: column;
    }
    .landing-left {
        padding: 40px;
        flex: none;
        border-right: none;
        border-bottom: 1px solid var(--card-border);
    }
    .landing-right {
        flex: 1;
        padding: 40px 20px;
    }
    .landing-title {
        font-size: 32px;
    }
}


.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 20px;
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 20px;
    color: var(--text-main);
    outline: none;
    transition: all 0.3s ease;
}

.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Uploader Dropzone */
.dropzone {
    border: 2px dashed rgba(11, 87, 208, 0.3);
    background: rgba(11, 87, 208, 0.02);
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 24px;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--primary-color);
    background: rgba(11, 87, 208, 0.05);
}

.dropzone-icon {
    font-size: 40px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.dropzone-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-main);
}

.dropzone-subtext {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Mobile responsive layout to hide sidebar */
@media (max-width: 992px) {
    .sidebar {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 20px 15px !important;
    }
    header.content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

.alert-urgent {
    border-color: rgba(185, 28, 28, 0.4) !important;
    background: rgba(185, 28, 28, 0.05) !important;
}
.blink-animation {
    animation: text-blink 1s ease-in-out infinite alternate;
}
@keyframes text-blink {
    0% { opacity: 0.15; }
    100% { opacity: 1; }
}
.blink-rapid {
    animation: text-blink-rapid 3s ease-in-out infinite;
}
@keyframes text-blink-rapid {
    0%, 90% { opacity: 1; }
    95% { opacity: 0; }
    100% { opacity: 1; }
}

/* Collapsible sidebar layout transitions */
.sidebar {
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s, border-color 0.3s;
}
.main-content {
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s;
}
body.sidebar-collapsed .sidebar, html.sidebar-collapsed-init .sidebar {
    left: -260px !important;
}
body.sidebar-collapsed .main-content, html.sidebar-collapsed-init .main-content {
    margin-left: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
}
