﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'iransansxv', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.2s ease;
}

a, button, p, h1, h2, h3, h4, span, input {
    font-family: 'iransansxv', system-ui, sans-serif;
}
/* Light Theme (default) */
:root {
    --bg-primary: #f5f7fb;
    --bg-surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --border: #e2e8f0;
    --primary: #1e88e5;
    --primary-dark: #1565c0;
    --card-shadow: 0 4px 12px rgba(0,0,0,0.05);
    --header-bg: rgba(255,255,255,0.95);
}
/* Dark Theme */
body.dark {
    --bg-primary: #0f172a;
    --bg-surface: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border: #334155;
    --card-shadow: 0 4px 12px rgba(0,0,0,0.3);
    --header-bg: rgba(15,23,42,0.95);
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
}

header {
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 20px;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1300px;
    margin: 0 auto;
}

.header-brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.logo-svg {
    width: 44px;
    height: 44px;
    background: #e8f0fe;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-title {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #1e88e5, #0d47a1);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.site-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.theme-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 40px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: 0.2s;
}

/* Search Section Styles */
.search-container {
    max-width: 700px;
    margin: 24px auto 0;
    text-align: center;
}

.search-header {
    margin-bottom: 16px;
}

    .search-header h2 {
        font-size: 1.2rem;
        color: var(--bg-surface);
        margin-bottom: 4px;
    }

    .search-header p {
        font-size: 0.85rem;
        color: var(--bg-surface);
    }

.search-wrap {
    position: relative;
}

    .search-wrap input {
        width: 100%;
        padding: 14px 50px 14px 20px;
        border: 1px solid var(--border);
        border-radius: 60px;
        background: var(--bg-surface);
        color: var(--text-primary);
        font-size: 1rem;
        outline: none;
        transition: 0.2s;
    }

        .search-wrap input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(30,136,229,0.2);
        }

.search-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.clear-btn {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    display: none;
}

/* Main Content */
.main-container {
    margin: 0 auto;
    padding: 20px;
}

.main-content-section {
    max-width: 1024px !important;
    margin: 24px auto !important;
    padding: 18px 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 4px 12px rgba(0, 0, 0, .06);
    background: #fff;
    border-radius: 20px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 28px 0 20px 0;
    color: var(--text-primary);
    border-right: 4px solid var(--primary);
    padding-right: 16px;
}

.search-wrapper-home {
    position: relative;
    padding: 1px 14px 20px;
    background-size: cover !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}

.left-header {
    display: flex;
    gap: 10px;
}

.dark .search-wrapper-home {
    /*background: #1e293b;*/
}

a.btn.btn-primary.btn-sm {
    padding: 9px 24px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 13.5px;
    border: 0px solid var(--primary);
    background: var(--primary);
    color: #fff !important;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    padding: 7px;
    justify-content: center;
}

/* Hero Grid */
.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.hero-card {
    background: var(--bg-surface);
    border-radius: 24px;
    padding: 20px 12px;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: var(--card-shadow);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

    .hero-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 24px rgba(0,0,0,0.1);
        border-color: var(--primary);
    }

.card-icon {
    width: 64px;
    height: 64px;
    border-radius: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.card-name {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Results Header & Back Button */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.back-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 40px;
    padding: 8px 16px;
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    transition: 0.2s;
}

    .back-btn:hover {
        border-color: var(--primary);
        color: var(--primary);
    }

/* Calendar Styles */
.cal-wrapper {
    max-width: 1300px;
    margin: 40px auto 20px;
    padding: 20px;
    background: var(--bg-surface);
    border-radius: 28px;
    border: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.cal-widget {
    flex: 2;
    min-width: 280px;
    background: var(--bg-primary);
}

.cal-events-box {
    flex: 1;
    min-width: 220px;
    background: var(--bg-primary);
    border-radius: 24px;
    padding: 16px;
}

.cal-events-header {
    font-weight: 700;
    font-size: 1.1rem;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
    margin-bottom: 16px;
}

.cal-events-list {
    max-height: 380px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cal-event-item {
    font-size: 0.85rem;
    padding: 8px 12px;
    background: var(--bg-surface);
    border-radius: 16px;
    border-right: 3px solid var(--primary);
}

.cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.cal-nav-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-primary);
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.cal-weekday-cell {
    text-align: center;
    font-weight: 600;
    padding: 8px;
    color: var(--primary);
}

.cal-day-cell {
    text-align: center;
    padding: 10px 4px;
    border-radius: 20px;
    background: var(--bg-primary);
    cursor: pointer;
}

.cal-is-today {
    background: var(--primary);
    color: white;
}

.cal-btn-today {
    margin-top: 20px;
    width: 100%;
    padding: 10px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 40px;
    cursor: pointer;
}

body.dark .main-content-section {
    background: #1e293b;
}

@media (max-width: 640px) {
    .hero-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .site-title {
        font-size: 1.1rem;
    }

    .cal-wrapper {
        flex-direction: column;
    }

    .search-container {
        flex-wrap: wrap;
    }

        .search-container .right-column {
            width: 100% !important;
            order: 2;
            margin-bottom: 20px;
        }

        .search-container .left-column {
            width: 100%;
            order: 3;
        }

        .search-container .center-column {
            width: 100%;
            order: 1;
        }
}


.search-wrapper-home {
    /*background: #ccc;*/
}

.search-container {
    max-width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .search-container .center-column {
        min-width: 70%;
    }

        .search-container .center-column .search-wrapper-home .search-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            min-width: 100%;
            flex: 1;
        }

            .search-container .center-column .search-wrapper-home .search-container > * {
                flex: 1;
                width: 100%;
                max-width: 700px;
            }

.card.weather-container {
    background: transparent;
    border: none;
    display: flex;
}

.weather-info {
    display: flex;
    align-items: center;
    justify-content: start;
    width: 100%;
    margin-bottom: 20px;
}

    .weather-info .weather-icon {
        min-width: auto;
        margin-inline: 10px;
    }

.weather-forecast {
    gap: 6px;
    display: flex;
    justify-content: start;
    margin-top: auto;
}

    .weather-forecast button {
        background: transparent;
        border: none;
        width: auto;
        background: #e3e3e354;
        border-radius: 24px;
        border: 1px solid;
        padding: 2px 15px;
        backdrop-filter: blur(3px);
        font-size: 14px;
    }

.search-container .weather-location {
    display: flex;
    justify-content: start;
    margin-bottom: 10px;
    gap: 4px;
}

    .search-container .weather-location svg {
        max-width: 20px;
    }

.weather-icon img {
    display: none;
}

    .weather-icon img.show {
        display: inline-block;
        width: 40px;
    }


button#getLocationBtn {
    background: transparent;
    border: 1px solid #898989;
    border-radius: 999px;
    width: 30px;
    height: 30px;
}

.search-container .right-column, .search-container .left-column {
    width: 40%;
    flex-grow: 1;
}

/* فقط همون سوئیچ کوچیک با متن نمایش نقشه */
.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: white;
    padding: 0px 8px;
    border-radius: 12px;
    flex-direction: row-reverse;
    margin-right: auto;
}

.switch-label {
    font-size: 12px;
    font-weight: 500;
    color: #1c1c1e;
}

/* سوئیچ اپل استایل - کوچیک شده */
.apple-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.apple-switch-input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

/* فقط همون سوئیچ کوچیک با متن نمایش نقشه */
.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: white;
    padding: 0px 8px;
    border-radius: 12px;
    flex-direction: row-reverse;
    margin-right: auto;
}

.switch-label {
    font-size: 12px;
    font-weight: 500;
    color: #1c1c1e;
}

/* سوئیچ اپل استایل - کوچیک شده */
.apple-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.apple-switch-input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
