:root {
    --bg-color: #0ea5e9;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --primary-color: #0284c7;
    --primary-hover: #0369a1;
    
    --success-bg: #f0fdf4;
    --success-border: #22c55e;
    --success-text: #166534;
    
    --warning-bg: #fef2f2;
    --warning-border: #ef4444;
    --warning-text: #991b1b;

    --font-en: 'Inter', sans-serif;
    --font-kn: 'Noto Sans Kannada', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-en);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 1rem;
}

body.lang-kn { font-family: var(--font-kn); }

.app-wrapper { width: 100%; max-width: 700px; }

.main-card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    margin-bottom: 1.5rem;
    width: 100%;
}

/* Header */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-main);
}

.header-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.lang-btn {
    background: #f1f5f9;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.lang-btn:hover { background: #e2e8f0; }

.hero {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

/* Form & Input */
#check-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.input-wrapper { position: relative; width: 100%; }

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.25rem;
}

.id-input {
    width: 100%;
    padding: 1.25rem 1.25rem 1.25rem 3.25rem;
    font-size: 1.125rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    text-transform: uppercase;
    font-family: monospace;
    letter-spacing: 1px;
    transition: all 0.2s ease;
}

.id-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.1);
}

/* Inline Error State for Input */
.id-input.input-error {
    border-color: #ef4444; 
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15); 
    background-color: #fef2f2; 
}
.id-input.input-error:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25); 
}
.input-error-msg {
    color: #dc2626;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: -0.25rem;
}
.input-error-msg.hidden { display: none; }

.primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1.25rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
}
.primary-btn:hover { background: var(--primary-hover); }
.primary-btn:disabled { opacity: 0.7; cursor: not-allowed; }

/* Results */
.result-container {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border-left: 5px solid transparent;
}
.result-container.hidden { display: none; }

.result-icon-wrapper { font-size: 1.75rem; padding-top: 0.15rem; }
.result-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; }
.result-message { font-size: 1rem; margin-bottom: 1rem; }

.link-prefix {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.result-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.7);
    font-size: 0.95rem;
}
#result-link-wrapper.hidden { display: none; }

.state-warning { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning-text); }
.state-warning .result-link { color: var(--warning-text); border: 1px solid rgba(239, 68, 68, 0.3); }
.state-success { background: var(--success-bg); border-color: var(--success-border); color: var(--success-text); }
.state-error { background: #f8fafc; border-color: #94a3b8; color: #334155; }

/* About the Data Section (Scrollable) */
.about-data-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}
.about-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.about-title i { color: var(--text-muted); }

.scrollable-content {
    max-height: 320px;
    overflow-y: auto;
    padding-right: 0.5rem;
    margin-bottom: 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.scrollable-content::-webkit-scrollbar { width: 6px; }
.scrollable-content::-webkit-scrollbar-track { background: transparent; }
.scrollable-content::-webkit-scrollbar-thumb { background-color: #cbd5e1; border-radius: 10px; }

.data-step {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.data-step:last-child { margin-bottom: 0; }
.data-step h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.data-step h4 i { color: var(--primary-color); }
.data-step p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}
.data-step p:last-child { margin-bottom: 0; }

details { margin-top: 0.75rem; }
details summary {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary:hover { color: var(--primary-hover); }

.district-list {
    background: #ffffff;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.disclaimer-box {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    padding: 1.25rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}
.disclaimer-box i {
    font-size: 1.25rem;
    color: #d97706;
    margin-top: 0.15rem;
}
.disclaimer-box a {
    color: #b45309;
    font-weight: 600;
    text-decoration: underline;
}
.disclaimer-box a:hover { color: #92400e; }

/* Config Footer */
.config-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    color: rgba(255, 255, 255, 0.9);
    padding: 0 1rem;
}
.config-footer.hidden { display: none; }
.stat-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.15);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    font-size: 0.9rem;
}
.stat-box i { font-size: 1.1rem; opacity: 0.8; }
.stat-label { display: block; font-size: 0.75rem; opacity: 0.8; margin-bottom: 0.1rem; }
.stat-box strong { font-size: 1rem; font-weight: 600; }

/* Mobile Adjustments */
@media (max-width: 640px) {
    body { padding: 1rem; }
    .main-card {
        padding: 2rem 1.5rem;
        border-radius: 16px;
    }
    h1 { font-size: 1.75rem; margin-bottom: 1.5rem; }
    
    .header-logo { width: 40px; height: 40px; }
    .header-brand { font-size: 1rem; }
    
    .id-input { font-size: 16px; } 
    
    .result-container {
        flex-direction: column;
        text-align: left;
        gap: 1rem;
    }
    .config-footer { flex-direction: column; }
    .stat-box { width: 100%; justify-content: center; text-align: center; }
}