:root {
    --primary-color: #467C45;
    --primary-dark: #356034;
    --accent-gold: #c5a059;
    --accent-yellow: #e5b63e;

    --bg-body: #f9f9f9;
    --bg-card: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    --border-color: #e0e0e0;

    --row-hover: #fffbf0;
    --today-highlight: #fff8e1;
    --header-bg: #ffffff;

    --table-header-bg: #fffbf0;
    --table-header-text: #bfa050;
    --highlight-bg: rgba(229, 182, 62, 0.05);
}

/* Dark mode styles removed */

* {
    box-sizing: border_box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
}

/* Header Tweaks for Logo/Theme */
.site-logo {
    max-height: 60px;
    width: auto;
    display: block;
    margin: 0 auto;
}

#theme-toggle {
    display: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Structure */
.site-header {
    background-color: var(--header-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

/* Top Bar */
.top-bar {
    background-color: #e5b63e;
    /* Golden Yellow */
    color: white;
    padding: 10px 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.top-bar .container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-bar i {
    font-size: 1.1rem;
}

/* Middle Header */
.middle-header {
    padding: 1.5rem 0;
    border-bottom: 1px solid #eee;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    flex: 1;
    display: flex;
    justify-content: flex-start;
}

.header-left .social-icon {
    color: #333;
    font-size: 1.5rem;
    text-decoration: none;
}

.header-center {
    flex: 0 0 auto;
    text-align: center;
}

.logo-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #2c584c;
    /* Dark Green */
    display: inline-flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -1px;
}

.logo-text .islam {
    color: #2c584c;
}

.logo-text .rehberi {
    font-weight: 400;
    color: #2c584c;
}

.logo-text .net {
    font-size: 1rem;
    color: #e5b63e;
    align-self: flex-end;
    margin-bottom: 5px;
}

.logo-icon {
    color: #e5b63e;
    font-size: 1.8rem;
}

.header-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
}

.btn-forum {
    background-color: #333;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    color: #333;
    font-size: 1.2rem;
    text-decoration: none;
}

/* Bottom Nav */
.bottom-nav {
    padding: 1rem 0;
    background: white;
}

.nav-links {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: #444;
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links i {
    font-size: 0.8rem;
    color: #888;
}

/* Dropdown Menu Styles */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    list-style: none;
    padding: 10px 0;
    min-width: 220px;
    z-index: 1000;
    border-radius: 4px;
    border-top: 3px solid #e5b63e;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    padding: 0;
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: #333;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background-color: #fffbf0;
    color: #e5b63e;
}

/* Responsive Header */
@media (max-width: 768px) {
    .header-flex {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        flex-wrap: wrap;
        gap: 1rem;
        font-size: 0.9rem;
    }

    .logo-text {
        font-size: 1.8rem;
    }

    .header-right {
        width: 100%;
        justify-content: space-around;
    }
}

/* City Selection */
.city-selection {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    text-align: center;
}

.city-selection label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.select-wrapper {
    position: relative;
    max-width: 400px;
    margin: 0 auto;
}

select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-dark);
    appearance: none;
    background-color: white;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23467C45' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    cursor: pointer;
    transition: border-color 0.3s;
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Imsakiye Table & Layout */
.imsakiye-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 3rem;
    display: none;
    /* Controlled by JS */
}

.imsakiye-header {
    background-color: #e5b63e;
    /* Changed to Yellow */
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.content-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}

/* Sidebar Styling */
.countdown-sidebar {
    width: 250px;
    background: #fdfdfd;
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    flex-shrink: 0;
}

.countdown-sidebar h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #c5a059;
    /* Gold/Yellow Text */
    border-bottom: 2px solid #e5b63e;
    padding-bottom: 0.5rem;
}

.countdown-item {
    margin-bottom: 1rem;
    padding: 0.8rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-align: center;
}

.countdown-item.active {
    border-color: #e5b63e;
    background-color: #fffbf0;
    /* Light yellow background */
}

.countdown-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.3rem;
}

.countdown-time {
    display: block;
    font-weight: 700;
    font-size: 1.2rem;
    color: #333;
}

.countdown-remaining {
    display: block;
    font-size: 0.8rem;
    color: #e5b63e;
    margin-top: 0.3rem;
    font-weight: 500;
}

/* Table Area */
.table-responsive {
    flex: 1;
    width: 100%;
    /* Ensure full width relative to parent */
    min-width: 0;
    /* Crucial for flex items to shrink */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */
    padding-bottom: 1rem;
}

.imsakiye-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.imsakiye-table th,
.imsakiye-table td {
    padding: 14px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.imsakiye-table th {
    background-color: #fffbf0;
    /* Light yellow tint */
    color: #bfa050;
    /* Darker yellow/gold text */
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
}

/* Specific Column Styles */
.imsakiye-table td:first-child {
    font-weight: 500;
    white-space: nowrap;
}

/* Highlight Columns */
.imsakiye-table td:nth-child(2),
/* Imsak */
.imsakiye-table td:nth-child(6) {
    /* Aksam */
    font-weight: 700;
    color: #333;
    background-color: rgba(229, 182, 62, 0.05);
    /* Very light yellow */
}

.imsakiye-table tr.today {
    background-color: #fff8e1 !important;
    /* Stronger light yellow */
    border-left: none;
    box-shadow: inset 4px 0 0 #e5b63e;
}

/* Responsive adjustment */
@media (max-width: 900px) {
    .content-wrapper {
        flex-direction: column;
    }

    .countdown-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
        align-items: center;
    }

    .countdown-sidebar h3 {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .countdown-item {
        flex: 1;
        min-width: 140px;
        margin-bottom: 0;
    }
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
    color: #e5b63e;
}

.spinner {
    border: 4px solid rgba(229, 182, 62, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border-left-color: #e5b63e;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 2rem 0;
    color: #888;
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    .imsakiye-header {
        flex-direction: column;
        text-align: center;
    }

    .logo-area h1 {
        font-size: 1.25rem;
    }
}

.menu-item {
    position: relative;
}

/* Açılan Menü */
.submenu {
    position: absolute;
    top: 100%;
    /* calc(100% + 8px) yerine */
    left: 0;

    background: #fff;
    min-width: 260px;
    list-style: none;
    padding: 8px;
    display: none;

    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, .06);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .08);
    z-index: 999;
}

/* Hover olunca aç */
.menu-item:hover .submenu {
    display: block;
}

/* Linkler */
.submenu li a {
    display: block;
    padding: 10px 14px;
    color: #111;
    text-decoration: none;
    border-radius: 10px;
    transition: all .15s ease;
}

.submenu li a:hover {
    background: rgba(0, 0, 0, .05);
    transform: translateX(2px);
}

.menu-item>a {
    display: flex;
    align-items: center;
}

.menu-item>a::after {
    content: "";
    width: 6px;
    height: 6px;
    border-right: 2px solid #333;
    border-bottom: 2px solid #333;
    transform: rotate(45deg);
    margin-left: 8px;
    transition: transform .2s ease;
}

/* Hover olunca ok aşağı döner */
.menu-item:hover>a::after {
    transform: rotate(225deg);
}

/* =========================================
   Responsive Table Improvements (Mobile Fix) 
   ========================================= */

/* Default: Long date visible */
.date-short {
    display: none;
}

.date-long {
    display: inline;
}

@media (max-width: 600px) {

    /* Mobile: Short date visible */
    .date-long {
        display: none !important;
    }

    .date-short {
        display: inline-block !important;
        font-weight: 600;
        color: var(--primary-color);
    }

    /* Optimize Table Padding/Font */
    .imsakiye-table th,
    .imsakiye-table td {
        padding: 8px 4px !important;
        font-size: 0.8rem !important;
        text-align: center;
    }

    /* Column Sizing */
    .imsakiye-table td:first-child {
        text-align: left;
        padding-left: 8px !important;
        min-width: 85px;
        /* Enough for "11 Mar" */
        white-space: nowrap;
    }

    /* Sticky First Column (Date) */
    .imsakiye-table th:first-child,
    .imsakiye-table td:first-child {
        position: sticky;
        left: 0;
        z-index: 10;
        background-color: #ffffff;
        border-right: 1px solid #e0e0e0;
    }

    /* Make header sticky too */
    .imsakiye-table th:first-child {
        background-color: #fffbf0;
        /* Match header bg */
        z-index: 11;
    }

    /* Fix sticky background for highlighted 'today' row */
    .imsakiye-table tr.today td:first-child {
        background-color: #fff8e1 !important;
    }
}

/* =========================================
   Quick Access Bar Styles
   ========================================= */

.quick-access-bar {
    background: white;
    padding: 1rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    border-bottom: 1px solid #f0f0f0;
}

.quick-access-bar .container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.qa-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: #e5b63e; /* Gold */
    font-size: 1.1rem;
}

.qa-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.qa-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    border: 1px solid #eee;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    color: #444;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.qa-btn i {
    color: #888;
    transition: color 0.2s;
}

/* Hover Effects */
.qa-btn:hover {
    border-color: #e5b63e;
    color: #e5b63e;
    background: #fffbf0;
    box-shadow: 0 2px 8px rgba(229, 182, 62, 0.15);
    transform: translateY(-2px);
}

.qa-btn:hover i {
    color: #e5b63e;
}

/* =========================================
   Security Toast Notification
   ========================================= */

.security-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #1a1a1a;
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    pointer-events: none;
    text-align: center;
    
    /* Default Hidden State */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.security-toast.show {
    opacity: 1;
    visibility: visible;
}

/* =========================================
   Mobile Fixes
   ========================================= */

@media (max-width: 768px) {
    .quick-access-bar .container {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .qa-links {
        width: 100%;
        display: flex;
        overflow-x: auto;
        padding-bottom: 5px; /* Scrollbar space */
        flex-wrap: nowrap; /* Horizontal scroll */
        -webkit-overflow-scrolling: touch;
        gap: 10px;
    }
    
    .qa-btn {
        flex: 0 0 auto; /* Don't shrink */
        white-space: nowrap;
    }

    /* Submenu Fixes */
    .menu-item .submenu {
        display: none; /* Force hidden initially */
        position: static; /* Stack vertically on mobile */
        box-shadow: none;
        border: none;
        padding-left: 20px;
        width: 100%;
    }

    .menu-item.active .submenu {
        display: block !important;
    }
    
    .menu-item > a::after {
        transform: rotate(45deg);
        transition: transform 0.3s ease;
    }
    
    .menu-item.active > a::after {
        transform: rotate(225deg);
    }
}