:root {
    --primary: #0f172a;
    --secondary: #1e293b;
    --accent: #3b82f6;
    --highlight: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --light: #f8fafc;
    --dark: #0f172a;
    --gradient-primary: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --gradient-secondary: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    --card-bg: rgba(255, 255, 255, 0.98);
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --radius-xl: 24px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --sunny-yellow: #fbbf24;
    --cloud-white: #f8fafc;
    --rain-blue: #3b82f6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

body {
    background: var(--gradient-primary);
    min-height: 100vh;
    color: var(--dark);
    position: relative;
    overflow-x: hidden;
}

.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 5% 15%, rgba(59, 130, 246, 0.1) 0%, transparent 25%),
        radial-gradient(circle at 95% 85%, rgba(6, 182, 212, 0.1) 0%, transparent 25%);
    pointer-events: none;
    z-index: -2;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.app-header {
    padding: 32px 0 24px;
    position: relative;
    z-index: 10;
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 24px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    box-shadow: var(--shadow);
}

.logo-text h1 {
    color: white;
    font-size: 36px;
    font-weight: 900;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #93c5fd, #22d3ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.logo-text p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    margin-top: 8px;
    font-weight: 500;
}

/* Search and Location Controls */
.controls-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 600px;
    width: 100%;
    position: relative;
}

.search-wrapper {
    display: flex;
    gap: 16px;
    flex: 1;
}

.search-container {
    position: relative;
    flex: 1;
}

.search-input-wrapper {
    display: flex;
    gap: 8px;
}

.search-input {
    width: 100%;
    padding: 20px 24px 20px 60px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--card-bg);
    font-size: 16px;
    font-weight: 500;
    color: var(--dark);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25);
}

.search-icon {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent);
    font-size: 20px;
    pointer-events: none;
}

/* Location Button */
.location-btn-small {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    height: 56px;
    min-width: 56px;
}

.location-btn-small:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(16, 185, 129, 0.3);
}

.location-btn-small:active {
    transform: translateY(0);
}

.location-btn-small i {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.location-btn-small:hover i {
    transform: scale(1.2);
}

.location-btn-small .location-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.location-btn-small:hover .location-glow {
    transform: translateX(100%);
}

/* Location Button Tooltip */
.location-btn-tooltip {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    color: white;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.location-btn-small:hover + .location-btn-tooltip {
    opacity: 1;
    visibility: visible;
    top: -45px;
}

/* Intelligent Search Results */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    margin-top: 8px;
    border: 1px solid rgba(226, 232, 240, 0.5);
}

.search-result-item {
    padding: 16px 24px;
    cursor: pointer;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-result-item:hover {
    background: rgba(59, 130, 246, 0.1);
}

.search-result-item:last-child {
    border-bottom: none;
}

.result-name {
    font-weight: 600;
    color: var(--secondary);
    font-size: 16px;
}

.result-region {
    font-size: 14px;
    color: #64748b;
    background: rgba(100, 116, 139, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
}

.no-results {
    padding: 24px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

/* Location Detection Status */
.location-status {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    display: none;
    z-index: 100;
    animation: slideDown 0.3s ease;
    max-width: 350px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.location-status-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.location-status-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.location-status-content h4 {
    font-size: 16px;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 4px;
}

.location-status-content p {
    font-size: 13px;
    color: #64748b;
}

.location-status-details {
    font-size: 13px;
    color: #64748b;
    padding: 12px 0;
    border-top: 1px solid rgba(226, 232, 240, 0.5);
}

/* Main Content */
.main-content {
    margin-bottom: 48px;
}

/* Weather Dashboard */
.weather-dashboard {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid rgba(226, 232, 240, 0.5);
}

.location-display h2 {
    font-size: 36px;
    color: var(--primary);
    margin-bottom: 8px;
    font-weight: 800;
    line-height: 1.2;
}

.location-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.region-tag {
    font-size: 14px;
    color: var(--accent);
    font-weight: 600;
    padding: 6px 16px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.current-time {
    text-align: right;
    color: #64748b;
    font-weight: 500;
}

.current-time .time {
    font-size: 32px;
    color: var(--primary);
    font-weight: 800;
    margin-bottom: 4px;
}

/* Current Weather */
.current-weather {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

.temp-section {
    text-align: center;
    position: relative;
}

.temp-main {
    font-size: 120px;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.temp-unit {
    font-size: 48px;
    margin-top: 28px;
    color: var(--accent);
}

.weather-icon-large {
    font-size: 120px;
    margin-bottom: 20px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Weather Image Styles */
.weather-image-large {
    font-size: 120px;
    margin-bottom: 20px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.weather-image-text {
    font-size: 120px;
    line-height: 1;
    animation: float 6s ease-in-out infinite;
}

.weather-icon-fallback {
    display: none;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.weather-description {
    font-size: 28px;
    color: var(--secondary);
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.weather-emoji {
    font-size: 32px;
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.weather-icon-large.sunny {
    color: var(--sunny-yellow);
}

.weather-icon-large.partly-cloudy {
    color: var(--sunny-yellow);
}

.weather-icon-large.cloudy {
    color: var(--cloud-white);
}

.weather-icon-large.rainy {
    color: var(--rain-blue);
}

.weather-icon-large.snowy {
    color: var(--cloud-white);
}

.weather-icon-large.stormy {
    color: #8b5cf6;
}

.feels-like {
    font-size: 20px;
    color: #64748b;
}

/* Additional Weather Info */
.weather-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 48px;
    padding-top: 48px;
    border-top: 2px solid rgba(226, 232, 240, 0.5);
}

.detail-card {
    background: rgba(226, 232, 240, 0.3);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.3s ease;
    border: 1px solid rgba(226, 232, 240, 0.5);
    text-align: center;
}

.detail-card:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: var(--accent);
    transform: translateY(-5px);
}

.detail-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.detail-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--gradient-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.detail-title {
    font-size: 16px;
    color: var(--secondary);
    font-weight: 600;
}

.detail-value {
    font-size: 28px;
    font-weight: 900;
    color: var(--primary);
}

.detail-unit {
    font-size: 16px;
    color: #64748b;
    margin-left: 4px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 80px;
    color: #cbd5e1;
    margin-bottom: 24px;
}

.empty-state-title {
    font-size: 24px;
    color: #64748b;
    font-weight: 700;
    margin-bottom: 12px;
}

.empty-state-description {
    font-size: 16px;
    color: #94a3b8;
    margin-bottom: 32px;
}

/* Loading State */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    color: white;
}

.loading-content {
    text-align: center;
    max-width: 500px;
    padding: 0 20px;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    border: 6px solid rgba(255, 255, 255, 0.1);
    border-top: 6px solid #22d3ee;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
    margin: 0 auto 30px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Toast */
.error-toast {
    position: fixed;
    top: 30px;
    right: 30px;
    background: var(--danger);
    color: white;
    padding: 20px 25px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    display: none;
    align-items: center;
    gap: 15px;
    z-index: 1001;
    max-width: 500px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 32px 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 48px;
}

/* Responsive Design */
@media (max-width: 992px) {
    .header-main {
        flex-direction: column;
        align-items: stretch;
    }
    
    .controls-container {
        max-width: 100%;
    }
    
    .search-wrapper {
        flex-direction: column;
    }
    
    .current-weather {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .weather-dashboard {
        padding: 32px 24px;
    }
    
    .temp-main {
        font-size: 100px;
    }
    
    .temp-unit {
        font-size: 36px;
        margin-top: 20px;
    }
    
    .weather-icon-large {
        font-size: 100px;
        height: 120px;
    }
    
    .weather-image-large {
        font-size: 80px;
        height: 120px;
    }
    
    .weather-image-text {
        font-size: 80px;
    }
    
    .weather-description {
        font-size: 24px;
    }
    
    .weather-emoji {
        font-size: 28px;
    }
    
    .location-display h2 {
        font-size: 32px;
    }
    
    .location-btn-small {
        padding: 10px 12px;
        min-width: 50px;
        height: 50px;
    }
    
    .weather-details {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .weather-dashboard {
        padding: 24px 20px;
    }
    
    .temp-main {
        font-size: 80px;
    }
    
    .weather-icon-large {
        font-size: 80px;
        height: 100px;
    }
    
    .weather-image-large {
        font-size: 60px;
        height: 100px;
    }
    
    .weather-image-text {
        font-size: 60px;
    }
    
    .weather-description {
        font-size: 20px;
    }
    
    .weather-emoji {
        font-size: 24px;
    }
    
    .detail-value {
        font-size: 24px;
    }
    
    .location-btn-small {
        padding: 8px;
        min-width: 45px;
        height: 45px;
        font-size: 12px;
    }
    
    .search-input {
        padding: 16px 20px 16px 50px;
    }
    
    .logo-text h1 {
        font-size: 28px;
    }
}
/* Language Toggle Button */
.language-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    z-index: 1000;
}

.language-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* RTL Support for Kurdish */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .search-container {
    direction: rtl;
}

[dir="rtl"] .language-toggle {
    right: auto;
    left: 20px;
}

[dir="rtl"] .location-info {
    text-align: right;
}

[dir="rtl"] .weather-stats {
    direction: rtl;
}

/* Kurdish Font Support */
[lang="ku"] {
    font-family: 'Segoe UI', 'Tahoma', 'Arial', sans-serif;
}
/* Language Toggle Button */
.language-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.language-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* ========== COMPLETE RTL SUPPORT FOR KURDISH ========== */

/* ========== COMPLETE RTL SUPPORT FOR KURDISH - FIXED ========== */

/* Language Toggle */
[dir="rtl"] .language-toggle {
    right: auto !important;
    left: 20px !important;
}

/* Header - Logo should be on RIGHT in RTL */
[dir="rtl"] .header-main {
    flex-direction: row-reverse;
}

[dir="rtl"] .logo-container {
    flex-direction: row-reverse;
}

[dir="rtl"] .logo {
    margin-right: 0;
    margin-left: 20px;
}

[dir="rtl"] .logo-text {
    text-align: right;
}

[dir="rtl"] .logo-text h1 {
    text-align: right;
}

[dir="rtl"] .logo-text p {
    text-align: right;
}

/* Controls Container - More space between search and locate button */
[dir="rtl"] .controls-container {
    align-items: flex-end;
}

[dir="rtl"] .search-wrapper {
    gap: 24px; /* More space between search and green button */
}

/* Search Container */
[dir="rtl"] .search-input-wrapper {
    flex-direction: row-reverse;
    gap: 16px; /* More space */
}

[dir="rtl"] .search-input {
    padding: 20px 60px 20px 24px !important;
    text-align: right;
}

[dir="rtl"] .search-icon {
    left: auto !important;
    right: 24px !important;
}

/* Location Button - Stays separate with more space */
[dir="rtl"] .location-btn-small {
    margin-right: 0;
    margin-left: 0;
}

/* Location Status (Green Box) */
[dir="rtl"] .location-status {
    right: auto !important;
    left: 0 !important;
}

[dir="rtl"] .location-status-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .location-status-icon {
    margin-right: 0;
    margin-left: 12px;
}

[dir="rtl"] .location-status-content {
    text-align: right;
}

[dir="rtl"] .location-status-content h4 {
    text-align: right;
}

[dir="rtl"] .location-status-content p {
    text-align: right;
}

[dir="rtl"] .location-status-details {
    text-align: right;
}

/* Dashboard Header - SWAP POSITIONS */
[dir="rtl"] .dashboard-header {
    flex-direction: row-reverse; /* This swaps the positions */
}

[dir="rtl"] .location-display {
    text-align: right;
    order: 2; /* Move to right side */
}

[dir="rtl"] .location-display h2 {
    text-align: right;
}

[dir="rtl"] .current-time {
    text-align: left;
    order: 1; /* Move to left side */
}

/* Location Meta Tags */
[dir="rtl"] .location-meta {
    justify-content: flex-start;
    flex-direction: row-reverse;
}

[dir="rtl"] .region-tag {
    margin-left: 0;
    margin-right: 12px;
}

[dir="rtl"] .region-tag:first-child {
    margin-right: 0;
}

/* Current Weather */
[dir="rtl"] .current-weather {
    direction: ltr; /* Keep the grid normal, just swap content */
}

[dir="rtl"] .temp-section {
    text-align: center;
    order: 2;
}

[dir="rtl"] .weather-icon-large {
    order: 1;
}

[dir="rtl"] .temp-main {
    flex-direction: row-reverse;
}

[dir="rtl"] .feels-like {
    text-align: center;
}

/* Weather Details */
[dir="rtl"] .weather-details {
    direction: rtl;
}

[dir="rtl"] .detail-card {
    text-align: center;
}

[dir="rtl"] .detail-header {
    flex-direction: row-reverse;
    justify-content: center;
}

[dir="rtl"] .detail-icon {
    margin-right: 0;
    margin-left: 12px;
}

[dir="rtl"] .detail-unit {
    margin-left: 0;
    margin-right: 4px;
}

[dir="rtl"] .detail-title {
    text-align: center;
}

/* Search Results */
[dir="rtl"] .search-results {
    text-align: right;
}

[dir="rtl"] .search-result-item {
    flex-direction: row-reverse;
}

[dir="rtl"] .result-name {
    text-align: right;
}

[dir="rtl"] .result-region {
    text-align: right;
}

/* Empty State */
[dir="rtl"] .empty-state {
    text-align: center;
}

[dir="rtl"] .empty-state-title {
    text-align: center;
}

[dir="rtl"] .empty-state-description {
    text-align: center;
}

/* Button Icons */
[dir="rtl"] .location-btn-small {
    flex-direction: row-reverse;
}

[dir="rtl"] .location-btn-small i {
    margin-right: 0;
    margin-left: 8px;
}

[dir="rtl"] #emptyLocationBtn {
    flex-direction: row-reverse;
}

[dir="rtl"] .btn-text {
    order: 1;
}

/* Error Toast */
[dir="rtl"] .error-toast {
    right: auto !important;
    left: 30px !important;
    flex-direction: row-reverse;
}

/* Weather Description */
[dir="rtl"] .weather-description {
    flex-direction: row-reverse;
}

/* Responsive RTL Adjustments */
@media (max-width: 992px) {
    [dir="rtl"] .header-main {
        flex-direction: column-reverse;
    }
}

@media (max-width: 768px) {
    [dir="rtl"] .search-input {
        padding: 16px 60px 16px 20px !important;
    }
    
    [dir="rtl"] .dashboard-header {
        flex-direction: column;
    }
    
    [dir="rtl"] .location-display {
        order: 1;
        margin-bottom: 16px;
    }
    
    [dir="rtl"] .current-time {
        order: 2;
        text-align: right;
    }
}

@media (max-width: 480px) {
    [dir="rtl"] .search-input {
        padding: 16px 55px 16px 20px !important;
    }
}