:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --mesh-gradient: radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), 
                     radial-gradient(at 50% 0%, hsla(225,39%,30%,1) 0, transparent 50%), 
                     radial-gradient(at 100% 0%, hsla(339,49%,30%,1) 0, transparent 50%);
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --text-white: rgba(255, 255, 255, 0.95);
    --text-muted: rgba(255, 255, 255, 0.7);
    --primary-color: #f093fb;
    --success-color: #4ade80;
    --font-main: 'Segoe UI', 'Roboto', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    color: var(--text-white);
    background-color: #0f0c29;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* Animated Background */
.background-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: 
        radial-gradient(circle at 15% 50%, rgba(102, 126, 234, 0.4), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(245, 87, 108, 0.4), transparent 25%);
    filter: blur(60px);
    animation: bgPulse 10s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Header */
.main-header {
    text-align: center;
    margin-bottom: 1rem;
}

.main-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #e0c3fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
}

.main-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    justify-content: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    border-radius: 50px;
    backdrop-filter: blur(5px);
    margin: 0 auto;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 40px;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.tab-btn:hover:not(.active) {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

/* Tab Panels */
.tab-panel {
    display: none;
    flex-direction: column;
    gap: 2rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.tab-panel.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

/* Glass Cards */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 20px;
    padding: 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Inputs & Buttons */
.toggle-group {
    display: flex;
    gap: 1rem;
}

.gender-btn, .mode-btn {
    flex: 1;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.gender-btn.active, .mode-btn.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
    font-weight: 600;
}

.glass-input, .glass-select {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}

.glass-input:focus, .glass-select:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Date Input Color Fix */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '▼';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.5);
    pointer-events: none;
    font-size: 0.8rem;
}

.glass-select {
    appearance: none;
    cursor: pointer;
}

.glass-select option {
    background: #1f2639;
    color: #fff;
}

.primary-btn {
    width: 100%;
    padding: 1.2rem;
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 1rem;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.primary-btn:active {
    transform: translateY(0);
}

/* Results Area */
.result-card.hidden {
    display: none;
}

.result-card {
    text-align: center;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 1rem;
}

.result-header h2 {
    font-size: 1.2rem;
    font-weight: 500;
}

.badge {
    background: rgba(255,255,255,0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--primary-color);
}

.nic-display {
    font-size: 3.5rem;
    font-weight: 700;
    font-family: monospace;
    letter-spacing: 2px;
    margin-bottom: 2rem;
    word-break: break-all;
    text-shadow: 0 0 20px rgba(255,255,255,0.2);
}

.nic-details {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(255,255,255,0.03);
    padding: 1rem;
    border-radius: 10px;
}

.detail-item .label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.detail-item .value {
    font-size: 1.2rem;
    font-weight: 600;
}

/* Address Results */
.address-display {
    font-size: 1.5rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    text-align: left;
    background: rgba(0,0,0,0.2);
    padding: 1.5rem;
    border-radius: 12px;
    font-weight: 500;
    white-space: pre-line;
}

.location-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 2rem;
}

.detail-pill {
    background: rgba(255,255,255,0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #e0c3fc;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.copy-btn {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.copy-btn:hover {
    background: rgba(255,255,255,0.2);
}

.export-btn {
    background: rgba(74, 222, 128, 0.1); /* Success green tint */
    color: var(--success-color);
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.export-btn:hover {
    background: rgba(74, 222, 128, 0.2);
}


/* Footer */
.main-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding-bottom: 2rem;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #4ade80;
    color: #000;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    font-weight: 600;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Mode Toggle */
.mode-toggle {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Manual Controls */
.manual-controls.hidden {
    display: none;
}

.manual-controls {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .main-header h1 {
        font-size: 2rem;
    }
    
    .nic-display {
        font-size: 2.2rem;
    }
    
    .nic-details {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }

    .address-display {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }

    .glass-card {
        padding: 1.5rem;
    }

    .tab-navigation {
        width: 100%;
    }

    .tab-btn {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }
}
