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

:root {
    --bg-main: #0b0f19;
    --bg-card: #151d30;
    --bg-hover: #1e2942;
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.15);
    --primary-hover: #2563eb;
    --accent: #f59e0b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #223049;
    --border-focus: #475569;
    --success: #10b981;
    --danger: #ef4444;
    --glass: rgba(21, 29, 48, 0.7);
    --font-family: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-family);
    min-height: 100vh;
    line-height: 1.6;
    padding-bottom: 40px;
}

/* Header & Navbar */
header {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    object-fit: cover;
}

.brand-title-group h1 {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa, #3b82f6, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.brand-title-group p {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-links {
    display: flex;
    gap: 16px;
}

/* Common UI Elements */
.container {
    max-width: 1400px;
    margin: 32px auto 0;
    padding: 0 24px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    margin-bottom: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 12px 36px -8px rgba(59, 130, 246, 0.1);
}

.card-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

/* Forms Styling */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.form-group label span.gu {
    color: var(--accent);
    font-size: 0.95rem;
}

.form-group label span.en {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.form-control {
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: 8px;
    padding: 12px 16px;
    font-family: var(--font-family);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #ffffff;
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(59, 130, 246, 0.5);
}

.btn-secondary {
    background-color: var(--bg-hover);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: var(--border);
    transform: translateY(-2px);
}

.btn-danger {
    background-color: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-2px);
}

.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* Table Styling */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

th {
    background-color: var(--bg-hover);
    color: var(--text-main);
    font-weight: 600;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
    color: var(--text-main);
}

.actions-cell {
    display: flex;
    gap: 8px;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-primary {
    background-color: var(--primary-glow);
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Dashboard Filter Bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    align-items: center;
    background: var(--bg-card);
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.search-input-wrapper {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-input-wrapper input {
    padding-left: 40px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* Auto Generation Info for DOB */
.dob-helper-text {
    font-size: 0.8rem;
    color: var(--accent);
    margin-top: 4px;
    font-style: italic;
}

/* Alert Notification styles */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-weight: 500;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 16px;
    color: var(--border-focus);
}

/* Responsive adjust */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .nav-links {
        justify-content: center;
        width: 100%;
        gap: 10px;
    }
    
    .nav-links .btn {
        width: 100%;
        margin-bottom: 4px;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    /* Convert table rows to individual layout cards on mobile */
    table, thead, tbody, th, td, tr {
        display: block;
    }
    
    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    tr {
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 12px;
        margin-bottom: 16px;
        padding: 12px 16px;
    }
    
    td {
        border: none;
        border-bottom: 1px dashed var(--border);
        position: relative;
        padding: 10px 12px 10px 45%;
        text-align: right;
        min-height: 40px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    td:last-child {
        border-bottom: none;
        padding-left: 12px;
        justify-content: center;
        margin-top: 12px;
        padding-top: 16px;
    }
    
    /* Prepend custom column headers on mobile view */
    td::before {
        content: attr(data-label);
        position: absolute;
        left: 12px;
        width: 40%;
        text-align: left;
        font-weight: 600;
        color: var(--accent);
        font-size: 0.85rem;
    }
    
    .actions-cell {
        width: 100%;
        justify-content: center;
        gap: 8px;
    }
    
    .actions-cell .btn {
        flex: 1;
        text-align: center;
        padding: 8px 10px;
        font-size: 0.8rem;
    }
}

/* Floating PWA Install Banner styling */
.pwa-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    width: 90%;
    max-width: 480px;
    background: rgba(21, 29, 48, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--accent);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(245, 158, 11, 0.15);
    z-index: 9999;
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.pwa-banner.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pwa-banner-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1.5px solid var(--accent);
    object-fit: cover;
}

.pwa-banner-text h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.pwa-banner-text p {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin: 2px 0 0 0;
}

.pwa-banner-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pwa-banner-actions .btn-sm {
    padding: 8px 14px;
    font-size: 0.8rem;
    white-space: nowrap;
    border-radius: 6px;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.2s;
}

.btn-close:hover {
    color: var(--danger);
}

