@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-blue: #0f172a;
    --accent-blue: #3b82f6;
    --accent-gold: #fbbf24;
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --success: #22c55e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* In-Drawer UI Fix: Remove top padding when navbar is hidden */
body.in-drawer .tencode-container {
    padding-top: 2rem !important;
}

body.in-drawer .search-container {
    top: 0 !important;
}

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at top right, #1e293b, #0f172a);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* Background Elements */
.bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    pointer-events: none;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    display: flex;
    justify-content: center;
}

/* Glassmorphism Card */
.officer-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.3s ease;
}

.officer-card:hover {
    transform: translateY(-5px);
}

/* Department Branding */
.dept-header {
    margin-bottom: 2rem;
}

.dept-title {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent-blue);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.dept-seal {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-blue);
    font-weight: bold;
    font-size: 2rem;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.dept-seal img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Officer Info */
.officer-badge {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: inline-block;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.officer-name {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.officer-rank {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.officer-description {
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-size: 1rem;
}

/* Action Section */
.status-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    border-top: 1px solid var(--glass-border);
    padding-top: 2rem;
}

.btn-duty {
    background: linear-gradient(135deg, var(--accent-blue), #2563eb);
    color: white;
    border: none;
    padding: 1rem 3rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-duty:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(37, 99, 235, 0.4);
    filter: brightness(1.1);
}

.btn-duty.red-state {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 10px 15px -3px rgba(220, 38, 38, 0.3);
}

.btn-duty.red-state:hover {
    box-shadow: 0 20px 25px -5px rgba(220, 38, 38, 0.4);
}

.status-indicator {
    width: 10px;
    height: 10px;
    background-color: #fff;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.time-display {
    text-align: center;
}

.current-time {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
    margin-bottom: 0.25rem;
}

.current-date {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(255, 255, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

.officer-name {
    font-size: 2rem;
}


/* Navigation Header Styles */
.main-header {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}

.nav-logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.1em;
}

.logo-subtitle {
    font-size: 0.75rem;
    color: var(--accent-blue);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Sidebar Navigation Styles */
.nav-sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100vh;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 200;
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border-right: 1px solid var(--glass-border);
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
}

.nav-sidebar.active {
    left: 0;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-header {
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-branding {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--text-primary);
}

.sidebar-branding img {
    width: 32px;
    height: 32px;
}

.close-sidebar {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s;
}

.close-sidebar:hover {
    color: #ef4444;
}

.sidebar-links {
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-divider {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent-blue);
    margin: 1.5rem 1rem 0.5rem;
    letter-spacing: 0.1em;
}

.nav-item {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.nav-item:hover, .nav-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--text-primary);
}

.nav-item.active {
    border-left: 4px solid var(--accent-blue);
    padding-left: calc(1rem - 4px);
}

.sidebar-footer {
    padding: 2rem;
    border-top: 1px solid var(--glass-border);
}

.status-pill {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    padding: 0.5rem 1rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.status-pill .dot {
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 10px #22c55e;
}



.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-time {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-blue);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: 1.5rem;
    border-left: 1px solid var(--glass-border);
}

.profile-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--glass-border);
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.profile-badge {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.mobile-menu-btn {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.mobile-menu-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-blue);
}

.mobile-menu-btn span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
}

@media (max-width: 1024px) {
    .nav-time {
        display: none;
    }

    .user-profile {
        border-left: none;
        padding-left: 0;
    }

    .profile-info {
        display: none;
    }
}

.nav-logout {
    color: white;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    margin-left: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: 0 4px 6px -1px rgba(220, 38, 38, 0.3);
}

.nav-logout:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(220, 38, 38, 0.4);
    filter: brightness(1.1);
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    width: 100%;
}

.resource-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.6rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.resource-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

.res-icon {
    font-size: 1.5rem;
}

.res-label {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Dashboard Sidebar Layout */
.dashboard-wrapper {
    display: flex;
    max-width: 1600px;
    margin: 0 auto;
    padding-top: 70px;
    gap: 1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    align-items: flex-start;
    min-height: 100vh;
}

.dash-sidebar {
    width: 320px;
    flex-shrink: 0;
    position: sticky;
    top: 90px;
    height: calc(100vh - 90px);
    padding-bottom: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    scrollbar-width: none; 
}

.dash-sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar-menu-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.sidebar-nav-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sidebar-nav-item:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateX(5px);
}

.badge-status {
    position: absolute;
    right: 1rem;
    font-size: 0.65rem;
    background: rgba(251, 191, 36, 0.1);
    color: var(--accent-gold);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    border: 1px solid rgba(251, 191, 36, 0.2);
    font-weight: 700;
    text-transform: uppercase;
}

.dashboard-content {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding-bottom: 2rem;
}

/* Global Search Styles */
.search-box-global {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.search-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.search-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.search-icon-lg {
    font-size: 1.25rem;
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5));
}

.global-search-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.8rem 1rem;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
}

.global-search-input:focus {
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.search-results-container {
    margin-top: 1rem;
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-right: 5px; /* keep scrollbar off content */
}

/* Scrollbar for results */
.search-results-container::-webkit-scrollbar {
    width: 6px;
}

.search-results-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

/* Mini result cards */
.result-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: block;
}

.result-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
    border-color: var(--accent-blue);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.result-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 800;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

.result-type {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.result-meaning {
    font-size: 0.85rem;
    color: #e2e8f0;
    line-height: 1.3;
}

@media (max-width: 1024px) {
    .dashboard-wrapper {
        flex-direction: column;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .dash-sidebar {
        width: 100%;
        position: static;
        margin-bottom: 2rem;
    }
}

/* Global Drawer Styles */
.global-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.global-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.global-drawer-content {
    width: 85%;
    max-width: 1200px;
    min-width: 400px;
    height: 100%;
    background: var(--glass-bg, rgba(15, 23, 42, 0.95));
    border-left: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
    .global-drawer-content {
        width: 100%;
        min-width: 100%;
    }
}

.global-drawer-overlay.active .global-drawer-content {
    transform: translateX(0);
}

.global-close-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    z-index: 1001;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.global-close-btn:hover {
    background: rgba(239, 68, 68, 0.8);
    border-color: rgba(239, 68, 68, 1);
    transform: scale(1.1);
}

#global-drawer-iframe {
    width: 100%;
    flex: 1;
    border: none;
    background: #ffffff;
}