/*
 * Copyright (c) 2025 Mehdi Dimyadi (https://github.com/MEHDIMYADI)
 * Project: Roozegaar Calendar (https://roozegaar.ir/)
 *
 * If you use or get inspiration from this project,
 * please kindly mention my name or this project in your work.
 * It took a lot of effort to build, and I’d really appreciate your acknowledgment.
 *
 * Licensed under no specific open-source license — all rights reserved unless stated otherwise.
 */

/* ======================= CSS VARIABLES ======================= */

:root {
    --blur: blur(10px);
    --transition: all 0.3s ease;
    
    /* Light theme variables */
    --bg-color: #f0f2f5;
    --primary-color: rgba(46, 81, 130, 0.7);
    --secondary-color: #6b8cbc;
    --background-color: #f5f5f5;
    --text-color: #1a1a1a;
    --holiday-color: #f44336;
    --header-bg: rgba(255, 255, 255, 0.25);
    --nav-bg: rgba(255, 255, 255, 0.8);    
    --day-bg: rgba(255, 255, 255, 0.7);
    --today-bg: #e6f7ff;
    --border-color: #e0e0e0;
    --hover-color: #f0f0f0;
    --footer-bg: rgba(255, 255, 255, 0.25);
    --footer-text: #333;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --toggle-active-color: #4a6fa5;        
    --scrollbar-track: #f1f1f1;
    --scrollbar-thumb: #c1c1c1;
    --scrollbar-thumb-hover: #a8a8a8;
    --card-bg: rgba(255, 255, 255, 0.25);
    --card-border: rgba(255, 255, 255, 0.18);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    /* Dark theme variables */
    --bg-color: #1a1a2e;
    --primary-color: rgba(71, 103, 156, 0.7);
    --secondary-color: #4a6fa5;
    --background-color: #1a1a1a;
    --text-color: #f0f0f0;
    --holiday-color: #f44336;
    --header-bg: rgba(45, 45, 45, 0.25);
    --nav-bg: rgba(45, 45, 45, 0.8);
    --day-bg: rgba(45, 45, 45, 0.7);
    --today-bg: #2a4d6e;
    --border-color: #444;
    --hover-color: #3a3a3a;
    --footer-bg: rgba(45, 45, 45, 0.25);
    --footer-text: #f0f0f0;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --toggle-active-color: #6b8cbc;    
    --scrollbar-track: #2d2d2d;
    --scrollbar-thumb: #555;
    --scrollbar-thumb-hover: #666;
    --card-bg: rgba(25, 25, 35, 0.3);
    --card-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);   
}

/* ======================= BASE STYLES ======================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    background-attachment: fixed;
    background-size: cover;    
    color: var(--text-color);
    transition: all 0.3s ease;
}

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

#main-content {
    margin-top: 1rem;
    margin-bottom: 1rem;
    min-height: 60vh;
    padding-top: 60px;
}

.persian-digits {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: ltr;
    display: inline-block;
}

/* Ensure proper rendering of mixed text */
[dir="rtl"] .primary-date,
[dir="rtl"] .secondary-date,
[dir="rtl"] .calendar-card .date-day {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html[dir="rtl"] .rtl-mirror {
  transform: scaleX(-1);
}

/* ======================= HEADER & NAVIGATION ======================= */

header {
    background-color: var(--header-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    height: 60px;
    z-index: 1000;
    padding: 14px 0;
    width: 100%;
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: none;
    border-bottom: 1px solid var(--card-border);
    border-radius: 0 0 10px 10px;
    box-shadow: var(--shadow);
    transition: var(--transition);    
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    white-space: nowrap;
}

.logo-with-page-title {
    display: inline-flex;
    align-items: center;
    gap: 4px; 
    white-space: nowrap;
}

.logo-with-page-title .main-logo {
    font-weight: bold;
}

.logo-with-page-title .page-separator {
    display: inline-block;
    width: 1px;
    height: 1em;
    background-color: var(--primary-color);
    vertical-align: middle;
}

.logo-with-page-title .page-title {
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.5em;
}

.controls {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-self: end;
}

/* ======================= NAVIGATION STYLES ======================= */

nav {
    justify-self: start;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 10px;
    padding: 0;
    margin: 0;
    position: absolute;
    align-items: center;
    left: 50%;
    transform: translate(-50%, -50%);
}

.nav-menu li a {
    text-decoration: none;
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: 5px;
    transition: all 0.3s ease;
    white-space: nowrap;
    align-items: center;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.nav-menu li a:hover {
    background-color: var(--hover-color);
    transform: translateX(5px);
}

[dir="rtl"] .nav-menu li a:hover {
    transform: translateX(-5px);
}

.nav-menu li a i {
    font-size: 0.9rem;
    width: 14px;
    text-align: center;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: 1px solid var(--border-color);
    font-size: 1.1rem;
    color: var(--text-color);
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
    z-index: 10;
}

.mobile-menu-btn:hover {
    background-color: var(--hover-color);
}

/* ======================= CALENDAR STYLES ======================= */

.calendar-container {
    border-radius: 10px;
    min-width: 350px;
    overflow: hidden;
    background: var(--card-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    transition: var(--transition);    
    animation: fadeIn .5s ease-in-out;
}

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

.calendar-nav {
    display: flex;
    gap: 10px;
}

.calendar-nav button {
    background: none;
    border: none;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    transition: color 0.2s ease, transform 0.2s ease;
    transform: var(--button-transform, scaleX(1));
}

.calendar-nav button:hover {
    color: var(--secondary-color);
    transform: var(--button-transform, scaleX(1)) scale(1.1);
}

[dir="rtl"] .calendar-nav button {
    --button-transform: scaleX(-1);
}

.calendar-nav i {
    pointer-events: none;
}

.calendar-body {
    padding: 20px;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: bold;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.day {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--day-bg);
    color: var(--text-color);
}

.day:hover {
    background-color: var(--hover-color);
}

.day.today {
    background-color: var(--today-bg);
    border-color: var(--primary-color);
}

.day.other-month {
    opacity: 0.5;
}

.day.selected {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.day.has-event {
    position: relative;
}

.event-indicator {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    z-index: 2;
}

.day.selected .event-indicator {
    filter: brightness(0) invert(1);
}

[data-calendar="persian"] .event-indicator {
    background-color: var(--secondary-color);
}

[data-calendar="gregorian"] .event-indicator {
    background-color: var(--primary-color);
}

.primary-date {
    font-size: 1.2rem;
    font-weight: bold;
}

.secondary-date {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* ======================= CALENDAR CARDS ======================= */

.dual-calendar-cards {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
    animation: fadeIn .5s ease-in-out;
}

.calendar-card {
    flex: 1 1 45%;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    color: var(--text-color);
    background: var(--card-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.day-large {
    font-size: 3rem;
    font-weight: bold;
    padding: 1rem;
    line-height: 0;
    color: var(--text-color);
}

.month-name {
    font-size: 1.5rem;
    padding: 1rem;
    color: var(--text-color);
}

.full-date {
    font-size: 1rem;
    opacity: 0.7;
    color: var(--text-color);
    line-height: 0;
}

.personal-calendar-card {
    width: 100%;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    min-height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: var(--text-color);
    background: var(--card-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    transition: var(--transition);    
    animation: fadeIn .5s ease-in-out;
}

.events-container {
    width: 100%;
}

.no-events {
    text-align: center;
    opacity: 0.7;
    font-size: 1.1rem;
    color: var(--text-color);
}

/* ======================= SETTINGS STYLES ======================= */

.settings-page {
    margin: 0 auto;
    animation: fadeIn .5s ease-in-out;
}

.page-header {
    text-align: center;
    margin-bottom: 30px;
}

.page-header h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
}

.settings-content {
    padding: 1rem;
    border-radius: 10px;
    background: var(--card-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    transition: var(--transition);    
}

.toggle-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-group {
    padding: 1rem;
}

.setting-group:last-child {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
}

.setting-select {
    width: 100%;
    margin-top: 10px;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-color);
    transition: border-color 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
}

.setting-select option {
    background: var(--day-bg);
    color: var(--text-color);
    padding: 10px;
}

.btn-warning {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
    width: 100%;
}

.btn-warning:hover {
    background: #ff5252;
}

/* ======================= PRIVACY POLICY PAGE STYLES ======================= */
.privacy-page {
    margin: 0 auto;
    animation: fadeIn .5s ease-in-out;
}

.privacy-container {
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
    background-color: var(--day-bg);
    border-radius: 10px;
    background: var(--card-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    transition: var(--transition);    
}

.privacy-title {
    color: var(--text-color);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.8rem;
    font-weight: 600;
}

.privacy-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.privacy-section-title {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.privacy-section-content {
    color: var(--text-color);
    line-height: 1.6;
    text-align: justify;
}

.privacy-back-button-container {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.privacy-back-button {
    min-width: 150px;
}

/* RTL/LTR support for privacy page */
[dir="rtl"] .privacy-section {
    border-left: none;
    border-right: 4px solid var(--primary-color);
}

[dir="ltr"] .privacy-section {
    border-left: 4px solid var(--primary-color);
    border-right: none;
}

/* ======================= TERMS PAGE STYLES ======================= */
.terms-page {
    margin: 0 auto;
    animation: fadeIn .5s ease-in-out;
}

.terms-container {
    border-radius: 12px;
    padding: 2rem;
    border-radius: 10px;
    background: var(--card-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.terms-title {
    color: var(--text-color);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.8rem;
    font-weight: 600;
}

.terms-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.terms-section-title {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.terms-section-content {
    color: var(--text-color);
    line-height: 1.6;
    text-align: justify;
}

.terms-back-button-container {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.terms-back-button {
    min-width: 150px;
}

/* RTL/LTR support for terms page */
[dir="rtl"] .terms-section {
    border-left: none;
    border-right: 4px solid var(--primary-color);
}

[dir="ltr"] .terms-section {
    border-left: 4px solid var(--primary-color);
    border-right: none;
}

/* ======================= FAQ Page Styles ======================= */
.faq-page {
    margin: 0 auto;
    padding: 2rem;
    border-radius: 10px;
    background: var(--card-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    transition: var(--transition);    
    animation: fadeIn .5s ease-in-out;
}

.faq-description {
    text-align: center;
    color: var(--text-secondary);
}

.faq-search {
    position: relative;
    margin-bottom: 30px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.faq-search input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.faq-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.1);
}

.faq-search .fa-search {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.faq-category {
    margin-bottom: 30px;
    border-radius: 10px;
    overflow: hidden;
}

.faq-category-header {
    background: var(--primary-color);
    color: white;
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.faq-category-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.faq-category-icon {
    transition: transform 0.3s ease;
}

.faq-category.open .faq-category-icon {
    transform: rotate(180deg);
}

.faq-questions {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-category.open .faq-questions {
    max-height: 2000px;
}

.faq-question {
    border-bottom: 1px solid var(--border-color);
}

.faq-question:last-child {
    border-bottom: none;
}

.faq-category-toggle.rotated,
.faq-question-toggle.rotated {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

.faq-question-header {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-color);
    transition: background-color 0.3s ease;
}

.faq-question-header:hover {
    background: var(--hover-color);
}

.faq-question-text {
    margin: 0;
    font-weight: 500;
    color: var(--text-color);
}

.faq-question-icon {
    color: var(--primary-color);
    margin-left: 10px;
    transition: transform 0.3s ease;
}

.faq-question.open .faq-question-icon {
    transform: rotate(180deg);
}

.faq-category-content {
    display: none;
    padding: 10px 0;
}

.faq-category-content.expanded {
    display: block;
}

.faq-answer {
    display: none;
    padding: 10px 20px;
}

.faq-answer.expanded {
    display: block;
}

.faq-question.open .faq-answer {
    max-height: 500px;
    padding: 0 20px 15px 20px;
}

.faq-answer-content {
    padding: 15px 0;
    color: var(--text-color);
    line-height: 1.6;
    border-top: 1px solid var(--border-color);
}

.faq-contact {
    text-align: center;
    padding: 20px;
    background: var(--bg-color);
    border-radius: 10px;
    border: 2px dashed var(--border-color);
}

.faq-contact a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.faq-contact a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.search-highlight {
    background-color: yellow;
    font-weight: bold;
}

.faq-no-results {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    display: none;
}

.faq-no-results.show {
    display: block;
}

/* ======================= API EVENTS STYLES ======================= */
.api-calendar-card {
    width: 100%;
    border-radius: 10px;
    margin-top: 20px;
    min-height: 120px;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: var(--text-color);
    background: var(--card-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    transition: var(--transition);    
    animation: fadeIn .5s ease-in-out;
}
.api-events-section {
    overflow: hidden;
}

.api-events-section-header {
    background: var(--primary-color);
    min-height: 80px;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.api-events-section-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}


.api-tabs-content::-webkit-scrollbar {
    width: 6px;
}

.api-tabs-content::-webkit-scrollbar-track {
    background: var(--scrollbar-track, #f1f1f1);
    border-radius: 3px;
}

.api-tabs-content::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb, #c1c1c1);
    border-radius: 3px;
}

.api-tabs-content::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover, #a8a8a8);
}

.api-tabs-content {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb, #c1c1c1) var(--scrollbar-track, #f1f1f1);
}

.api-events-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.3rem 0.3rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.api-event-item {
    margin: 5px;
    padding: .5rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
    border-radius: 10px;
}

.api-event-item:hover {
    background: var(--hover-color);
}

.api-event-item.holiday {
    background: rgba(244, 67, 54, 0.1);
    border-left: 4px solid var(--holiday-color);
}

.api-event-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    line-height: 1.4;
}

.api-event-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.api-event-day {
    background: rgba(33, 150, 243, 0.1);
    color: var(--text-color);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 500;
}

.api-event-type {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 500;
}

.api-event-type.holiday {
    background: rgba(244, 67, 54, 0.1);
    color: var(--holiday-color);
}

.api-event-type:not(.holiday) {
    background: rgba(33, 150, 243, 0.1);
    color: var(--text-color);
}

/* ======================= API EVENTS TABS STYLES ======================= */
.api-events-tabs {
    width: 100%;
    display: flex;
    flex-direction: column;
    max-height: 400px;
    border-radius: 8px;
}

.api-tabs-header {
    display: flex;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.api-tab {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

.api-tab:hover {
    background: var(--hover-color);
}

.api-tab.active {
    background: var(--primary-color);
    color: white;
}

.api-tabs-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.api-tab-pane {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.api-tab-pane.active {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

/* Scrollbar styles for tab content */
.api-tab-pane::-webkit-scrollbar {
    width: 6px;
}

.api-tab-pane::-webkit-scrollbar-track {
    background: var(--scrollbar-track, #f1f1f1);
    border-radius: 3px;
}

.api-tab-pane::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb, #c1c1c1);
    border-radius: 3px;
}

.api-tab-pane::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover, #a8a8a8);
}

.api-tab-pane {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb, #c1c1c1) var(--scrollbar-track, #f1f1f1);
}

.api-events-section {
    display: flex;
    flex-direction: column;
}

.api-events-container-inner {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb, #c1c1c1) var(--scrollbar-track, #f1f1f1);  
    padding: 0 5px 5px 5px;
    margin: 3px;
}

.api-event-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  flex-wrap: wrap;
}

.meta-right {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.api-event-type {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 500;
}

.api-event-type.holiday {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
}

.api-tabs-content-wrapper.single-tab {
    border: none;
    border-radius: 0;
}

.api-tabs-content-wrapper.single-tab .api-tab-pane {
    padding: 0;
}

#apiEventsCard[style*="display: none"] {
    display: none !important;
}

.api-events-range-info {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-radius: 0 0 10px 10px;
    animation: slideInDown 0.5s ease-out;
}

.range-info-header {
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.9;
    padding: .5rem;
    align-items: baseline;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ======================= ABOUT PAGE STYLES ======================= */
.about-page {
    margin: 0 auto;
    animation: fadeIn .5s ease-in-out;
}

.about-container {
    border-radius: 12px;
    padding: 2rem;
    border-radius: 10px;
    background: var(--card-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.about-title {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.8rem;
    font-weight: 600;
}

.about-hero {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 12px;
    color: white;
}

.about-hero-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.about-hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.about-profile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.about-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.about-profile-info {
    text-align: center;
}

.about-profile-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.about-profile-role {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.about-social-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.about-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
}

.about-social-link:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.about-section {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.about-section-title {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.about-section-content {
    color: var(--text-color);
    line-height: 1.7;
    text-align: justify;
}

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

.about-project-card {
    background: var(--day-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

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

.about-project-title {
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.about-project-description {
    color: var(--text-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.about-project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.about-project-link:hover {
    color: var(--secondary-color);
    gap: 0.7rem;
}

.about-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1rem;
}

.about-skill {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.about-back-button-container {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.about-back-button {
    min-width: 150px;
}

/* RTL/LTR support for about page */
[dir="rtl"] .about-section {
    border-left: none;
    border-right: 4px solid var(--primary-color);
}

[dir="ltr"] .about-section {
    border-left: 4px solid var(--primary-color);
    border-right: none;
}

[dir="rtl"] .about-project-link {
    flex-direction: row-reverse;
}

[dir="ltr"] .about-project-link {
    flex-direction: row;
}

/* ======================= MODAL STYLES ======================= */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--day-bg);
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    color: var(--text-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    color: var(--text-color);
    transition: color 0.2s ease, transform 0.2s ease;
    transform: var(--button-transform, scaleX(1));
}

.close-modal:hover {
    color: var(--secondary-color);
    transform: var(--button-transform, scaleX(1)) scale(1.1);
}

/* ======================= FORM STYLES ======================= */

.event-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.form-group label {
    flex: 1;
    font-weight: bold;
    color: var(--text-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--background-color);
    color: var(--text-color);
}

.form-group select {
    flex: 2;
    max-width: 100px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-secondary {
    background-color: var(--border-color);
    color: var(--text-color);
}

/* ======================= EVENTS LIST ======================= */

.events-list {
    margin-top: 20px;
}

.event-item {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-color);
}

.event-actions button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-color);
    margin-left: 10px;
}

/* ======================= FOOTER STYLES ======================= */
.footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 10px 0 10px;
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: none;
    border-top: 1px solid var(--card-border);
    border-radius: 10px 10px 0 0;
    box-shadow: var(--shadow);
    transition: var(--transition);     
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.footer-toggle {
    display: flex;
    justify-content: center;
}

.footer-toggle-btn {
    background: rgba(33, 150, 243, 0.1);
    border: none;
    color: var(--footer-text);
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.footer-toggle-btn:hover {
    background: rgba(33, 150, 243, 0.5);
}

.footer-toggle-btn .toggle-icon {
    transition: transform 0.3s ease;
    font-size: 1rem;
}

.footer-toggle-btn[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

.footer.collapsed .footer-container {
    max-height: 0 !important;
    opacity: 0 !important;
    visibility: hidden;
}

.footer.expanded .footer-container {
    max-height: 1000px !important;
    opacity: 1 !important;
    visibility: visible;
    padding: 20px 0;    
    transition: max-height 0.4s ease, opacity 0.4s ease;
}

#footerToggle {
    cursor: pointer;
    transition: all 0.3s ease;
}

.footer-columns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.footer-column h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-column h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 50px;
    height: 2px;
    background-color: var(--primary-color);
}

[dir="ltr"] .footer-column h3::after {
    left: 0;
}

[dir="rtl"] .footer-column h3::after {
    right: 0;
}

.footer-about p {
    margin-bottom: 20px;
    text-align: justify;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--footer-text);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-icons a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-links {
    list-style: none;
}

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

.footer-links a {
    color: var(--footer-text);
    text-decoration: none;
    transition: color 0.3s ease;
    align-items: center;
}

.footer-links a:hover,
.footer-links a:hover ~ i,
.footer-links li:hover i {
  color: var(--primary-color);
}

.footer-links i {
    margin: 5px;
    font-size: 0.9rem;
}

.contact-info {
    list-style: none;
}

.contact-info li {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
}

.contact-info i {
    margin: 5px;
    font-size: 0.9rem;
}

.contact-info a:hover,
.contact-info a:hover ~ i,
.contact-info li:hover i {
  color: var(--primary-color);
}

.email-link {
    color: var(--footer-text);
    margin-left: 3px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.email-link:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--primary-color);
    font-size: 0.9rem;
    color: var(--footer-text);
}

/* ======================= OFFLINE STYLES ======================= */
body.offline-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

[data-theme="dark"] body.offline-page {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
}

/* Make sure header and other elements are hidden on offline page */
body.offline-page header,
body.offline-page main:not(.offline-container) {
    display: none;
}

.offline-container {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    animation: fadeInUp 0.6s ease-out;
}

.offline-container h1 {
    color: #e74c3c;
    margin-bottom: 20px;
    font-size: 1.8rem;
    font-weight: 600;
}

.offline-container p {
    margin: 20px 0;
    color: #666;
    line-height: 1.6;
    font-size: 1rem;
}

.offline-container .icon {
    font-size: 80px;
    margin-bottom: 25px;
    animation: bounce 2s infinite;
}

.offline-container button {
    background: linear-gradient(135deg, #4a6fa5, #2c4a7a);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(74, 111, 165, 0.3);
}

.offline-container button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 111, 165, 0.4);
}

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

/* Dark theme support */
[data-theme="dark"] .offline-container {
    background: #2d3748;
    color: #e2e8f0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

[data-theme="dark"] .offline-container h1 {
    color: #fc8181;
}

[data-theme="dark"] .offline-container p {
    color: #cbd5e0;
}

/* ======================= PWA INSTALL PROMPT ======================= */

.pwa-install-prompt {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: fit-content;
    max-width: 90%;
    border-radius: 10px;
    padding: 15px;
    z-index: 1000;
    display: none;
    color: var(--text-color);
    background: var(--card-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.pwa-prompt-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.pwa-prompt-text {
    flex: 1;
}

.pwa-prompt-actions {
    display: flex;
    gap: 10px;
}

.pwa-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.pwa-btn-secondary {
    background-color: var(--border-color);
    color: var(--text-color);
}

/* ======================= TOGGLE SWITCH STYLES ======================= */

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    --toggle-handle-size: 16px;
    --toggle-handle-margin: 4px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: var(--toggle-handle-size);
    width: var(--toggle-handle-size);
    bottom: var(--toggle-handle-margin);
    background-color: var(--day-bg);
    transition: .4s;
    border-radius: 50%;
}

[dir="ltr"] .toggle-slider:before {
    left: var(--toggle-handle-margin);
}

[dir="ltr"] input:checked + .toggle-slider {
    background-color: var(--toggle-active-color);
}

[dir="ltr"] input:checked + .toggle-slider:before {
    left: calc(100% - var(--toggle-handle-size) - var(--toggle-handle-margin));
}

[dir="rtl"] .toggle-slider:before {
    right: var(--toggle-handle-margin);
}

[dir="rtl"] input:checked + .toggle-slider {
    background-color: var(--toggle-active-color);
}

[dir="rtl"] input:checked + .toggle-slider:before {
    right: calc(100% - var(--toggle-handle-size) - var(--toggle-handle-margin));
}


/* ======================= SUNRISE/SUNSET CARD STYLES ======================= */
.sun-times-card {
    width: 100%;
    border-radius: 10px;
    padding: 10px;
    margin-top: 20px;
    min-height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: var(--text-color);
    background: var(--card-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    transition: var(--transition);    
    animation: fadeIn .5s ease-in-out;
}

.sun-times-container {
    width: 100%;
    text-align: center;
}

.sun-times-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sun-times-title {
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.sun-times-city {
    font-size: 0.9rem;
}

.sun-times-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.sun-time-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.sun-time-icon .fas.fa-sun {
    color: #c3a60b;
}

.sun-time-icon .fas.fa-moon {
    color: #4A6FA5;
}

.sun-time-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.sun-time-value {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-color);
}

.sun-time-duration {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
}

.sun-times-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.sun-times-date {
    font-weight: 500;
}

.sun-times-info {
    align-items: center;
    gap: 0.3rem;
}

.sun-times-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    color: var(--warning-color);
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.error-message h5 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.error-message p {
    margin: 0;
    opacity: 0.8;
    font-size: 0.9rem;
}

.sun-times-header .sun-times-city {
    color: var(--warning-color);
}

/* ======================= RESPONSIVE STYLES ======================= */

@media (max-width: 768px) {    
    header {
        padding: 10px 0;
        justify-content: space-between;
    }
    
    [data-theme="dark"] header {
        background-color: var(--header-bg);
    }
    
    .header-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        position: relative;
    }

    .logo-with-page-title {
        flex-direction: column;
        align-items: center;
        gap: 2px; 
    }

    .logo-with-page-title .page-title {
        font-size: 0.5em;
        opacity: 0.9;
    }
    
    .logo-with-page-title .page-separator {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }

    nav {
        position: fixed;
        top: 65px;
        width: 50%;
        height: 100vh;
        background: var(--nav-bg);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;
        overflow-y: auto;   
        backdrop-filter: var(--blur);
        -webkit-backdrop-filter: var(--blur);
        border: none;
        border-bottom: 1px solid var(--card-border);
        border-radius: 0 0 10px 10px;
        box-shadow: var(--shadow);
        transition: var(--transition);        
    }

    html[dir="rtl"] nav {
        right: -50%;
        border-left: 1px solid var(--border-color);
        border-top-left-radius: 10px;
        transition: right 0.3s ease;
    }

    html[dir="ltr"] nav {
        left: -50%;
        border-right: 1px solid var(--border-color);
        border-top-right-radius: 10px;
        transition: left 0.3s ease;
    }

    html[dir="rtl"] nav.active {
        right: 0;
    }

    html[dir="ltr"] nav.active {
        left: 0;
    }

    .nav-menu {
        position: static;
        transform: none;
        flex-direction: column;
        width: 100%;
        text-align: center;
    }

    .nav-menu li {
        padding: .5em;
        width: 100%;
    }

    .nav-menu li a {
        padding: 15px;
        margin: 2px 0;
        border-radius: 8px;
        display: flex;
        align-items: center;
        gap: 6px;
        justify-content: flex-start;
        font-size: 1rem;
    }

    .nav-menu li a i {
        font-size: 1.1rem;
        width: 20px;
    }

    /* Closing animation */
    html[dir="rtl"] nav.closing {
        right: -280px !important;
    }

    html[dir="ltr"] nav.closing {
        left: -280px !important;
    }    
    
    .nav-overlay {
        display: none;
        top: 0;
        left: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        transition: all 0.3s ease;
    }

    .nav-overlay.active {
        opacity: 1;
        display: block;
        visibility: visible;
    }

    .nav-overlay.closing {
        opacity: 0;
        visibility: hidden;
    }
    
    .logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1;
        flex: none;
        margin: 0;
    }

    .controls {
        flex-shrink: 0;
    }
    
    .range-info-header {
        font-size: 0.85rem;
    }
    
    .footer-container {
        padding: 0 15px;
    }
    
    .footer-columns {
        grid-template-columns: 1fr;
        margin-bottom: 30px;
    }
    
    .footer-column {
        text-align: center;
        padding: 0 10px;
    }
    
    .footer-column h3 {
        position: relative;
        padding-bottom: 12px;
        margin-bottom: 15px;
    }
    
    .footer-column h3::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 1px;
        background-color: var(--border-color);
    }
    
    .footer-column h3::before {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 50px;
        height: 2px;
        background-color: var(--primary-color);
        z-index: 2;
    }
    
    .footer-about p {
        text-align: center;
        margin-bottom: 15px;
        line-height: 1.6;
    }
    
    .social-icons {
        justify-content: center;
        gap: 12px;
        margin-top: 15px;
    }
    
    .social-icons a {
        width: 36px;
        height: 36px;
    }
    
    .footer-links {
        padding: 0;
    }
    
    .footer-links li {
        margin-bottom: 10px;
    }
    
    .footer-links a {
        padding: 8px 0;
    }
    
    .contact-info {
        padding: 0;
        text-align: center;
    }
    
    .contact-info li {
        justify-content: center;
        margin-bottom: 12px;
    }
    
    .contact-info i {
        margin-right: 0;
    }
    
    .email-link {
        margin-left: 5px;
    }
    
    .footer-bottom {
        padding-top: 15px;
        font-size: 0.85rem;
    }
    
    [dir="rtl"] .contact-info i {
        margin-left: 0;
    }
    
    [dir="rtl"] .email-link {
        margin-right: 5px;
        margin-left: 0;
    }
    
    .pwa-prompt-content {
        flex-direction: column;
        text-align: center;
    }

    .calendar-header {
        flex-direction: column;
        gap: 15px;
    }

    .calendar-nav {
        order: 2;
    }

    .calendar-type-toggle {
        order: 1;
    }

    .primary-date {
        font-size: 1rem;
    }

    .api-events-count {
        font-size: 0.65rem;
    }
    
    .secondary-date {
        font-size: 0.7rem;
    }
    
    .offline-container {
        padding: 25px 20px;
        width: 95%;
        margin: 20px auto;
    }
    
    .offline-container h1 {
        font-size: 1.5rem;
    }
    
    .offline-container p {
        font-size: 0.9rem;
        margin: 15px 0;
    }
    
    .offline-container .icon {
        font-size: 60px;
        margin-bottom: 20px;
    }
    
    .offline-container button {
        padding: 10px 25px;
        font-size: 0.9rem;
        width: 100%;
    }
    
    .privacy-container {
        padding: 1.5rem;
    }
    
    .privacy-title {
        font-size: 1.5rem;
    }
    
    .privacy-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }   
    
    .faq-category-header {
        padding: 12px 15px;
    }
    
    .faq-question-header {
        padding: 12px 15px;
    }
    
    .faq-answer {
        padding: 0 15px;
    }
    
    .faq-question.open .faq-answer {
        padding: 0 15px 12px 15px;
    }  
    
    .about-container {
        padding: 1.5rem;
    }
    
    .about-hero {
        padding: 1.5rem;
    }
    
    .about-hero-title {
        font-size: 1.6rem;
    }
    
    .about-hero-subtitle {
        font-size: 1.1rem;
    }
    
    .about-profile {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .about-avatar {
        width: 100px;
        height: 100px;
    }
    
    .about-projects {
        grid-template-columns: 1fr;
    }

    .sun-times-content {
        gap: 0.8rem;
    }

    .sun-time-icon {
        font-size: 1.7rem;
    }

    .sun-time-value {
        font-size: 1.1rem;
    }

    .sun-times-footer {
        gap: 0.5rem;
        text-align: center;
    }
}

/* ======================= RESPONSIVE STYLES ======================= */

@media (max-width: 480px) {
    .header-content {
        gap: 10px;
    }
    
    .logo {
        font-size: 1.2rem;
        margin: 0 5px;
    }

    .logo-with-page-title .main-logo {
        font-size: 1.1rem;
    }
    
    .logo-with-page-title .page-title {
        font-size: 0.5em;
    }
    
    nav {
        width: 50%;
    }

    html[dir="rtl"] nav {
        right: -100%;
    }

    html[dir="ltr"] nav {
        left: -100%;
    }
    
    .days-grid {
        gap: 2px;
    }

    .day {
        padding: 5px 2px;
    }
    
    .footer-columns {
        gap: 20px;
        margin-bottom: 25px;
    }
    
    .footer-column {
        padding: 0 5px;
    }
    
    .footer-column h3 {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    .social-icons {
        gap: 10px;
    }
    
    .social-icons a {
        width: 32px;
        height: 32px;
    }
    
    .social-icons a i {
        font-size: 0.9rem;
    }
    
    .footer-links li {
        margin-bottom: 8px;
    }
    
    .footer-links a {
        font-size: 0.9rem;
        padding: 6px 0;
    }
    
    .contact-info li {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }
    
    .footer-bottom {
        font-size: 0.8rem;
    }    
    
    .offline-container {
        padding: 20px 15px;
        border-radius: 12px;
    }
    
    .offline-container h1 {
        font-size: 1.3rem;
    }
    
    .offline-container p {
        font-size: 0.85rem;
    }
    
    .offline-container .icon {
        font-size: 50px;
    }
}

@media (max-width: 360px) {
    .header-content {
        gap: 10px;
    }
    
    .logo {
        font-size: 1.2rem;
    }
}

@media (min-width: 1200px) {
    .header-content {
        gap: 30px;
    }
    
    .logo {
        font-size: 1.6rem;
    }
    
    .nav-menu li a {
        padding: 10px 15px;
        font-size: 1rem;
    }
}

/* ======================= Animations ======================= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
/* ======================= ACCESSIBILITY STYLES ======================= */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

button:focus,
select:focus,
input:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
}

@media (prefers-contrast: high) {
    :root {
        --border-color: #000;
    }
}

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