:root {
    --color-primary: #0ff;
    --color-primary-dark: #0ddd;
    --color-secondary: #7b68ee;
    --color-accent: #00ff88;
    --color-bg: #0a0f1c;
    --color-bg-secondary: #121827;
    --color-bg-tertiary: #1a2140;
    --color-surface: rgba(255, 255, 255, 0.08);
    --color-border: rgba(255, 255, 255, 0.1);
    --color-text: #f0f4ff;
    --color-text-secondary: #a0b0d0;
    --color-success: #00c853;
    --color-warning: #ffab00;
    --color-error: #ff1744;
    --radius: 12px;
    --transition: all 0.3s ease;
}

:root[data-theme="dark"] {
    --color-primary: #0ddfff;
    --color-bg: #050712;
}

[data-lang="fa"] {
    direction: rtl;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #0a0f1c, #121827, #1a2140);
    color: var(--color-text);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

.app-loading {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    background: var(--color-bg);
}

.loading-skeleton {
    text-align: center;
    padding: 2rem;
    opacity: 1;
    animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-header, .skeleton-search, .skeleton-card {
    background: linear-gradient(90deg, var(--color-border) 25%, transparent 25%, transparent 50%, var(--color-border) 50%, var(--color-border) 75%, transparent 75%);
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
    border-radius: var(--radius);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 15, 28, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    padding: 0 1.5rem;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-main {
    display: flex;
    gap: 1rem;
    list-style: none;
}

.nav-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: var(--transition);
    position: relative;
}

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

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 24px;
    background: var(--color-primary);
    border-radius: 2px;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-toggle {
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}

.btn-toggle:hover {
    background: var(--color-surface);
}

.btn-btn {
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}

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

.btn-outline {
    background: transparent;
}

.icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
    stroke: currentColor;
    stroke-width: 2;
}

.icon path, .icon circle, .icon line, .icon polygon {
    fill: none;
}

.flag {
    width: 24px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    position: relative;
    cursor: pointer;
}

.flag-us {
    background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMjUgMzJWMjVoMTBDMzAgMjYuMTUgMzAgMjYuMTUgMzAgMjZWMjJWIDMwSFIiIHN0cm9rZT0iI2ZjIiBzdHJva2Utd2lkdGg9IjEwIi8+PHBhdGggZD0iTTkwIDMwVjE0SDE0SDE0VjMwSDEwSDE0Vje1eiIgZmlsbD0iI2ZmIi8+PHBhdGggZD0iTTEwMCAzaDEyIi8+PC9zdmc+');
}

.flag-ir {
    background: linear-gradient(45deg, #e60000, #ffcc00 33%, #e60000 66%, #ffcc00);
}

.main {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

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

.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
    color: var(--color-text);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.search-input:focus {
    outline: 2px solid var(--color-primary);
    border-color: var(--color-primary);
}

.search-input::placeholder {
    color: var(--color-text-secondary);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg-secondary);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 0.5rem;
}

.search-result-item {
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--color-border);
}

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

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

.location-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.location-country {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.local-time {
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.weather-card {
    background: var(--color-surface);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.location-info h2 {
    font-size: 1.3rem;
}

.card-body {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.weather-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.weather-icon {
    width: 80px;
    height: 80px;
}

.temp-value {
    font-size: 3.5rem;
    font-weight: 200;
    color: var(--color-primary);
}

.temp-unit {
    font-size: 1rem;
    color: var(--color-text-secondary);
}

.weather-condition {
    font-size: 1.1rem;
    font-weight: 500;
}

.feels-like {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.card-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

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

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

.detail-label {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.25rem;
}

.detail-value {
    font-size: 1rem;
    font-weight: 500;
}

.section-title {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
}

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

.info-item {
    background: var(--color-bg-tertiary);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.info-label {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.25rem;
}

.info-value {
    font-size: 1.1rem;
    font-weight: 500;
}

.footer {
    background: rgba(10, 15, 28, 0.8);
    backdrop-filter: blur(8px);
    padding: 1rem 0;
    border-top: 1px solid var(--color-border);
}

.footer-content {
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.last-update {
    margin-top: 0.25rem;
}

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-bg-secondary);
    color: var(--color-text);
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    z-index: 1001;
}

.toast.show {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-main {
        gap: 0.5rem;
        font-size: 0.85rem;
    }

    .nav-link {
        padding: 0.3rem 0.75rem;
    }

    .weather-card {
        padding: 1.5rem;
    }

    .card-body {
        flex-direction: column;
        text-align: center;
    }

    .weather-icon {
        width: 60px;
        height: 60px;
    }

    .temp-value {
        font-size: 2.5rem;
    }

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

@media (max-width: 480px) {
    .temp-value {
        font-size: 2rem;
    }

    .weather-icon {
        width: 50px;
        height: 50px;
    }

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

/* Weather Icons */
.weather-icon-clear {
    background: radial-gradient(circle at 30% 30%, #fff8, transparent 50%);
    clip-path: polygon(50% 0%, 65% 35%, 100% 50%, 65% 65%, 50% 100%, 35% 65%, 0% 50%, 35% 35%);
}

.weather-icon-rain {
    background: linear-gradient(135deg, #4a5568, #2d3748);
    clip-path: polygon(50% 0%, 70% 20%, 70% 50%, 50% 40%, 30% 50%, 30% 20%);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}