/* 
 * Consolidated Styles for Muruga Website
 * Combines: muruga.css + sidebar.css + custom mobile improvements
 */

/* Base Font Family for Tamil Content */
@font-face {
    font-family: 'Tamil';
    src: url('../fonts/Tamil/TAMNM0NT.TTF') format('truetype'),
         url('../fonts/Tamil/TABAB0BT.TTF') format('truetype'),
         url('../fonts/Tamil/TAMIL0NT.TTF') format('truetype');
    font-display: swap;
    unicode-range: U+0B80-0BFF;
}

/* Force font loading and prevent invisible text */
body {
    font-display: swap;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

div, h1, p, h2, span, button, dd, dt {
    font-family: 'Noto Sans Tamil', 'Tamil', 'Latha', 'Vijaya', sans-serif;
}

/* ====== SIDEBAR NAVIGATION ====== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transition: width 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.sidebar:hover {
    width: 250px;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-bottom: 10px;
}

.sidebar-header h3 {
    color: white;
    font-size: 16px;
    margin: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar:hover .sidebar-header h3 {
    opacity: 1;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-menu a:hover {
    background: rgba(255,255,255,0.1);
    padding-left: 30px;
}

.sidebar-menu a.active {
    background: rgba(255,255,255,0.2);
    border-right: 4px solid #ffd700;
}

.sidebar-menu i {
    font-size: 24px;
    width: 40px;
    text-align: center;
    color: #ffd700;
}

.sidebar-menu span {
    margin-left: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    font-weight: 500;
}

.sidebar:hover .sidebar-menu span {
    opacity: 1;
}

/* ====== MAIN CONTENT AREA ====== */
.main-content {
    margin-left: 80px;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    background: var(--bg-color);
}

.sidebar:hover ~ .main-content {
    margin-left: 250px;
}

.content-container {
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.page-title {
    color: #333;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
    font-family: 'Catamaran', sans-serif;
}

/* ====== MOBILE TOGGLE BUTTON ====== */
.mobile-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1002;
    background: #667eea;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    width: 60px;
    height: 60px;
    font-size: 20px;
}

.mobile-toggle:hover {
    background: #5a6fd8;
    transform: scale(1.1);
}

/* ====== RESPONSIVE DESIGN ====== */
@media (max-width: 768px) {
    .sidebar {
        width: 0;
        overflow: hidden;
        transition: width 0.3s ease;
    }
    
    .sidebar.mobile-open {
        width: 250px;
        overflow: visible;
        box-shadow: 2px 0 20px rgba(0,0,0,0.3);
        z-index: 1001;
    }
    
    /* Show menu text immediately on mobile when sidebar is open */
    .sidebar.mobile-open .sidebar-menu span {
        opacity: 1 !important;
        display: inline !important;
    }
    
    .sidebar.mobile-open .sidebar-header h3 {
        opacity: 1 !important;
        display: block !important;
    }
    
    /* Mobile overlay when sidebar is open */
    .sidebar.mobile-open::after {
        content: '';
        position: fixed;
        top: 0;
        left: 250px;
        width: calc(100vw - 250px);
        height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        pointer-events: auto;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-toggle {
        display: block;
    }
    
    .content-container {
        padding: 15px;
    }
    
    .temple-intro {
        padding: 20px !important;
        margin-bottom: 20px !important;
    }
    
    .temple-intro h1 {
        font-size: 1.8em !important;
    }
    
    .temple-intro::before,
    .temple-intro::after {
        display: none;
    }
    
    .feature-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .feature-card {
        padding: 20px !important;
    }
}

@media (min-width: 769px) {
    .mobile-toggle {
        display: none;
    }
}

/* ====== CARD STYLES FOR CONTENT ====== */
.content-card {
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 30px;
}

.content-card h2 {
    color: #667eea;
    margin-bottom: 20px;
}

/* ====== TEMPLE INTRO STYLES ====== */
.temple-intro {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.temple-intro::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 120px;
    width: 100px;
    height: 100px;
    background: url('../images/peacock.jpg') no-repeat center;
    background-size: cover;
    border-radius: 50%;
    box-shadow: 0 0 20px #ffd700, 0 0 40px #ffd700, 0 0 60px #ffd700;
    z-index: 1;
}

.temple-intro::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 120px;
    width: 100px;
    height: 100px;
    background: url('../images/vel.jpg') no-repeat center;
    background-size: cover;
    border-radius: 50%;
    box-shadow: 0 0 20px #ffd700, 0 0 40px #ffd700, 0 0 60px #ffd700;
    z-index: 1;
}

.temple-intro h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
}

/* ====== FEATURE GRID ====== */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature-card {
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
}

.feature-card img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 20px;
    object-fit: cover;
    box-shadow: 0 0 15px #ffd700, 0 0 30px #ffd700, 0 0 45px #ffd700;
}

.feature-card h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.feature-card p {
    color: #666;
    margin-bottom: 20px;
}

/* ====== INFO SECTION ====== */
.info-section {
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 30px;
    margin-top: 30px;
    box-shadow: var(--shadow);
}

.timing-info {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-color);
    padding: 20px;
    margin: 20px 0;
    border-radius: 0 10px 10px 0;
    color: var(--text-color);
}

.highlight {
    background: var(--accent-color);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--bg-color);
    font-weight: bold;
}

.info-section h2 {
    color: green;
}

.timing-info .fa-heart {
    color: red !important;
}

.timing-info ul li:last-child {
    color: red;
    font-weight: bold;
}

.timing-info ul li:nth-last-child(2) {
    color: green;
    font-weight: bold;
}

/* ====== BUTTON STYLES ====== */
.btn-temple {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.3s ease;
}

.btn-temple:hover {
    transform: translateY(-2px);
    color: white;
    text-decoration: none;
}

/* ====== LEGACY MURUGA STYLES (kept for compatibility) ====== */
.carousel-inner > .item > img,
.carousel-inner > .item > a > img {
    width: 70%;
    height: 30%;
    margin: auto;
}

IMG#banner {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.myheading {
    font-size: 2em;
    color: #fff;
    margin: 0;
    text-shadow: 2px 2px 5px green;
    line-height: 150%;
}

#banner {
    color: #006600;
}

#donate {
    color: #000066;
}

.intro p {
    color: #fff;
}

#one {
    color: #00FF33;
    font-size: x-large;
}

#two {
    color: #FFFF00;
    font-size: x-large;
}

#three {
    color: #F8B255;
    font-size: x-large;
}

#four {
    color: #FFFFFF;
    font-size: x-large;
}

#five {
    color: #CCFFFF;
    font-size: x-large;
}

.section {
    text-align: center;
}

#infoMenu li a {
    color: #fff;
}

.subhead {
    font-size: x-large;
    height: 50px;
    text-align: center;
    border-style: solid;
    border-width: 5px;
    background-color: yellow;
    box-shadow: 10px 10px 5px #888888;
}

.big {
    line-height: 125%;
    color: white;
    font-size: large;
}

.projects {
    font-size: x-large;
    line-height: 150%;
    color: blue;
}

#myPanel {
    padding: 10px;
    display: none;
    background: #00BFFF;
}

#flip {
    position: absolute;
    top: 0px;
    left: 0px;
}

.header,
.footer {
    box-sizing: border-box;
    width: 100%;
    position: fixed;
}

.header {
    top: 0;
}

.footer {
    bottom: 0;
}

.apm {
    font-size: large;
    font-style: italic;
    line-height: 150%;
    color: white;
    text-align: left;
}

#box {
    position: relative;
    background: yellow;
    width: 1200px;
    height: 150px;
    margin: 0px -10px;
}

#ribbon {
    position: absolute;
    top: 15px;
    left: -20px;
    width: 360px;
    height: 65px;
    background: #ff2702;
    color: white;
    padding: 20px 40px;
    font-size: 36px;
    font-weight: bold;
    border-radius: 5px 5px 0 0;
    box-shadow: 0 0 8px #333;
    text-shadow: 0 0 8px #000;
}

#ribbon:before {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 0;
    border-top: solid 10px #ff2702;
    border-right: solid 10px #ff2702;
    border-bottom: solid 10px transparent;
    border-left: solid 10px transparent;
}

#ribbon:after {
    content: '';
    position: absolute;
    bottom: -20px;
}

span.img-rounded {
    -webkit-border-radius: 16px;
    -moz-border-radius: 16px;
    border-radius: 16px;
    border: 1px solid #1F00FF;
    height: 175px;
    width: 175px;
    display: inline-block;
    margin: 10px;
}

span.img-rounded > img {
    -webkit-border-radius: 16px;
    -moz-border-radius: 16px;
    border-radius: 16px;
    height: 175px;
    width: 175px;
}

.circular {
    width: 150px;
    height: 150px;
    border-radius: 150px;
    -webkit-border-radius: 150px;
    -moz-border-radius: 150px;
    background: url(http://link-to-your/image.jpg) no-repeat;
    box-shadow: 0 0 28px rgba(255, 255, 255, 1);
    -webkit-box-shadow: 0 0 28px rgba(255, 255, 255, 1);
    -moz-box-shadow: 0 0 28px rgba(255, 255, 255, 1);
}

td, th {
    color: white;
    text-align: left;
}

.pooja {
    font-size: x-large;
    line-height: 150%;
    color: indigo;
}

/* ====== THEME TOGGLE STYLES ====== */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1003;
    background: var(--primary-color, #667eea);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    width: 50px;
    height: 50px;
    font-size: 18px;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: var(--primary-hover, #5a6fd8);
}

/* ====== DARK THEME VARIABLES ====== */
:root {
    --primary-color: #667eea;
    --primary-hover: #5a6fd8;
    --secondary-color: #764ba2;
    --bg-color: #f8f9fa;
    --card-bg: white;
    --text-color: #333;
    --text-muted: #666;
    --border-color: rgba(0,0,0,0.1);
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --accent-color: #ffd700;
}

/* ====== BASE STYLES FOR DARK MODE COMPATIBILITY ====== */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

[data-theme="dark"] {
    --primary-color: #4c63d2;
    --primary-hover: #3c52c8;
    --secondary-color: #6a4c93;
    --bg-color: #1a1a1a;
    --card-bg: #2d2d2d;
    --text-color: #e0e0e0;
    --text-muted: #b0b0b0;
    --border-color: rgba(255,255,255,0.1);
    --shadow: 0 2px 10px rgba(0,0,0,0.3);
    --accent-color: #ffd700;
}

/* Additional dark mode visibility fixes */
[data-theme="dark"] h1,
[data-theme="dark"] h2, 
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--text-color) !important;
}

[data-theme="dark"] p,
[data-theme="dark"] span:not(.sidebar-menu span),
[data-theme="dark"] div {
    color: var(--text-color);
}

[data-theme="dark"] .video-btn {
    background: var(--card-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}

[data-theme="dark"] .video-btn:hover {
    background: var(--primary-color);
    color: white;
}

[data-theme="dark"] .category-content {
    background: var(--card-bg);
    color: var(--text-color);
}

[data-theme="dark"] .photo-overlay {
    background: rgba(0,0,0,0.8);
    color: white;
}

/* ====== APPLY THEME VARIABLES ====== */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.main-content {
    background: var(--bg-color);
}

.content-card, .info-section, .feature-card {
    background: var(--card-bg);
    color: var(--text-color);
    box-shadow: var(--shadow);
}

.feature-card p {
    color: var(--text-muted);
}

.content-card h2 {
    color: var(--primary-color);
}

.info-section h2 {
    color: var(--primary-color);
}

.page-title {
    color: var(--text-color);
    border-bottom-color: var(--primary-color);
}

/* ====== MOBILE THEME TOGGLE ====== */
@media (max-width: 768px) {
    .theme-toggle {
        top: 10px;
        right: 130px;
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
}

/* ====== SEARCH FUNCTIONALITY STYLES ====== */
.search-container {
    position: relative;
    max-width: 400px;
    margin: 20px auto;
}

.search-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 16px;
    background: var(--card-bg);
    color: var(--text-color);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-50%) scale(1.1);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: var(--shadow);
}

.search-result-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background: var(--bg-color);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-title {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.search-result-description {
    color: var(--text-muted);
    font-size: 14px;
}

/* ====== LOADING STATES ====== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    color: var(--text-color);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

/* ====== SKELETON LOADING ====== */
.skeleton {
    background: linear-gradient(90deg, var(--border-color) 25%, transparent 50%, var(--border-color) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 20px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.skeleton-title {
    height: 30px;
    width: 60%;
    margin-bottom: 15px;
    border-radius: 6px;
}

.skeleton-image {
    height: 200px;
    border-radius: 10px;
    margin-bottom: 15px;
}

/* ====== BREADCRUMB NAVIGATION ====== */
.breadcrumb {
    background: transparent;
    padding: 15px 0;
    margin-bottom: 20px;
    font-size: 14px;
}

.breadcrumb-item {
    display: inline-block;
    color: var(--text-muted);
}

.breadcrumb-item + .breadcrumb-item::before {
    content: " > ";
    padding: 0 8px;
    color: var(--text-muted);
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--text-color);
    font-weight: 500;
}

/* ====== IMAGE OPTIMIZATIONS ====== */
img {
    max-width: 100%;
    height: auto;
}

img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.loaded {
    opacity: 1;
}

.lazy {
    background: var(--border-color);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lazy::before {
    content: '📷';
    font-size: 2em;
    opacity: 0.5;
}

/* ====== ANIMATIONS ====== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease forwards;
}

/* ====== ENHANCED MOBILE INTERACTIONS ====== */
.touch-device .sidebar-menu a {
    padding: 20px;
    font-size: 16px;
}

.touch-device .mobile-toggle,
.touch-device .theme-toggle {
    width: 55px;
    height: 55px;
    font-size: 20px;
}

.touch-device .btn-temple {
    padding: 15px 30px;
    font-size: 16px;
}

/* ====== FOCUS STYLES FOR ACCESSIBILITY ====== */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.skip-link:focus {
    outline: none;
}

/* ====== LANGUAGE SWITCHER STYLES ====== */
.language-switcher {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1003;
    font-family: var(--primary-font, 'Catamaran'), sans-serif;
    display: block !important;
}

.language-toggle {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    min-width: 120px;
    justify-content: space-between;
}

.language-toggle:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.language-toggle .fa-chevron-down {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.language-switcher.open .language-toggle .fa-chevron-down {
    transform: rotate(180deg);
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1004;
    max-height: 200px;
    overflow-y: auto;
}

.language-switcher.open .language-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(5px);
}

.language-option {
    display: block;
    width: 100%;
    padding: 12px 15px;
    background: none;
    border: none;
    color: var(--text-color);
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.language-option:hover {
    background: var(--bg-color);
}

.language-option.active {
    background: var(--primary-color);
    color: white;
}

.language-option:first-child {
    border-radius: 10px 10px 0 0;
}

.language-option:last-child {
    border-radius: 0 0 10px 10px;
}

/* ====== MOBILE LANGUAGE SWITCHER ====== */
@media (max-width: 768px) {
    .language-switcher {
        top: 10px;
        right: 20px;
        z-index: 1005;
    }
    
    .language-toggle {
        padding: 6px 12px;
        font-size: 13px;
        min-width: 100px;
    }
    
    .language-dropdown {
        min-width: 140px;
    }
    
    .language-option {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* ====== FONT FAMILY APPLICATION ====== */
:root {
    --primary-font: 'Noto Sans Tamil', 'Tamil', 'Latha', 'Vijaya', 'Catamaran', sans-serif;
}

div, h1, p, h2, h3, h4, h5, h6, span, button, dd, dt, li, a {
    font-family: var(--primary-font);
}

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

[dir="rtl"] .sidebar {
    left: auto;
    right: 0;
}

[dir="rtl"] .main-content {
    margin-left: 0;
    margin-right: 80px;
}

[dir="rtl"] .sidebar:hover ~ .main-content {
    margin-left: 0;
    margin-right: 250px;
}

[dir="rtl"] .mobile-toggle,
[dir="rtl"] .theme-toggle,
[dir="rtl"] .language-switcher {
    right: auto;
    left: 20px;
}

[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
    content: " < ";
}

[dir="rtl"] .search-btn {
    right: auto;
    left: 5px;
}

[dir="rtl"] .sidebar-menu a:hover {
    padding-left: 20px;
    padding-right: 30px;
}

[dir="rtl"] .sidebar-menu a.active {
    border-right: none;
    border-left: 4px solid #ffd700;
}

[dir="rtl"] .sidebar-menu span {
    margin-left: 0;
    margin-right: 15px;
}

/* ====== VISITOR COUNTER STYLES ====== */
.visitor-counter {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 30px;
    color: white;
    display: inline-block;
    min-width: 200px;
}

.counter-display {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.counter-number {
    font-size: 3em;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 10px;
}

.counter-label {
    font-size: 1.2em;
    color: white;
    text-align: center;
}

/* ====== ERROR TOAST STYLES ====== */
.error-toast {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 10px;
    padding: 15px 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
    max-width: 400px;
    border-left: 4px solid #e74c3c;
    animation: slideInRight 0.3s ease;
}

.error-toast.info {
    border-left-color: #3498db;
}

.error-toast .fa {
    color: #e74c3c;
    font-size: 18px;
}

.error-toast.info .fa {
    color: #3498db;
}

.error-toast span {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.error-toast button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.error-toast button:hover {
    background: rgba(0,0,0,0.1);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ====== SKIP LINK ACCESSIBILITY ====== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
    z-index: 10000;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid #ffd700;
}

/* ====== SEARCH RESULTS ENHANCEMENTS ====== */
.search-results {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: transparent;
}

.search-results::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.search-result-item {
    transition: all 0.2s ease;
}

.search-result-item:hover {
    transform: translateX(5px);
    background: var(--primary-color);
    color: white;
}

.search-result-item:hover .search-result-title {
    color: white;
}

.search-result-item mark {
    background: #ffd700;
    color: #333;
    padding: 2px 4px;
    border-radius: 2px;
}

/* ====== MOBILE ENHANCEMENTS ====== */
@media (max-width: 768px) {
    .error-toast {
        right: 10px;
        left: 10px;
        min-width: auto;
        top: 70px;
    }
    
    .counter-number {
        font-size: 2.5em;
    }
    
    .counter-label {
        font-size: 1em;
    }
    
    .visitor-counter {
        padding: 20px;
        min-width: 150px;
    }
    
    /* Improve touch targets on mobile */
    .touch-device .btn-temple,
    .touch-device .mobile-toggle,
    .touch-device .theme-toggle,
    .touch-device .language-toggle {
        min-height: 44px;
        min-width: 44px;
        padding: 12px;
    }
    
    .touch-device .search-btn {
        width: 44px;
        height: 44px;
    }
    
    .touch-device .sidebar-menu a {
        min-height: 50px;
        padding: 15px 20px;
    }
}

/* ====== CSS CUSTOM PROPERTIES FOR MOBILE ====== */
:root {
    --vh: 1vh;
}

.full-height {
    height: calc(var(--vh, 1vh) * 100);
}

/* ====== IMAGE LOADING STATES ====== */
img.lazy:not(.loaded) {
    filter: blur(5px);
    opacity: 0.8;
}

img.loaded {
    filter: none;
    opacity: 1;
    transition: all 0.3s ease;
}

/* ====== ENHANCED ANIMATIONS ====== */
@media (prefers-reduced-motion: no-preference) {
    .fade-in-up {
        animation: fadeInUp 0.6s ease forwards;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}