:root {
    --primary-blue: #004a99;
    /* TN Gov Blue */
    --secondary-blue: #0066cc;
    --tn-green: #00843d;
    /* TN Gov Green */
    --accent-gold: #ffcc00;
    --text-dark: #333333;
    --text-light: #f4f4f4;
    --bg-white: #ffffff;
    --bg-gray: #f8f9fa;
    --error-red: #d32f2f;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    /* Soft Gradient Background */
    background: linear-gradient(135deg, #e0f7fa 0%, #e8f5e9 100%);
    background-attachment: fixed;
    /* fix gradient on scroll */
    min-height: 100vh;
}

@keyframes globalGradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Header & Navigation */
header {
    background: var(--bg-white);
    border-bottom: 4px solid var(--primary-blue);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.top-bar {
    background: var(--primary-blue);
    color: white;
    padding: 5px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.gov-branding {
    display: flex;
    align-items: center;
    gap: 15px;
}

.tn-emblem {
    height: 80px;
    width: auto;
}

.portal-title h1 {
    font-size: 1.5rem;
    color: var(--primary-blue);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.portal-title p {
    font-size: 0.9rem;
    color: var(--tn-green);
    font-weight: bold;
}

.lang-switcher button {
    background: none;
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
    padding: 5px 15px;
    cursor: pointer;
    font-weight: bold;
    border-radius: 4px;
    transition: var(--transition);
}

.lang-switcher button:hover {
    background: var(--primary-blue);
    color: white;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, rgba(0, 74, 153, 0.95), rgba(0, 132, 61, 0.85)), url('../assets/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    color: white;
    padding: 80px 50px;
    margin-top: 20px;
    box-shadow: var(--shadow);
    text-align: left;
    justify-content: space-between;
    align-items: center;
    overflow: hidden;
    gap: 40px;
}

.hero-text {
    flex: 1;
}

.hero-3d-container {
    flex: 0 0 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

.floating-shield {
    width: 250px;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.3));
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotateY(0deg);
    }

    50% {
        transform: translateY(-20px) rotateY(10deg);
    }
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    max-width: 800px;
}

/* Dashboard Stats */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 50px;
    background: rgba(248, 249, 250, 0.5);
    backdrop-filter: blur(5px);
}

.stat-card {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: var(--shadow);
    border-top: 5px solid var(--primary-blue);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-blue);
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-dark);
}

/* Footer */
footer {
    background: #222;
    color: white;
    padding: 50px 50px 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid #444;
    padding-top: 20px;
    font-size: 0.8rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: var(--transition);
    cursor: pointer;
}

.btn-primary {
    background: var(--primary-blue);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-blue);
}

/* Utility */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    color: var(--primary-blue);
    font-size: 2rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--tn-green);
    margin: 10px auto;
}

.mission-vision-card {
    padding: 30px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-left: 8px solid var(--primary-blue);
    transition: var(--transition);
}

.mission-vision-card:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow);
}

/* Analytics Dashboard */
.chart-card {
    transition: var(--transition);
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.chart-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    background: white !important;
}

canvas {
    max-height: 350px;
    width: 100% !important;
}

/* Awareness Simulations */
.sim-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.sim-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    padding: 15px;
    /* Added padding to the card */
    display: flex;
    flex-direction: column;
}

.sim-card:hover {
    transform: translateY(-5px);
}

.sim-card img {
    width: 100%;
    height: 250px;
    /* Fixed height for consistency */
    object-fit: contain;
    /* Changed to contain to ensure full image is visible with padding */
    border-radius: 8px;
    background: #fdfdfd;
    margin-bottom: 10px;
}

.sim-content {
    padding: 10px 5px;
}

/* First Aid & Emergency */
.emergency-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.emergency-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border-left: 5px solid var(--error-red);
    box-shadow: var(--shadow);
}

/* Feedback Form */
.feedback-form {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 40px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.footer-links-list {
    list-style: none;
    margin-top: 10px;
}

.footer-links-list li {
    margin-bottom: 8px;
}

.footer-links-list a {
    color: #ccc;
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-links-list a:hover {
    color: white;
    padding-left: 5px;
}

@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        padding: 20px;
    }

    .hero h2 {
        font-size: 2rem;
    }
}

/* Main Grid Layout */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 40px;
    margin-bottom: 40px;
}

@media (max-width: 992px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

/* News Sidebar */
.news-sidebar {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: fit-content;
    align-self: flex-start;
    border: 1px solid #eee;
}

.news-header {
    background: var(--tn-green);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.news-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.live-badge {
    background: var(--error-red);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    50% {
        opacity: 0.5;
    }
}

.news-list-container {
    padding: 0 20px;
}

.news-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.news-list li {
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.news-list li:last-child {
    border-bottom: none;
}

.news-date {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary-blue);
    text-transform: uppercase;
    background: #eef6ff;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 5px;
}

.news-list p {
    font-size: 0.85rem;
    line-height: 1.4;
    color: #444;
    margin: 0;
}

/* Main Grid Layout */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 40px;
    margin-bottom: 40px;
}

@media (max-width: 992px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}



/* Navigation List */
.nav-list {
    display: flex;
    gap: 25px;
    list-style: none;
}

.nav-list a {
    text-decoration: none;
    color: var(--primary-blue);
    font-weight: 600;
    transition: var(--transition);
}

.nav-list a:hover {
    color: var(--tn-green);
}

/* Leadership Section */
.leadership-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    text-align: center;
}

.leader-img {
    width: 160px;
    height: 190px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 15px;
    border: 3px solid #eee;
    transition: var(--transition);
}

.leader-card:hover .leader-img {
    border-color: var(--primary-blue);
    transform: translateY(-5px);
}

/* Insights Section */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.insight-card {
    background: white;
    border: 1px solid #eee;
    padding: 25px;
    border-radius: 12px;
    height: 100%;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.insight-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.insight-card.blue {
    border-top: 5px solid var(--primary-blue);
}

.insight-card.red {
    border-top: 5px solid var(--error-red);
}

.insight-card.green {
    border-top: 5px solid var(--tn-green);
}

/* Responsive Nav Fix */
@media (max-width: 768px) {
    .nav-list {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .main-header {
        flex-direction: column;
        gap: 20px;
    }
}

/* Fine Calculator */
.fine-calculator-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow);
    max-width: 600px;
    margin: 0 auto;
    border-top: 5px solid var(--accent-gold);
}

.fine-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.fine-result-box {
    margin-top: 25px;
    padding: 20px;
    background: #fff8f8;
    border: 2px dashed var(--error-red);
    border-radius: 8px;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* SOS Floating Button */
.sos-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.sos-float-btn {
    background: var(--error-red);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: pulse-red 2s infinite;
}

.sos-float-btn:hover {
    transform: scale(1.05);
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(211, 47, 47, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(211, 47, 47, 0);
    }
}

.sos-popup {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 250px;
    display: none;
    /* Hidden by default */
    flex-direction: column;
    gap: 10px;
    transform-origin: bottom right;
    animation: popIn 0.3s ease-out;
}

.sos-popup.active {
    display: flex;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.sos-popup h4 {
    color: var(--error-red);
    margin-bottom: 10px;
    text-align: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.sos-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
    width: 100%;
}

.sos-option.ambulance {
    background: #ffebee;
    color: var(--error-red);
}

.sos-option.ambulance:hover {
    background: var(--error-red);
    color: white;
}

.sos-option.police {
    background: #e3f2fd;
    color: var(--primary-blue);
}

.sos-option.police:hover {
    background: var(--primary-blue);
    color: white;
}

.sos-option.location {
    background: #e8f5e9;
    color: var(--tn-green);
}

.sos-option.location:hover {
    background: var(--tn-green);
    color: white;
}

/* Tamil Font Override */
[lang="ta"] body {
    font-family: 'Noto Sans Tamil', sans-serif !important;
}