/* Mobile First Styles */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	min-height: 100vh;
	color: #1a1a2e;
	line-height: 1.5;
	padding: 12px;
}

.container {
	max-width: 800px;
	margin: 0 auto;
}

/* Header */
.header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
	flex-wrap: wrap;
	gap: 12px;
}

.logo {
	font-size: 1.5rem;
	font-weight: 700;
	color: white;
	text-decoration: none;
	text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.city-selector {
	background: white;
	border-radius: 10px;
	padding: 4px 8px 4px 16px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
	min-width: 200px;
	width: 100%;
}

.city-select {
	width: 100%;
	padding: 10px 8px 10px 0;
	border: none;
	background: transparent;
	font-size: 1rem;
	font-weight: 500;
	color: #1a1a2e;
	outline: none;
	cursor: pointer;
}

.section-title {
	font-size: 1.5rem;
	font-weight: 600;
	margin-bottom: 12px;
	color: #1a1a2e;
}

/* Location Header */
.location-header {
	background: rgba(255,255,255,0.95);
	border-radius: 10px;
	padding: 16px 20px;
	margin-bottom: 16px;
	backdrop-filter: blur(10px);
	box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.city-name {
	font-size: 1.75rem;
	font-weight: 700;
	color: #1a1a2e;
	margin-bottom: 4px;
}

.region-name {
	color: #666;
	font-size: 0.95rem;
	margin-bottom: 8px;
}

.update-info {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.85rem;
	color: #666;
}

.update-badge {
	background: #e8f5e9;
	color: #2e7d32;
	padding: 4px 12px;
	border-radius: 10px;
	font-weight: 500;
}

.last-city {
	background: #fff;
	padding: 10px 16px;
	border-radius: 10px;
	margin-bottom: 12px;
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.link-btn {
	margin-left: auto;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff;
	padding: 6px 16px;
	border-radius: 20px;
	text-decoration: none;
	font-size: 0.85rem;
	font-weight: 500;
}

/* Comparison Cards */
.comparison-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-bottom: 16px;
}

.weather-card {
	background: rgba(255,255,255,0.95);
	border-radius: 10px;
	padding: 18px 14px;
	backdrop-filter: blur(10px);
	box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.card-header {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
}

.card-label {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #666;
}

.card-date {
	font-weight: 600;
	color: #1a1a2e;
}

.weather-icon-large {
	font-size: 3rem;
	text-align: center;
	margin: 8px 0;
}

.temperature-large {
	font-size: 3rem;
	font-weight: 700;
	text-align: center;
	line-height: 1.2;
}

.temp-range {
	text-align: center;
	color: #666;
	font-size: 0.9rem;
	margin-top: 4px;
}

.weather-desc {
	text-align: center;
	font-weight: 500;
	margin: 8px 0;
	padding: 8px 0;
	border-top: 1px solid #eee;
	border-bottom: 1px solid #eee;
}

.detail-item {
	display: flex;
	justify-content: space-between;
	margin-top: 6px;
	font-size: 0.9rem;
}

.detail-label {
	color: #666;
}

.detail-value {
	font-weight: 500;
	color: #1a1a2e;
}

/* Advice Card */
.advice-card {
	background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
	border-radius: 10px;
	padding: 24px 20px;
	margin-bottom: 16px;
	color: white;
	box-shadow: 0 12px 32px rgba(0,0,0,0.2);
}

.advice-header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
}

.advice-icon {
	font-size: 2.5rem;
	background: rgba(255,255,255,0.1);
	width: 60px;
	height: 60px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
}

.advice-title {
	font-size: 1.2rem;
	font-weight: 500;
	color: #aaa;
}

.advice-main {
	font-size: 1.5rem;
	font-weight: 700;
	margin-bottom: 8px;
}

.advice-details {
	color: #ccc;
	font-size: 0.95rem;
	line-height: 1.5;
}

/* Current Conditions */
.current-card {
	background: rgba(255,255,255,0.95);
	border-radius: 10px;
	padding: 18px;
	margin-bottom: 16px;
	backdrop-filter: blur(10px);
	box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.current-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
	margin-top: 12px;
}

.current-item {
	display: flex;
	flex-direction: column;
}

.current-label {
	color: #666;
	font-size: 0.85rem;
	margin-bottom: 4px;
}

.current-value {
	font-size: 1.2rem;
	font-weight: 600;
	color: #1a1a2e;
}

/* Hourly Forecast */
.hourly-forecast-card {
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    padding: 18px;
    margin-bottom: 16px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hourly-scroll {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.hourly-scroll::-webkit-scrollbar {
    height: 4px;
}

.hourly-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.hourly-item {
    flex: 0 0 100px;
    background: #f8fafc;
    border-radius: 16px;
    padding: 12px 8px;
    text-align: center;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.hourly-item.current-hour {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.hourly-item.current-hour .hourly-time,
.hourly-item.current-hour .hourly-temp,
.hourly-item.current-hour .hourly-feels,
.hourly-item.current-hour .hourly-precip,
.hourly-item.current-hour .hourly-wind {
    color: white;
}

.hourly-time {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 8px;
    color: #1a1a2e;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.current-badge {
    background: rgba(255,255,255,0.3);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
}

.hourly-icon {
    font-size: 2rem;
    margin: 8px 0;
}

.hourly-temp {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a2e;
}

.hourly-feels {
    font-size: 0.8rem;
    color: #64748b;
    margin: 4px 0;
}

.hourly-item.current-hour .hourly-feels {
    color: rgba(255,255,255,0.8);
}

.hourly-precip {
    font-size: 0.8rem;
    color: #3b82f6;
    margin-top: 6px;
}

.hourly-item.current-hour .hourly-precip {
    color: #bfdbfe;
}

.hourly-wind {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 4px;
}

.hourly-item.current-hour .hourly-wind {
    color: rgba(255,255,255,0.8);
}

.day-summary {
	margin-bottom: 16px;
	padding: 12px;
	background: #f1f5f9;
	border-radius: 12px;
}

.day-summary .day-summary-grid {
	display: flex;
	justify-content: space-around;
	text-align: center;
}

.day-summary .day-summary-grid .item-title {
	color: #64748b;
	font-size: 0.8rem;
}

.day-summary .day-summary-grid .item-value {
	font-weight: 600;
	font-size: 1.1rem;
}

/* Popular Cities */
.popular-cities,
.nearby-cities {
	background: rgba(255,255,255,0.95);
	border-radius: 10px;
	padding: 18px;
	margin-bottom: 16px;
	backdrop-filter: blur(10px);
	box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.cities-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 8px;
}

.city-link {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px 12px;
	background: #f5f5f5;
	border-radius: 5px;
	text-decoration: none;
	color: #1a1a2e;
	font-weight: 500;
	transition: all 0.2s;
	text-align: center;
}

.city-link:hover {
	background: #667eea;
	color: white;
	transform: translateY(-2px);
}

.nearby-cities .city-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.nearby-cities .nearby-city-distance {
	margin: 5px;
	font-size: 0.75em;
}

/* Блок цитаты — Mobile First */
.quote-block {
    background: linear-gradient(135deg, #2d3b5e 0%, #1a2332 100%);
    border-radius: 24px;
    padding: 20px 18px;
    margin: 20px 0;
    color: white;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.quote-content {
    display: flex;
    gap: 14px;
    align-items: center;
}

.quote-icon {
    font-size: 2.2rem;
    line-height: 1;
    background: rgba(255,255,255,0.1);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    flex-shrink: 0;
}

.quote-text {
    font-size: 1.1rem;
    line-height: 1.5;
    font-weight: 500;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    quotes: "«" "»" "„" "“";
}

.quote-text::before {
    content: "«";
    opacity: 0.7;
    margin-right: 3px;
}

.quote-text::after {
    content: "»";
    opacity: 0.7;
    margin-left: 3px;
}

.quote-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.15);
}

.quote-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.7;
    font-weight: 500;
}

.quote-refresh {
    background: rgba(255,255,255,0.15);
/*    border: none;*/
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 40px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(5px);
    padding: 0;
}

.quote-refresh:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(180deg);
}

.quote-refresh:active {
    transform: scale(0.9) rotate(180deg);
}

/* Адаптация для планшетов */
@media (min-width: 640px) {
    .quote-block {
        padding: 24px 22px;
        border-radius: 28px;
    }
    
    .quote-icon {
        font-size: 2.5rem;
        width: 60px;
        height: 60px;
    }
    
    .quote-text {
        font-size: 1.25rem;
    }
}

/* Десктоп */
@media (min-width: 1024px) {
    .quote-block {
        padding: 28px 26px;
    }
    
    .quote-text {
        font-size: 1.35rem;
    }
}

/* Анимация появления */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quote-block {
    animation: fadeInUp 0.5s ease-out;
}

/* Error State */
.error-card {
	background: #ffebee;
	border-radius: 10px;
	padding: 24px;
	text-align: center;
	color: #c62828;
	margin-bottom: 16px;
}

/* Footer */
.footer {
	text-align: center;
	padding: 20px;
	color: rgba(255,255,255,0.7);
	font-size: 0.85rem;
}

.footer a {
	color: white;
	text-decoration: none;
}

/* Responsive adjustments */
@media (max-width: 480px) {
	body {
		padding: 8px;
	}
	
	.comparison-grid {
		gap: 8px;
	}
	
	.weather-card {
		padding: 14px 10px;
	}
	
	.temperature-large {
		font-size: 2.5rem;
	}
	
	.city-name {
		font-size: 1.5rem;
	}
	
	.current-grid {
		grid-template-columns: 1fr;
	}
	.hourly-item {
        flex: 0 0 110px;
        padding: 14px 10px;
    }
    
    .hourly-temp {
        font-size: 1.5rem;
    }
}
@media (min-width: 640px) {
	.city-selector {
		width: auto;
	}
}
@media (min-width: 768px) {
	.container {
		max-width: 900px;
	}
	
	.comparison-grid {
		gap: 20px;
	}
	
	.weather-card {
		padding: 24px 20px;
	}
	
	.card-label {
		font-size: 1rem;
	}
	
	.temperature-large {
		font-size: 3.5rem;
	}
	.hourly-scroll {
        gap: 16px;
    }
    
    .hourly-item {
        flex: 0 0 120px;
    }
	.card-header {
		flex-direction: row;
	}
}

/* ========== COURIER BANNER - MOBILE FIRST ========== */

.courier-banner {
    background: linear-gradient(135deg, #f5a623 0%, #f76b1c 100%);
    border-radius: 20px;
    padding: 16px;
    margin: 16px 0;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 6px 20px rgba(245, 166, 35, 0.25);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.courier-banner:active {
    transform: scale(0.98);
    box-shadow: 0 4px 16px rgba(245, 166, 35, 0.3);
}

.courier-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.courier-icon {
    font-size: 2.5rem;
    line-height: 1;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.15));
    flex-shrink: 0;
}

.courier-info {
    flex: 1;
    min-width: 0;
}

.courier-title {
    font-size: 1.5rem;
    font-weight: 700;
	color: #fff;
    margin-bottom: 4px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.1);
    line-height: 1.3;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.courier-badge-basic {
    display: inline-block;
    background: rgba(255,255,255,0.25);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    backdrop-filter: blur(4px);
}

.courier-subtitle {
    opacity: 0.95;
    margin-bottom: 10px;
    font-size: 0.8rem;
    line-height: 1.4;
}

.courier-button {
    display: inline-block;
    background: white;
    color: #f76b1c;
    padding: 6px 16px;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,0.3);
}

/* Теги ЖК */
.courier-tags {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.courier-tag-label {
    font-size: 0.75rem;
    opacity: 0.9;
    white-space: nowrap;
}

.courier-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.courier-tag {
    background: rgba(255,255,255,0.2);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    backdrop-filter: blur(4px);
    white-space: nowrap;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Очень маленькие экраны (до 360px) */
@media (max-width: 360px) {
    .courier-banner {
        padding: 14px;
    }
    
    .courier-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 8px;
    }
    
    .courier-icon {
        font-size: 2.2rem;
    }
    
    .courier-title {
        font-size: 1.25rem;
        justify-content: center;
    }
    
    .courier-subtitle {
        font-size: 0.75rem;
    }
    
    .courier-button {
        padding: 5px 14px;
        font-size: 1rem;
    }
    
    .courier-tags {
        justify-content: center;
    }
    
    .courier-tags-list {
        justify-content: center;
    }
}

/* Маленькие экраны (361px - 480px) */
@media (min-width: 361px) and (max-width: 480px) {
    .courier-icon {
        font-size: 2.8rem;
    }
    
    .courier-title {
        font-size: 1.1rem;
    }
    
    .courier-subtitle {
        font-size: 0.8rem;
    }
}

/* Средние экраны - планшеты (481px - 768px) */
@media (min-width: 481px) {
    .courier-banner {
        padding: 18px;
        border-radius: 24px;
    }
    
    .courier-content {
        gap: 16px;
    }
    
    .courier-icon {
        font-size: 3.2rem;
    }
    
    .courier-title {
        font-size: 1.2rem;
    }
    
    .courier-subtitle {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }
	
	.courier-btn-wrap {
		text-align: center;
		margin: 20px 0;
	}
    
    .courier-button {
        padding: 8px 20px;
        font-size: 1.25rem;
    }
    
    .courier-tag {
        font-size: 0.75rem;
        padding: 4px 12px;
    }
}

/* Большие экраны - десктоп (769px+) */
@media (min-width: 769px) {
    .courier-banner {
        padding: 25px;
        margin: 20px 0;
        box-shadow: 0 8px 24px rgba(245, 166, 35, 0.3);
    }
    
    .courier-banner:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 32px rgba(245, 166, 35, 0.4);
    }
    
    .courier-banner:active {
        transform: translateY(0);
    }
    
    .courier-content {
        gap: 20px;
    }
    
    .courier-icon {
        font-size: 3.5rem;
    }
    
    .courier-title {
        font-size: 1.75rem;
    }
    
    .courier-subtitle {
        font-size: 0.95rem;
        margin-bottom: 14px;
    }
    
    .courier-button {
        padding: 10px 24px;
    }
    
    .courier-banner:hover .courier-button {
        background: #fff5f0;
        transform: scale(1.02);
    }
}

/* Доступность */
.courier-banner:focus-visible {
    outline: 3px solid white;
    outline-offset: 2px;
}

/* Анимация */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.courier-banner {
    animation: slideInUp 0.4s ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .courier-banner {
        animation: none;
        transition: none;
    }
}

/* PWA Install Banner */
.pwa-install-banner {
    position: fixed;
    bottom: 20px;
    left: 16px;
    right: 16px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    z-index: 1000;
    animation: slideUp 0.3s ease-out;
    border: 1px solid rgba(255,255,255,0.1);
    max-width: 500px;
    margin: 0 auto;
}

.pwa-install-content {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.pwa-install-icon {
    font-size: 2.5rem;
    background: rgba(255,255,255,0.1);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    flex-shrink: 0;
}

.pwa-install-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pwa-install-text strong {
    font-size: 1rem;
    font-weight: 600;
}

.pwa-install-text span {
    font-size: 0.8rem;
    opacity: 0.8;
}

.pwa-install-button {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.pwa-install-button:active {
    transform: scale(0.95);
    background: #5a6fd6;
}

.pwa-install-close {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s;
}

.pwa-install-close:hover {
    color: white;
}

/* iOS Install Banner */
.ios-install-banner {
    position: fixed;
    bottom: 20px;
    left: 16px;
    right: 16px;
    background: #1a1a2e;
    border-radius: 20px;
    padding: 14px 18px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    z-index: 1000;
    color: white;
    max-width: 500px;
    margin: 0 auto;
    border: 1px solid rgba(255,255,255,0.1);
}

.ios-install-content {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 0.9rem;
}

.ios-share-icon {
    background: #3b82f6;
    color: white;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
}

.ios-install-close {
    background: rgba(255,255,255,0.15);
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 40px;
    font-size: 0.85rem;
    cursor: pointer;
    margin-left: auto;
}

/* Анимации */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Адаптация для десктопа */
@media (min-width: 768px) {
    .pwa-install-banner,
    .ios-install-banner {
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        width: 100%;
    }
    
    .pwa-install-banner {
        animation: slideUpDesktop 0.3s ease-out;
    }
}

@keyframes slideUpDesktop {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}