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

/* Base font size for different screen sizes */
html {
    font-size: 16px;
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
}

/* Sinhala Text Rendering Improvements */
.sinhala-text,
[lang="si"],
.data-table td,
.data-table th,
.hero-title,
.nav-title,
.section-title {
    font-family: 'Noto Sans Sinhala', 'Malithi Web', 'Iskoola Pota', sans-serif;
    font-feature-settings: "liga" 1, "calt" 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.8;
    word-spacing: 0.1em;
    letter-spacing: 0.02em;
}

/* Paragraph spacing for Sinhala text */
p,
.section-description,
.hero-description {
    margin-bottom: 1.2em;
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
}

body {
    font-family: 'Noto Sans Sinhala', 'Malithi Web', 'Iskoola Pota', sans-serif;
    line-height: 1.8;
    color: #333;
    background-color: #f8f9fa;
    font-size: 16px;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Enhanced Sinhala Text Rendering */
.sinhala-text,
[lang="si"],
.data-table td,
.data-table th,
.hero-title,
.nav-title,
.section-title {
    font-family: 'Noto Sans Sinhala', 'Malithi Web', 'Iskoola Pota', sans-serif;
    font-feature-settings: "liga" 1, "calt" 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.8;
    word-spacing: 0.1em;
    letter-spacing: 0.02em;
}

/* Paragraph spacing for Sinhala text */
p,
.section-description,
.hero-description {
    margin-bottom: 1.2em;
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
}

/* Utility helpers for consistent text sizing (used by inner pages) */
.text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.text-base {
    font-size: 1rem;
    line-height: 1.5rem;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.65rem;
}

.text-xl {
    font-size: 1.25rem;
    line-height: 1.75rem;
}

.text-2xl {
    font-size: 1.5rem;
    line-height: 1.9rem;
}

.text-3xl {
    font-size: 1.875rem;
    line-height: 2.1rem;
}

.text-4xl {
    font-size: 2.25rem;
    line-height: 2.4rem;
}

.text-5xl {
    font-size: 3rem;
    line-height: 1.1;
}

.text-6xl {
    font-size: 3.75rem;
    line-height: 1.05;
}

.font-thin {
    font-weight: 200;
}

.font-light {
    font-weight: 300;
}

.font-normal {
    font-weight: 400;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.font-black {
    font-weight: 900;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.uppercase {
    text-transform: uppercase;
}

.lowercase {
    text-transform: lowercase;
}

.capitalize {
    text-transform: capitalize;
}

/* Shared hero styling across inner pages */
.hero-header {
    background: #061a2c !important;
    border: 1px solid rgba(148, 163, 184, 0.25) !important;
    color: #e2e8f0 !important;
    box-shadow: 0 28px 60px rgba(6, 10, 19, 0.45) !important;
}

.hero-content {
    color: inherit;
}

.hero-title {
    color: #f8fafc !important;
}

.hero-subtitle {
    color: #cbd5f5 !important;
}

.hero-badge {
    background: rgba(15, 118, 210, 0.15) !important;
    color: #e0f2fe !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
}

/* Consistent footer heading size across inner pages */
.footer-title {
    font-size: 1.875rem !important;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
}

/* Navigation */
.navbar {
    background: rgba(44, 62, 80, 0.5);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 0.3rem 0;
    transition: padding 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar.scrolled {
    padding: 0.2rem 0;
    background: rgba(44, 62, 80, 0.65);
    backdrop-filter: blur(12px);
}

.navbar.scrolled .nav-header {
    display: none;
    transform: translateY(-16px);
    pointer-events: none;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 0.1rem;
    padding-bottom: 0.1rem;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.navbar.scrolled .nav-container {
    padding-top: 0.1rem;
    padding-bottom: 0.1rem;
}

.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 0.2rem;
    padding: 0.1rem 0;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar.scrolled .nav-header {
    margin-bottom: 0;
    padding: 0;
}

.nav-title {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    text-align: center;
    flex: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

@media (max-width: 768px) {
    .nav-header {
        margin-bottom: 0;
        position: relative;
    }

    .nav-title {
        font-size: 1rem;
        flex: 1;
        text-align: left;
        padding-right: 50px;
    }

    .nav-controls {
        position: fixed;
        top: 0.4rem;
        right: 4rem;
        z-index: 1001;
    }

    .language-switcher {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.8rem;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nav-menu::-webkit-scrollbar {
    display: none;
}

.nav-link {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease, padding 0.3s ease;
    padding: 0.3rem 0.7rem;
    border-radius: 5px;
    white-space: nowrap;
    text-align: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.nav-link:hover {
    color: #f39c12;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Language Switcher */
.language-switcher {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.language-switcher:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.language-switcher:active {
    transform: translateY(0);
}

.language-switcher i {
    font-size: 0.8rem;
    opacity: 0.8;
}

.lang-text {
    font-weight: 600;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.4rem;
    position: fixed;
    top: 0.5rem;
    right: 0.8rem;
    z-index: 1002;
    width: 38px;
    height: 38px;
    justify-content: center;
    align-items: center;
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
        position: fixed;
        top: 0.4rem;
        right: 0.8rem;
        width: 36px;
        height: 36px;
    }

    .navbar.scrolled .hamburger {
        top: 0.2rem;
    }
}

.bar {
    width: 25px;
    height: 3px;
    background-color: #fff;
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    position: relative;
    color: white;
    padding: 100px 0 100px;
    text-align: center;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* Animated Background Slider */
.hero-background-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0;
    transform: scale(1.1);
    transform-origin: center center;
    filter: blur(12px);
    will-change: opacity, transform, filter;
    transition: opacity 9s ease-in-out, transform 18s ease-out, filter 9s ease-in-out;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform-style: preserve-3d;
}

.hero-bg-image.active {
    opacity: 1;
    transform: scale(1);
    transform-origin: center center;
    filter: blur(0px);
    z-index: 1;
}

.hero-bg-image.fading-out {
    opacity: 0;
    transform: scale(1.1);
    filter: blur(15px);
    z-index: 0;
}

/* Keyframe animation for slow zoom in (getting closer) */
@keyframes zoomInSlow {
    0% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Smooth fade in animation */
@keyframes fadeInSlow {
    0% {
        opacity: 0;
        filter: blur(15px);
    }

    100% {
        opacity: 1;
        filter: blur(0px);
    }
}

/* Overlay for better text readability */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.hero-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
    z-index: 2;
}

@media (max-width: 768px) {
    .hero {
        padding: 80px 0 80px;
        min-height: 90vh;
    }

    .hero-background-slider {
        background-attachment: scroll;
    }

    .hero-bg-image {
        background-size: cover;
        background-position: center center;
    }

    .hero-overlay {
        background: rgba(0, 0, 0, 0.5);
    }

    .nav-link {
        font-size: 0.9rem;
        padding: 0.35rem 0.7rem;
    }
}

@media (max-width: 480px) {
    .hero-container {
        padding: 0 12px;
    }
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}

.hero-quote {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 10px;
    margin: 2rem 0;
    border-left: 4px solid #f39c12;
}

.hero-quote cite {
    display: block;
    margin-top: 1rem;
    font-style: italic;
    opacity: 0.8;
}

.hero-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-block;
}

.btn-primary {
    background: #f39c12;
    color: white;
}

.btn-primary:hover {
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.4);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: #667eea;
    transform: translateY(-2px);
}

/* Section Styles */
section {
    padding: 60px 0 0;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

@media (max-width: 768px) {
    section {
        padding: 50px 0;
    }
}

@media (max-width: 480px) {
    section {
        padding: 40px 0;
    }
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.section-description {
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 3rem;
    color: #666;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Categories Section */
.categories {
    background: white;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.category-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e9ecef;
    width: 100%;
    box-sizing: border-box;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.category-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.category-card p {
    color: #666;
    margin-bottom: 1.5rem;
}

.category-count {
    font-size: 2rem;
    font-weight: 700;
    color: #f39c12;
    background: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

/* Data Table Section */
.data-table {
    background: #f8f9fa;
}

/* Ensure section with data-table class has proper padding */
section.data-table {
    padding-bottom: 50px;
    display: block;
    width: 100%;
    min-width: 0 !important;
}

@media (max-width: 768px) {
    section.data-table {
        padding-bottom: 40px;
        width: 100%;
    }
}

@media (max-width: 480px) {
    section.data-table {
        padding-bottom: 35px;
        width: 100%;
    }
}

.table-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #f39c12;
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.filter-controls select {
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.filter-controls select:focus {
    outline: none;
    border-color: #f39c12;
}

.table-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    position: relative;
    overflow-y: visible;
    scroll-behavior: smooth;
}

/* Ensure container doesn't hide overflow */
.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Scroll indicator for mobile/tablet */
@media (max-width: 1024px) {
    .table-container {
        position: relative;
    }

    .table-container::after {
        content: '← සරක් →';
        position: absolute;
        bottom: -30px;
        right: 10px;
        font-size: 0.75rem;
        color: #666;
        animation: pulse 2s infinite;
        pointer-events: none;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

.data-table {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
    display: table;
}

.data-table th {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s ease;
    word-wrap: break-word;
    max-width: 200px;
}

.data-table th:first-child,
.data-table td:first-child {
    min-width: 60px;
    max-width: 70px;
}

.data-table th:nth-child(2),
.data-table td:nth-child(2) {
    min-width: 250px;
    max-width: 300px;
}

.data-table th:nth-child(3),
.data-table td:nth-child(3) {
    min-width: 150px;
    max-width: 180px;
}

.data-table th:nth-child(4),
.data-table td:nth-child(4) {
    min-width: 200px;
    max-width: 250px;
}

.data-table th:nth-child(5),
.data-table td:nth-child(5) {
    min-width: 300px;
    max-width: 400px;
}

.data-table tr:hover td {
    background-color: #f8f9fa;
}

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

/* View Details Button Styles */
.view-details-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.view-details-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.view-details-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
}

.view-details-btn i {
    font-size: 1rem;
}

.view-details-btn span {
    font-size: 0.9rem;
}

/* Ensure table cells with buttons have proper spacing */
.data-table td:last-child {
    text-align: center;
    padding: 1rem;
    white-space: nowrap;
}

/* Make table rows more interactive */
.data-table tbody tr {
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Ensure buttons don't interfere with row hover */
.data-table tbody tr:hover .view-details-btn {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Responsive button styles */
@media (max-width: 768px) {
    .view-details-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .view-details-btn span {
        display: none;
    }

    .view-details-btn i {
        font-size: 1.1rem;
    }
}

/* Analysis Section */
.analysis {
    background: white;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.analysis-card {
    background: linear-gradient(135deg, #fff, #f8f9fa);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #f39c12;
    transition: transform 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.analysis-card:hover {
    transform: translateY(-3px);
}

.analysis-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.analysis-card p {
    color: #666;
    margin-bottom: 1rem;
}

.analysis-details {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid #e9ecef;
}

/* Comparison Section */
.comparison {
    background: #f8f9fa;
}

.comparison-tool {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.comparison-controls h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.selection-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.selection-item:hover {
    border-color: #f39c12;
    background: #fff;
}

.selection-item.selected {
    background: #f39c12;
    color: white;
    border-color: #f39c12;
}

.comparison-results {
    margin-top: 2rem;
}

.comparison-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.comparison-table th {
    background: #2c3e50;
    color: white;
    padding: 12px;
    text-align: center;
    font-weight: 600;
}

.comparison-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.comparison-table td.present {
    background: #d4edda;
    color: #155724;
    font-weight: 600;
}

.comparison-table td.absent {
    background: #f8d7da;
    color: #721c24;
}

/* About Section */
.about {
    background: white;
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    margin-top: 3rem;
}

.about-text h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.about-text h4 {
    font-size: 1.3rem;
    margin: 1.5rem 0 1rem;
    color: #34495e;
}

.about-text ul {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

.about-text li {
    margin-bottom: 0.5rem;
    color: #666;
}

.contact-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.contact-info a {
    color: #f39c12;
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

.version-info {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 15px;
}

.version-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.version-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #f39c12;
}

.version-number {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
}

.version-date {
    color: #666;
    font-size: 0.9rem;
    margin: 0.25rem 0;
}

.version-desc {
    color: #666;
    font-size: 0.9rem;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 3rem 0;
}

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

.footer-text p {
    margin-bottom: 0.5rem;
}

.footer-blessing {
    font-weight: 600;
    font-size: 1.1rem;
    color: #f39c12;
}

.footer-link {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 2px solid white;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.footer-link:hover {
    background: white;
    color: #2c3e50;
}

/* Social Media Buttons */
.social-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.social-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.social-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Brand-specific hover colors */
.youtube-btn:hover {
    background-color: #FF0000;
    border-color: #FF0000;
}

.facebook-btn:hover {
    background-color: #1877F2;
    border-color: #1877F2;
}

.github-btn:hover {
    background-color: #ffffff;
    color: #000000;
    border-color: #ffffff;
}

.machineworld-btn:hover {
    background-color: #00e5ff;
    border-color: #00e5ff;
}

.social-icon {
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.social-text {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-container {
        flex-direction: row;
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
        padding-left: 12px;
        padding-right: 12px;
    }

    .social-buttons {
        gap: 0.75rem;
        justify-content: center;
    }

    .social-button {
        width: 45px;
        height: 45px;
    }

    .social-icon {
        font-size: 22px;
    }

    .social-img {
        width: 22px;
        height: 22px;
    }

    .social-text {
        display: none;
    }

    .nav-header {
        margin-bottom: 0;
        width: 100%;
        align-items: center;
        padding: 0.15rem 0;
    }

    .nav-title {
        font-size: 0.95rem;
        text-align: left;
        flex: 1;
        margin-right: 0;
        padding-right: 50px;
        line-height: 1.2;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 45px;
        flex-direction: column;
        background-color: #2c3e50;
        width: 100%;
        text-align: center;
        transition: left 0.3s ease;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
        z-index: 1001;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }

    .navbar.scrolled .nav-menu {
        top: 40px;
    }

    /* Hamburger menu animation */
    .hamburger.active .bar:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(3) {
        transform: rotate(-45deg) translate(8px, -8px);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        margin: 1rem 0;
    }

    .nav-link {
        white-space: nowrap;
        text-align: center;
        display: block;
        width: 100%;
    }

    .language-switcher {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    .hero {
        padding-top: 70px;
        padding-bottom: 50px;
        min-height: auto;
    }

    .hero-container {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .hero-title {
        font-size: 1.6rem;
        line-height: 1.3;
        margin-bottom: 0.8rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .hero-description {
        font-size: 0.9rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
    }

    .hero-quote {
        padding: 1.2rem;
        font-size: 0.85rem;
        margin: 1.5rem 0;
    }

    .section-title {
        font-size: 1.8rem;
        margin-bottom: 0.8rem;
        line-height: 1.3;
    }

    .section-description {
        font-size: 0.9rem;
        margin-bottom: 2rem;
        line-height: 1.5;
    }

    .categories-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
        margin-top: 2rem;
    }

    .category-card {
        padding: 1.3rem;
        padding-top: 1.5rem;
    }

    .category-card h3 {
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
    }

    .category-card p {
        font-size: 0.85rem;
        margin-bottom: 1.2rem;
    }

    .category-count {
        width: 45px;
        height: 45px;
        font-size: 1.4rem;
    }

    .table-container {
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        margin: 0 auto;
        border-radius: 10px;
        display: block;
        position: relative;
    }

    .data-table {
        min-width: 1300px;
        font-size: 0.85rem;
        width: max-content;
        display: table;
        table-layout: auto;
    }

    .data-table th,
    .data-table td {
        padding: 12px 10px;
    }

    .data-table th {
        position: relative;
        background: linear-gradient(135deg, #2c3e50, #34495e);
        white-space: nowrap;
    }

    /* Fix column widths for mobile */
    .data-table th:first-child,
    .data-table td:first-child {
        min-width: 50px;
        max-width: 60px;
    }

    .data-table th:nth-child(2),
    .data-table td:nth-child(2) {
        min-width: 200px;
        max-width: 250px;
        white-space: normal;
    }

    .data-table th:nth-child(3),
    .data-table td:nth-child(3) {
        min-width: 120px;
        max-width: 150px;
        white-space: normal;
    }

    .data-table th:nth-child(4),
    .data-table td:nth-child(4) {
        min-width: 180px;
        max-width: 220px;
        white-space: normal;
    }

    .data-table th:nth-child(5),
    .data-table td:nth-child(5) {
        min-width: 280px;
        max-width: 320px;
        white-space: normal;
    }

    .analysis-grid {
        grid-template-columns: 1fr;
    }

    .selection-grid {
        grid-template-columns: 1fr;
    }

    .table-controls {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }

    .search-box {
        width: 100%;
    }

    .filter-controls {
        width: 100%;
    }

    .filter-controls select {
        width: 100%;
        box-sizing: border-box;
    }

    .comparison-tool {
        padding: 1.5rem;
    }

    .hero-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn {
        width: 100%;
        padding: 10px 20px;
    }

    /* Comparison table fixes */
    .comparison-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Feedback section */
    .feedback-section {
        padding: 3rem 0 4rem;
        background: #020c16;
    }

    .feedback-card {
        max-width: 720px;
        margin: 0 auto;
        background: #071b2f;
        border-radius: 1.5rem;
        box-shadow: 0 24px 48px rgba(2, 6, 23, 0.55);
        padding: 2rem;
        border: 1px solid rgba(148, 163, 184, 0.2);
    }

    .feedback-toggle {
        width: 100%;
        padding: 1rem 1.5rem;
        border-radius: 999px;
        border: 1px solid rgba(59, 130, 246, 0.5);
        background: rgba(15, 118, 210, 0.2);
        color: #e0f2fe;
        font-size: 1.05rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .feedback-toggle:hover,
    .feedback-toggle:focus {
        outline: none;
        border-color: rgba(59, 130, 246, 0.8);
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25);
    }

    .feedback-form {
        margin-top: 1.5rem;
        display: none;
        flex-direction: column;
        gap: 1rem;
    }

    .feedback-form.active {
        display: flex;
    }

    .feedback-form textarea {
        width: 100%;
        min-height: 140px;
        border-radius: 1rem;
        border: 1px solid rgba(148, 163, 184, 0.3);
        background: rgba(15, 23, 42, 0.6);
        color: #e2e8f0;
        padding: 1rem;
        font-size: 1rem;
        resize: vertical;
    }

    .feedback-form textarea:focus {
        outline: none;
        border-color: rgba(59, 130, 246, 0.8);
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25);
    }

    .feedback-send {
        align-self: flex-end;
        padding: 0.75rem 2rem;
        border-radius: 999px;
        border: none;
        background: linear-gradient(135deg, #38bdf8, #6366f1);
        color: #0f172a;
        font-weight: 700;
        cursor: pointer;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .feedback-send:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 24px rgba(56, 189, 248, 0.35);
    }

    .comparison-table {
        min-width: 600px;
        font-size: 0.85rem;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 10px 8px;
        white-space: nowrap;
    }

    /* Ensure all cards fit properly */
    .category-card,
    .analysis-card,
    .explanation-card,
    .selection-item {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Fix any grid overflow */
    .categories-grid,
    .analysis-grid,
    .explanations-grid,
    .selection-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    /* Fix footer */
    .footer-content {
        flex-direction: column;
        text-align: center;
        padding: 0 15px;
    }

    /* Fix about section */
    .about-content {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }
}

/* Additional mobile optimizations */
@media (max-width: 600px) {
    .nav-title {
        font-size: 1rem;
        padding-right: 60px;
    }

    .hamburger {
        width: 40px;
        height: 40px;
        top: 1rem;
        right: 0.5rem;
    }

    .language-switcher {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    .nav-controls {
        right: 3rem;
    }
}

/* Tablet responsive design */
@media (max-width: 1024px) and (min-width: 769px) {
    .nav-title {
        font-size: 1.5rem;
    }

    .nav-menu {
        gap: 0.7rem;
        flex-wrap: nowrap;
    }

    .nav-link {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .table-controls {
        flex-direction: column;
        align-items: center;
    }

    .search-box {
        max-width: 100%;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .data-table {
        font-size: 0.9rem;
    }

    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero {
        padding-top: 60px;
        padding-bottom: 40px;
    }

    .hero-title {
        font-size: 1.4rem;
        line-height: 1.25;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 0.8rem;
    }

    .section-description {
        font-size: 0.85rem;
        margin-bottom: 1.8rem;
    }

    .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    .categories-grid,
    .analysis-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .category-card {
        padding: 1.2rem;
    }

    .selection-grid {
        grid-template-columns: 1fr;
    }

    .table-controls {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
        margin-bottom: 1rem;
    }

    .search-box {
        max-width: 100%;
        width: 100%;
    }

    .search-box input {
        width: 100%;
        box-sizing: border-box;
    }

    .filter-controls {
        width: 100%;
    }

    .filter-controls select {
        width: 100%;
        box-sizing: border-box;
    }

    .data-table {
        font-size: 0.75rem;
        min-width: 1000px;
        width: max-content;
        display: table;
        table-layout: auto;
    }

    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }

    /* Fix column widths for very small screens */
    .data-table th:first-child,
    .data-table td:first-child {
        min-width: 40px;
        width: 50px;
    }

    .data-table th:nth-child(2),
    .data-table td:nth-child(2) {
        min-width: 180px;
        width: 220px;
        white-space: normal;
    }

    .data-table th:nth-child(3),
    .data-table td:nth-child(3) {
        min-width: 120px;
        width: 150px;
        white-space: normal;
    }

    .data-table th:nth-child(4),
    .data-table td:nth-child(4) {
        min-width: 180px;
        width: 220px;
        white-space: normal;
    }

    .data-table th:nth-child(5),
    .data-table td:nth-child(5) {
        min-width: 250px;
        width: 350px;
        white-space: normal;
    }

    .table-container {
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        margin: 0 auto;
        display: block;
    }

    .nav-title {
        font-size: 1.1rem;
    }

    .hero-quote {
        padding: 1.5rem;
        font-size: 0.9rem;
    }

    .comparison-controls h3 {
        font-size: 1.2rem;
    }

    .btn {
        font-size: 0.9rem;
        padding: 8px 16px;
    }

    .explanations-grid {
        grid-template-columns: 1fr;
    }

    /* Ensure all content fits on small screens */
    .hero-title,
    .hero-subtitle,
    .hero-description,
    .section-title,
    .section-description {
        max-width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Fix buttons */
    .btn {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Fix hero quote */
    .hero-quote {
        max-width: 100%;
        padding: 1rem;
        margin: 1rem 0;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #f39c12;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Touch-friendly improvements */
.btn,
.nav-link,
.language-switcher,
.hamburger {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Ensure text is selectable but prevent text selection issues on mobile */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* Improve scrolling on mobile */
html,
body {
    overflow-x: hidden;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

/* Enhanced Explanations Section */
.explanations {
    padding: 60px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.explanations-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group,
.search-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-weight: 600;
    color: #495057;
}

.filter-group select,
.search-group input {
    padding: 10px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.filter-group select:focus,
.search-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.explanations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
    align-items: start;
}

.explanation-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-left: 4px solid #007bff;

    display: flex;
    flex-direction: column;
    height: 480px;
    min-height: 480px;
    max-height: 480px;
    position: relative;
    overflow: hidden;
}

.explanation-card.expanded {
    height: auto;
    min-height: 480px;
    max-height: none;
    z-index: 10;
    overflow: visible;
}

.explanation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.explanation-card.universal {
    border-left-color: #28a745;
}

.explanation-card.particular {
    border-left-color: #17a2b8;
}

.explanation-card.unwholesome {
    border-left-color: #dc3545;
}

.explanation-card.beautiful {
    border-left-color: #6f42c1;
}

.explanation-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    overflow: visible;
}

.explanation-title {
    font-size: 1.3em;
    font-weight: 700;
    color: #212529;
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.6;
    padding-top: 2px;
}

.explanation-category {
    background: #e9ecef;
    color: #495057;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    flex-shrink: 0;
    margin-left: 8px;
}

/* Category label colors matching left border colors */
.explanation-card.universal .explanation-category {
    background: #28a745;
    color: white;
}

.explanation-card.particular .explanation-category {
    background: #17a2b8;
    color: white;
}

.explanation-card.unwholesome .explanation-category {
    background: #dc3545;
    color: white;
}

.explanation-card.beautiful .explanation-category {
    background: #6f42c1;
    color: white;
}

.explanation-description {
    color: #6c757d;
    margin-bottom: 15px;
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding-bottom: 8px;
}

.explanation-card.expanded .explanation-description {
    -webkit-line-clamp: unset;
    line-clamp: unset;
    overflow: visible;
}

.explanation-details {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    flex-grow: 1;
    overflow: hidden;
}

.explanation-details p {
    margin: 0;
    color: #495057;
    font-style: italic;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.8;
    padding-bottom: 8px;
}

.explanation-card.expanded .explanation-details p {
    -webkit-line-clamp: unset;
    line-clamp: unset;
    overflow: visible;
}

.explanation-reference {
    font-size: 0.9em;
    color: #6c757d;
    border-top: 1px solid #dee2e6;
    padding-top: 10px;
    margin-top: 15px;
    line-height: 1.6;
}

.explanation-reference strong {
    color: #495057;
    margin-right: 0.5rem;
}

.reference-link {
    color: #0066cc;
    text-decoration: none;
    border-bottom: 1px dotted #0066cc;
    transition: all 0.3s ease;
    margin: 0 0.2rem;
}

.reference-link:hover {
    color: #004499;
    border-bottom: 1px solid #004499;
    background-color: rgba(0, 102, 204, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
}

.reference-text {
    color: #6c757d;
    margin: 0 0.2rem;
}

/* Expandable Card Styles for Universal Cetasikas */
.explanation-card.expandable {
    position: relative;
    display: flex;
    flex-direction: column;
}

.explanation-card.expandable:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

/* Card Footer with Expand Button */
.card-footer {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.pdf-button {
    background: linear-gradient(135deg, #607d8b 0%, #455a64 100%);
    box-shadow: 0 2px 8px rgba(96, 125, 139, 0.3);
    width: 100%;
    justify-content: center;
}

.pdf-button:hover {
    background: linear-gradient(135deg, #546e7a 0%, #37474f 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(96, 125, 139, 0.4);
}

.expand-button {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Noto Sans Sinhala', sans-serif;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.expand-button:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea87a 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.expand-button:active {
    transform: translateY(0);
}

/* Category-specific expand button colors matching card labels */
.explanation-card.universal .expand-button {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.explanation-card.universal .expand-button:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea87a 100%);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.explanation-card.particular .expand-button {
    background: linear-gradient(135deg, #17a2b8 0%, #20c9e0 100%);
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.3);
}

.explanation-card.particular .expand-button:hover {
    background: linear-gradient(135deg, #138496 0%, #1ab5cc 100%);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.4);
}

.explanation-card.unwholesome .expand-button {
    background: linear-gradient(135deg, #dc3545 0%, #e4606d 100%);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.explanation-card.unwholesome .expand-button:hover {
    background: linear-gradient(135deg, #c82333 0%, #d63947 100%);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.explanation-card.beautiful .expand-button {
    background: linear-gradient(135deg, #6f42c1 0%, #8c5dd1 100%);
    box-shadow: 0 2px 8px rgba(111, 66, 193, 0.3);
}

.explanation-card.beautiful .expand-button:hover {
    background: linear-gradient(135deg, #5a32a3 0%, #7142b8 100%);
    box-shadow: 0 4px 12px rgba(111, 66, 193, 0.4);
}

.expand-indicator {
    font-size: 0.9em;
    transition: transform 0.3s ease;
    font-weight: bold;
}

.expand-text {
    font-size: 0.95em;
}

/* Deep Content Section */
.deep-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out;
    margin-top: 0;
}

.explanation-card.expanded .deep-content {
    max-height: 3000px;
    margin-top: 20px;
    transition: max-height 0.6s ease-in;
}

.deep-content-text {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #28a745;
    font-family: 'Noto Sans Sinhala', sans-serif;
    font-size: 0.95em;
    line-height: 1.8;
    color: #212529;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    margin: 0;
}


/* Responsive adjustments for expandable cards */
@media (max-width: 768px) {
    .deep-content-text {
        padding: 15px;
        font-size: 0.9em;
        line-height: 1.7;
    }

    .explanation-card.expanded .deep-content {
        max-height: 5000px;
    }

    .expand-button {
        padding: 8px 16px;
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    .deep-content-text {
        padding: 12px;
        font-size: 0.85em;
        line-height: 1.6;
    }

    .expand-button {
        padding: 8px 14px;
        font-size: 0.8em;
    }
}



.explanations-stats {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

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

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2em;
    font-weight: 700;
    color: #007bff;
    display: block;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9em;
    margin-top: 5px;
}

/* Enhanced Comparison Section */
.comparison-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
    transform: translateY(-2px);
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
    transform: translateY(-2px);
}

.comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.comparison-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-badge {
    background: #e9ecef;
    color: #495057;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

.comparison-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid #dee2e6;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 600;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

.tab-btn:hover {
    color: #007bff;
}

.tab-content {
    position: relative;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.chart-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.analysis-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.analysis-item {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.analysis-title {
    font-weight: 700;
    color: #212529;
    margin-bottom: 10px;
}

.analysis-content {
    color: #495057;
    line-height: 1.6;
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
    .explanations-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .explanations-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .comparison-actions {
        flex-direction: column;
    }

    .comparison-header {
        flex-direction: column;
        align-items: stretch;
    }

    .comparison-tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1;
        min-width: 100px;
    }

    .chart-container {
        padding: 20px;
        min-height: 300px;
    }

    .analysis-container {
        padding: 20px;
    }

    .explanations-controls {
        gap: 15px;
    }

    .filter-group,
    .search-group {
        width: 100%;
    }

    .category-count {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .explanation-card {
        padding: 15px;
    }

    .explanation-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .explanation-title {
        font-size: 1.1em;
    }

    .explanations-controls {
        flex-direction: column;
        gap: 10px;
    }

    .filter-group select,
    .search-group input {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}

/* Large screen optimization (Desktop) */
@media (min-width: 1025px) {
    .container {
        max-width: 1400px;
    }

    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .explanations-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .hero-title {
        font-size: 3rem;
    }

    .section-title {
        font-size: 3rem;
    }
}

/* Medium tablet landscape and small desktop */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 0 20px;
        max-width: 100%;
    }

    .hero-container {
        padding: 0 20px;
    }

    .nav-container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .explanations-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .selection-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .nav-menu {
        gap: 0.8rem;
        flex-wrap: nowrap;
    }

    .nav-link {
        padding: 0.3rem 0.6rem;
        font-size: 0.85rem;
    }

    .hero-description {
        font-size: 1.05rem;
    }

    .table-container {
        overflow-x: auto;
        overflow-y: visible;
        width: 100%;
        -webkit-overflow-scrolling: touch;
        display: block;
    }

    .data-table {
        font-size: 0.95rem;
        min-width: 1200px;
        width: max-content;
        display: table;
        table-layout: auto;
    }

    .data-table th,
    .data-table td {
        padding: 12px;
    }

    /* Fix column widths for tablet */
    .data-table th:first-child,
    .data-table td:first-child {
        min-width: 60px;
        width: 70px;
    }

    .data-table th:nth-child(2),
    .data-table td:nth-child(2) {
        min-width: 260px;
        width: 300px;
        white-space: normal;
    }

    .data-table th:nth-child(3),
    .data-table td:nth-child(3) {
        min-width: 160px;
        width: 180px;
        white-space: normal;
    }

    .data-table th:nth-child(4),
    .data-table td:nth-child(4) {
        min-width: 220px;
        width: 250px;
        white-space: normal;
    }

    .data-table th:nth-child(5),
    .data-table td:nth-child(5) {
        min-width: 300px;
        width: 400px;
        white-space: normal;
    }

    .comparison-tool {
        padding: 1.5rem;
        width: 100%;
        box-sizing: border-box;
    }

    .category-card,
    .analysis-card {
        padding: 1.5rem;
        width: 100%;
        box-sizing: border-box;
    }

    /* Fix table containers */
    .table-container {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        box-sizing: border-box;
    }

    /* Fix all grid containers */
    .categories-grid,
    .analysis-grid,
    .explanations-grid {
        width: 100%;
        box-sizing: border-box;
    }

    /* Comparison table for tablet */
    .comparison-table {
        min-width: 700px;
        font-size: 0.9rem;
    }

    .comparison-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Mental States Section Styles */
.mental-states {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 4rem 0;
    position: relative;
}

.mental-states::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1);
}

/* Mental States Grid */
.mental-states-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.mental-state-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.mental-state-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

.raga-card:hover {
    border-color: #ff6b6b;
    box-shadow: 0 16px 48px rgba(255, 107, 107, 0.2);
}

.dvesha-card:hover {
    border-color: #ffa500;
    box-shadow: 0 16px 48px rgba(255, 165, 0, 0.2);
}

.moha-card:hover {
    border-color: #6c757d;
    box-shadow: 0 16px 48px rgba(108, 117, 125, 0.2);
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 1.5rem 1rem;
    text-align: center;
    position: relative;
}

.raga-card .card-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
}

.dvesha-card .card-header {
    background: linear-gradient(135deg, #ffa500 0%, #ffcc80 100%);
}

.moha-card .card-header {
    background: linear-gradient(135deg, #6c757d 0%, #adb5bd 100%);
}

.state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.card-header h3 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.card-content {
    padding: 2rem 1.5rem;
}

.card-content p {
    color: #6c757d;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 500;
}

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

.state-features li {
    background: #f8f9fa;
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border-left: 4px solid;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.raga-card .state-features li {
    border-left-color: #ff6b6b;
}

.dvesha-card .state-features li {
    border-left-color: #ffa500;
}

.moha-card .state-features li {
    border-left-color: #6c757d;
}

.state-features li:hover {
    background: #e9ecef;
    transform: translateX(4px);
}

.card-footer {
    padding: 1.5rem;
    background: #f8f9fa;
    text-align: center;
    border-top: 1px solid #e9ecef;
}

.explore-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    text-decoration: none;
}

/* Make explore-btn work as link */
a.explore-btn {
    border: none;
    text-decoration: none;
    color: white;
}

a.explore-btn:hover {
    color: white;
    text-decoration: none;
}

.raga-card .explore-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
}

.dvesha-card .explore-btn {
    background: linear-gradient(135deg, #ffa500 0%, #ffcc80 100%);
}

.moha-card .explore-btn {
    background: linear-gradient(135deg, #6c757d 0%, #adb5bd 100%);
}

.explore-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    filter: brightness(1.1);
}

/* Mind Section Styles */
.mind-section {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    padding: 4rem 0;
    position: relative;
}

.mind-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2196f3, #9c27b0, #4caf50);
}

.mind-card-container {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.mind-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transition: all 0.4s ease;
    cursor: pointer;
    border: 3px solid transparent;
    max-width: 500px;
    width: 100%;
}

.mind-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    border-color: #2196f3;
}

.mind-card .card-header {
    background: linear-gradient(135deg, #2196f3 0%, #21cbf3 100%);
    color: white;
    padding: 3rem 2rem 2rem;
    text-align: center;
    position: relative;
}

.mind-card .state-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.mind-card .card-header h3 {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 700;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

.mind-card .card-content {
    padding: 2.5rem 2rem;
}

.mind-card .card-content p {
    color: #424242;
    font-size: 1.2rem;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 500;
    line-height: 1.6;
}

.mind-card .state-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mind-card .state-features li {
    background: linear-gradient(135deg, #f3e5f5 0%, #e3f2fd 100%);
    margin-bottom: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border-left: 5px solid #2196f3;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.mind-card .state-features li:hover {
    background: linear-gradient(135deg, #e1f5fe 0%, #f3e5f5 100%);
    transform: translateX(8px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
}

.mind-card .card-footer {
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e3f2fd 100%);
    text-align: center;
    border-top: 2px solid #e3f2fd;
}

.mind-card .explore-btn {
    background: linear-gradient(135deg, #2196f3 0%, #21cbf3 100%);
    color: white;
    border: none;
    padding: 1rem 3rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.mind-card .explore-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.4);
    filter: brightness(1.1);
}

/* Responsive adjustments for mind card */
@media (max-width: 768px) {
    .mind-card-container {
        padding: 0 1rem;
    }

    .mind-card {
        max-width: 100%;
    }

    .mind-card .card-header {
        padding: 2rem 1.5rem 1.5rem;
    }

    .mind-card .state-icon {
        font-size: 3rem;
    }

    .mind-card .card-header h3 {
        font-size: 1.8rem;
    }

    .mind-card .card-content {
        padding: 2rem 1.5rem;
    }

    .mind-card .explore-btn {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
}

/* Analysis Modal Styles */
.analysis-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.analysis-modal:not([style*="display: block"]) {
    pointer-events: none !important;
}

.analysis-modal:not([style*="display: block"]) .modal-overlay {
    pointer-events: none !important;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    max-width: 90vw;
    max-height: 90vh;
    width: 800px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.raga-modal .modal-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
}

.dvesha-modal .modal-header {
    background: linear-gradient(135deg, #ffa500 0%, #ffcc80 100%);
}

.moha-modal .modal-header {
    background: linear-gradient(135deg, #6c757d 0%, #adb5bd 100%);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    max-height: 60vh;
    overflow-y: auto;
    padding: 2rem;
}

.modal-footer {
    padding: 1.5rem 2rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Analysis Content Styles */
.analysis-section {
    margin-bottom: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    border-left: 4px solid #667eea;
}

.raga-analysis .analysis-section {
    border-left-color: #ff6b6b;
}

.dvesha-analysis .analysis-section {
    border-left-color: #ffa500;
}

.moha-analysis .analysis-section {
    border-left-color: #6c757d;
}

.analysis-section h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.cause-item,
.condition-item,
.remedy-item {
    background: white;
    margin-bottom: 0.75rem;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #dee2e6;
    font-size: 0.95rem;
}

.remedy-item {
    background: #d4edda;
    border-left-color: #28a745;
}

.quote-block {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    font-style: italic;
    color: #856404;
}

.quote-source {
    text-align: right;
    font-weight: 600;
    margin-top: 0.5rem;
    color: #533f00;
}

.study-reference {
    background: #e7f3ff;
    border: 1px solid #b3d7ff;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    color: #004085;
}

.reference-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mental-states-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .mental-state-card {
        margin: 0 1rem;
    }

    .modal-content {
        width: 95vw;
        max-height: 95vh;
    }

    .modal-header {
        padding: 1rem 1.5rem;
    }

    .modal-body {
        padding: 1.5rem;
        max-height: 65vh;
    }

    .modal-footer {
        padding: 1rem 1.5rem;
        flex-direction: column;
    }

    .state-icon {
        font-size: 2.5rem;
    }

    .card-header h3 {
        font-size: 1.5rem;
    }
}

.thought-input-section {
    margin-bottom: 3rem;
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.input-container h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    font-weight: 600;
}

#thoughtInput {
    width: 100%;
    min-height: 150px;
    padding: 1.5rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Noto Sans Sinhala', sans-serif;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
}

#thoughtInput:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.input-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}

.analysis-results {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.results-header {
    text-align: center;
    margin-bottom: 2rem;
}

.results-header h3 {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.dominant-factor {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
}

.three-poisons-analysis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.poison-button {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.poison-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.poison-button.active {
    border-color: #007bff;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.05) 0%, rgba(0, 123, 255, 0.1) 100%);
}

.poison-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.poison-content h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.poison-content p {
    color: #6c757d;
    font-size: 0.95rem;
    margin: 0;
}

.poison-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e9ecef;
    transition: all 0.3s ease;
}

.poison-indicator.active {
    background: #28a745;
    transform: scale(1.2);
}

.raga-btn .poison-indicator.active {
    background: #ff6b6b;
}

.dvesha-btn .poison-indicator.active {
    background: #ffa500;
}

.moha-btn .poison-indicator.active {
    background: #6c757d;
}

.detailed-analysis {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
    border: 1px solid #e9ecef;
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #dee2e6;
}

.analysis-header h4 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin: 0;
}

.analysis-section {
    margin-bottom: 2rem;
}

.analysis-section h5 {
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-left: 1rem;
    border-left: 4px solid #007bff;
}

.causes-list {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
}

.cause-item {
    background: #f8f9fa;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    border-left: 4px solid #ff6b6b;
    font-size: 0.95rem;
}

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

.interconnection-item {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    text-align: center;
}

.interconnection-item .icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.interconnection-item h6 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.interconnection-item p {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
}

.teachings-content,
.guidance-content {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
}

.teaching-quote {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    font-style: italic;
    color: #856404;
}

.guidance-step {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    color: #155724;
}

.guidance-step strong {
    color: #0b3629;
}

.explore-section {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #dee2e6;
}

#exploreDeeper {
    background: linear-gradient(135deg, #ff6b6b 0%, #4ecdc4 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#exploreDeeper:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

/* Responsive Design for Thought Analysis */
@media (max-width: 768px) {
    .thought-input-section {
        padding: 1.5rem;
    }

    .three-poisons-analysis {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .poison-button {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .poison-icon {
        font-size: 1.5rem;
    }

    .interconnections {
        grid-template-columns: 1fr;
    }

    .input-actions {
        flex-direction: column;
    }

    .analysis-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* Citta Detail Modal Styles */
.citta-detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.citta-detail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.citta-detail-content {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 2rem;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 10001;
    animation: slideUp 0.3s ease;
}

.citta-detail-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.citta-detail-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.citta-detail-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.citta-detail-header h2 {
    color: white;
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

.citta-detail-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.citta-detail-meta span {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.citta-detail-body {
    color: white;
}

.citta-detail-description {
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.8;
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 10px;
}

.citta-detail-cetasikas h3,
.citta-detail-references h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.cetasikas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.cetasika-factor {
    background: rgba(255, 255, 255, 0.15);
    padding: 1rem;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.cetasika-factor.present {
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.2);
}

.cetasika-factor.absent {
    opacity: 0.6;
    border-color: rgba(255, 255, 255, 0.2);
}

.cetasika-factor:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.factor-name {
    color: white;
    font-weight: 600;
}

.factor-status {
    font-size: 1.2rem;
    font-weight: bold;
}

.cetasika-factor.present .factor-status {
    color: #4ade80;
}

.cetasika-factor.absent .factor-status {
    color: rgba(255, 255, 255, 0.5);
}

.citta-detail-references {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
}

.reference-item {
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 10px;
}

.reference-item strong {
    color: white;
    display: block;
    margin-bottom: 0.5rem;
}

.reference-item a {
    color: #ffd700;
    text-decoration: none;
    transition: all 0.3s ease;
}

.reference-item a:hover {
    color: #ffed4e;
    text-decoration: underline;
}

.reference-item span {
    color: rgba(255, 255, 255, 0.9);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

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

/* Responsive Design for Citta Detail Modal */
@media (max-width: 768px) {
    .citta-detail-content {
        width: 95%;
        padding: 1.5rem;
        max-height: 95vh;
    }

    .citta-detail-header h2 {
        font-size: 1.5rem;
    }

    .cetasikas-grid {
        grid-template-columns: 1fr;
    }

    .citta-detail-meta {
        flex-direction: column;
    }
}

/* Chatbot Widget -------------------------------------------------- */

.chatbot-launcher {
    position: fixed;
    bottom: 120px;
    right: 24px;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.2rem;
    background: linear-gradient(135deg, #f7b733, #fc4a1a);
    color: #fff;
    border: none;
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 1050;
}

.chatbot-launcher:hover,
.chatbot-launcher:focus {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
}

.chatbot-launcher:focus {
    outline: 3px solid rgba(252, 74, 26, 0.35);
    outline-offset: 3px;
}

.chatbot-launcher-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    font-size: 1rem;
}

.chatbot-launcher-label {
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.chatbot-widget {
    position: fixed;
    bottom: 200px;
    right: 24px;
    width: min(92vw, 360px);
    max-height: 78vh;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 22px 54px rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 1050;
}

.chatbot-widget.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.chatbot-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: .35rem 1.35rem .35rem;
    background: linear-gradient(135deg, rgba(252, 74, 26, 0.14), rgba(247, 183, 51, 0.14));
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.chatbot-title-group h3 {
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
    color: #2c3e50;
}

.chatbot-title-group p {
    font-size: 0.85rem;
    color: #5a6a73;
    margin: 0;
}

.chatbot-close {
    background: none;
    border: none;
    font-size: 1.35rem;
    color: #34495e;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.chatbot-close:hover,
.chatbot-close:focus {
    color: #e74c3c;
}

.chatbot-messages {
    flex: 1;
    padding: 1rem 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    background: #f7f9fb;
}

.chatbot-message {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.chatbot-message .chatbot-message-role {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.chatbot-message .chatbot-message-body {
    padding: 0.75rem 0.95rem;
    border-radius: 14px;
    line-height: 1.6;
    font-size: 0.9rem;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.chatbot-message.user .chatbot-message-role {
    color: #f26a2e;
    margin-left: auto;
}

.chatbot-message.user .chatbot-message-body {
    background: #fff4ec;
    border: 1px solid rgba(242, 106, 46, 0.25);
    color: #8c4b20;
    margin-left: auto;
}

.chatbot-message.assistant .chatbot-message-role {
    color: #1f6f8b;
}

.chatbot-message.assistant .chatbot-message-body {
    background: #ffffff;
    border: 1px solid rgba(31, 111, 139, 0.15);
    color: #2c3e50;
}

.chatbot-form {
    padding: 0.9rem 1.1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.chatbot-input-label {
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7f8c8d;
}

.chatbot-input-row {
    display: flex;
    gap: 0.75rem;
}

.chatbot-input {
    flex: 1;
    resize: none;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    font-family: inherit;
    font-size: 0.95rem;
    min-height: 78px;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chatbot-input:focus {
    outline: none;
    border-color: rgba(31, 111, 139, 0.6);
    box-shadow: 0 0 0 3px rgba(31, 111, 139, 0.18);
}

.chatbot-send {
    min-height: 45px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #1f6f8b, #27496d);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chatbot-send:hover,
.chatbot-send:focus {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(31, 111, 139, 0.25);
}

.chatbot-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.chatbot-status {
    padding: 0 1.25rem 1.1rem;
    font-size: 0.8rem;
    color: #6c7a89;
}

.chatbot-status-error {
    color: #c0392b;
}

.chatbot-status.success {
    color: #1f6f8b;
}

/* Typing indicator */
.chatbot-typing .chatbot-message-body {
    display: flex;
    align-items: center;
    min-height: 1.5rem;
}

.typing-dots {
    display: inline-flex;
    gap: 0.25rem;
}

.typing-dots span {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: #1f6f8b;
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    60%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    30% {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 640px) {
    .chatbot-widget {
        right: 16px;
        bottom: 180px;
        width: min(94vw, 340px);
    }

    .chatbot-launcher {
        right: 16px;
        bottom: 100px;
    }
}

@media (max-width: 480px) {
    .chatbot-widget {
        right: 12px;
        left: 12px;
        bottom: 168px;
        width: auto;
    }

    .chatbot-input-row {
        flex-direction: column;
    }

    .chatbot-send {
        justify-content: center;
        width: 100%;
    }
}

/* Visual Navigation Graph Integration Styles */

p.hero-subtitle {
    TEXT-ALIGN: CENTER;
}

/* ============================================
   Feedback Box Section
   ============================================ */

.feedback-box-section {
    width: 100%;
    padding: 4rem 2rem;
    background: linear-gradient(180deg, rgba(139, 90, 43, 0.05) 0%, rgba(255, 248, 240, 0.8) 100%);
    margin-top: 4rem;
    animation: fadeUp 0.8s ease-out;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.feedback-container {
    max-width: 700px;
    margin: 0 auto;
    background: #fffef8;
    border: 2px solid #d4c5a9;
    border-radius: 20px;
    padding: 3rem 2.5rem;
    box-shadow: 0 8px 24px rgba(139, 90, 43, 0.15), 0 2px 8px rgba(139, 90, 43, 0.1);
    position: relative;
}

.feedback-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #8b5a2b 0%, #d4a574 50%, #f4e4c1 100%);
    border-radius: 20px;
    z-index: -1;
    opacity: 0.3;
}

.feedback-title {
    font-size: 2rem;
    font-weight: 600;
    color: #8b5a2b;
    text-align: center;
    margin-bottom: 0.75rem;
    font-family: 'Noto Sans Sinhala', 'Malithi Web', 'Iskoola Pota', sans-serif;
}

.feedback-subtext {
    font-size: 1rem;
    color: #6b5a4a;
    text-align: center;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.feedback-textarea,
.feedback-email {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid #d4c5a9;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    background: #fffef8;
    color: #4a3a2a;
    transition: all 0.3s ease;
    resize: vertical;
}

.feedback-textarea:focus,
.feedback-email:focus {
    outline: none;
    border-color: #8b5a2b;
    box-shadow: 0 0 0 3px rgba(139, 90, 43, 0.1);
    background: #ffffff;
}

.feedback-textarea::placeholder,
.feedback-email::placeholder {
    color: #a89b8a;
    font-style: italic;
}

.feedback-submit-btn {
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, #8b5a2b 0%, #a67c52 100%);
    color: #fffef8;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(139, 90, 43, 0.3);
    position: relative;
    overflow: hidden;
}

.feedback-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.feedback-submit-btn:hover::before {
    left: 100%;
}

.feedback-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 90, 43, 0.4);
    background: linear-gradient(135deg, #a67c52 0%, #8b5a2b 100%);
}

.feedback-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(139, 90, 43, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .feedback-box-section {
        padding: 3rem 1.5rem;
        margin-top: 3rem;
    }

    .feedback-container {
        padding: 2rem 1.5rem;
        border-radius: 16px;
    }

    .feedback-title {
        font-size: 1.75rem;
    }

    .feedback-subtext {
        font-size: 0.95rem;
    }

    .feedback-textarea,
    .feedback-email {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }

    .feedback-submit-btn {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .feedback-box-section {
        padding: 2rem 1rem;
        margin-top: 2rem;
    }

    .feedback-container {
        padding: 1.5rem 1.25rem;
        border-radius: 14px;
    }

    .feedback-title {
        font-size: 1.5rem;
    }

    .feedback-subtext {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }

    .feedback-form {
        gap: 1rem;
    }

    .feedback-textarea,
    .feedback-email {
        padding: 0.75rem 0.875rem;
        font-size: 0.9rem;
    }

    .feedback-submit-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
        width: 100%;
    }
}