:root {
    /* Colors */
    --primary: #0065B3;
    --primary-dark: #004A80;
    --primary-light: #2186D6;
    --secondary: #2A3F55;
    --text: #202326;
    --text-light: #4B5563;
    --background: #F5F6F7;
    --white: #FFFFFF;
    --border: #E5E7EB;
    --success: #16A34A;
    --warning: #FBBF24;
    --error: #DC2626;
    
    /* Font Families */
    --font-sinhala: 'Noto Sans Sinhala', 'Iskoola Pota', sans-serif;
    --font-tamil: 'Noto Sans Tamil', sans-serif;
    --font-primary: 'Fira Sans', system-ui, -apple-system, sans-serif;
    --font-english: 'Fira Sans', system-ui, -apple-system, sans-serif;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* Transitions */
    --transition: all 0.2s ease-in-out;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

/* Language-specific font settings */
html {
    font-family: var(--font-english);
}

html[lang="si"] {
    font-family: var(--font-sinhala);
}

html[lang="ta"] {
    font-family: var(--font-tamil);
}

body {
    line-height: 1.5;
    color: var(--text);
    background-color: var(--background);
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Header Styles */
.gov-header {
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.top-banner {
    background: var(--primary);
    padding: var(--spacing-xs) 0;
    color: var(--white);
}

.utility-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Language Selector */
.language-selector {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
}

.language-selector a {
    color: var(--white);
    text-decoration: none;
    padding: 6px 12px;
    font-size: 0.875rem;
    opacity: 0.9;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-weight: 500;
}

.language-selector a.active {
    background: rgba(255,255,255,0.25);
    opacity: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.language-selector a:hover {
    opacity: 1;
    background: rgba(255,255,255,0.15);
    transform: translateY(-1px);
}

.language-selector img {
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    vertical-align: middle;
}

/* Polylang specific styles */

/* Utility Links */
.utility-links {
    display: flex;
    gap: var(--spacing-md);
}

.utility-links a {
    color: var(--white);
    text-decoration: none;
    font-size: 0.875rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.utility-links a:hover {
    opacity: 1;
}

/* Main Header */
.main-header {
    padding: var(--spacing-md) 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-lg);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    color: var(--text);
}

.logo img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.logo span {
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.2;
}

/* Search */
.header-search {
    flex: 1;
    max-width: 600px;
}

.search-wrapper {
    display: flex;
    gap: var(--spacing-xs);
    position: relative;
}

.search-wrapper input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition);
}

.search-wrapper input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: var(--shadow-sm);
}

.search-wrapper button {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0 var(--spacing-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    transition: var(--transition);
}

.search-wrapper button:hover {
    background: var(--primary-dark);
}

/* Search Suggestions */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    margin-top: var(--spacing-xs);
    z-index: 1000;
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
}

.search-suggestions li {
    padding: var(--spacing-sm);
    cursor: pointer;
    transition: var(--transition);
}

.search-suggestions li:hover {
    background: var(--background);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    padding: var(--spacing-xl) 0;
    position: relative;
    overflow: hidden;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.2;
    margin-bottom: var(--spacing-lg);
    font-weight: 700;
}

/* Services Grid */
.featured-services {
    margin-top: var(--spacing-xl);
}

.featured-services h2 {
    color: var(--white);
    margin-bottom: var(--spacing-lg);
    font-size: 1.5rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.service-card {
    background: var(--white);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.service-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: var(--transition);
}

.service-card:hover .service-icon {
    transform: scale(1.1);
}

.service-card h3 {
    font-size: 1.25rem;
    color: var(--text);
    margin-bottom: var(--spacing-xs);
}

.service-card p {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Topics Section */
.topics-section {
    padding: var(--spacing-xl) 0;
    background: var(--white);
}

.topics-section h2 {
    font-size: 2rem;
    margin-bottom: var(--spacing-lg);
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

.topic-card {
    background: var(--white);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    text-decoration: none;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.topic-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.topic-card h3 {
    color: var(--primary);
    font-size: 1.25rem;
    margin-bottom: var(--spacing-xs);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.topic-card h3 i {
    font-size: 1.25rem;
    opacity: 0.8;
}

.topic-card p {
    color: var(--text-light);
}

/* Updates Section */
.updates-section {
    padding: var(--spacing-xl) 0;
    background: var(--background);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.view-all {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.updates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

.update-card {
    background: var(--white);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.category-tag {
    display: inline-block;
    padding: 4px 8px;
    background: var(--primary-light);
    color: var(--white);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.update-card h3 {
    font-size: 1.25rem;
    color: var(--text);
}

.update-card time {
    color: var(--text-light);
    font-size: 0.875rem;
}

.update-card p {
    color: var(--text-light);
    margin-bottom: var(--spacing-sm);
}

.read-more {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-top: auto;
}

/* Priority Styles */
.priority-high .category-tag {
    background: var(--error);
}

.priority-medium .category-tag {
    background: var(--warning);
}

.priority-normal .category-tag {
    background: var(--success);
}

/* Footer */
.gov-footer {
    background: #2c5aa0;
    border-top: 4px solid #1d4087;
    color: var(--white);
    font-size: 0.875rem;
}

.footer-main {
    padding: 3rem 0 2rem;
    background: #2c5aa0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2.5rem;
}

.footer-section h3 {
    color: var(--white);
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 1.25rem 0;
    letter-spacing: 0.025em;
}

.footer-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.2s ease;
    display: block;
    padding: 0.25rem 0;
}

.footer-section a:hover {
    color: var(--white);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.footer-meta {
    background: #1d4087;
    padding: 1.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-meta-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-logo img {
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem;
}

.footer-logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--white);
    line-height: 1.2;
}

.logo-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.2;
}

.footer-meta-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: right;
    max-width: 400px;
}

.footer-license {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}

.footer-license a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.footer-license a:hover {
    color: var(--white);
}

.footer-social {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
}

.social-links {
    display: flex;
    gap: 0.75rem;
}

.social-links a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.125rem;
    transition: color 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.social-links a:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-meta-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-meta-right {
        text-align: center;
        max-width: 100%;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .footer-main {
        padding: 2rem 0 1.5rem;
    }
}

@media (max-width: 480px) {
    .footer-section h3 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .footer-section ul li {
        margin-bottom: 0.5rem;
    }
    
    .footer-logo {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .footer-logo-text {
        align-items: center;
    }
}

/* Accessibility */
.skip-to-main {
    position: absolute;
    left: -9999px;
    padding: var(--spacing-sm);
    background: var(--primary);
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    z-index: 1000;
}

.skip-to-main:focus {
    left: 50%;
    transform: translateX(-50%);
}

.keyboard-nav :focus {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

/* Language Transition Animation */
[data-i18n] {
    transition: opacity 0.2s ease-in-out;
}

.language-switching [data-i18n] {
    opacity: 0;
}

/* Typography Enhancement */
.hero h1 {
    font-family: var(--font-primary);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.hero-title {
    font-family: var(--font-primary);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-family: var(--font-primary);
    font-weight: 400;
    opacity: 0.85;
    letter-spacing: -0.01em;
}

.lead-text, .intro-text {
    font-family: var(--font-primary);
    font-size: 1.125rem;
    line-height: 1.6;
    font-weight: 400;
    color: var(--text-light);
}

blockquote {
    font-family: var(--font-primary);
    font-weight: 500;
    border-left: 4px solid var(--primary);
    padding-left: var(--spacing-md);
    margin: var(--spacing-md) 0;
    color: var(--text-light);
}

/* Enhanced heading hierarchy */
h1, h2 {
    font-family: var(--font-primary);
    font-weight: 600;
    letter-spacing: -0.02em;
}

h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 500;
    letter-spacing: -0.01em;
}

/* RTL Support */
[dir="rtl"] {
    text-align: right;
}