sw-fe/src/components/Weather/WeatherModal.css

297 lines
4.8 KiB
CSS

.weather-modal-backdrop {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.6);
backdrop-filter: blur(4px);
display: flex;
align-items: center;
justify-content: center;
z-index: 10000;
padding: 20px;
}
.weather-modal {
background: linear-gradient(135deg, #1a1f35 0%, #0d1117 100%);
border-radius: 20px;
width: 100%;
max-width: 420px;
max-height: 90vh;
overflow-y: auto;
position: relative;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
color: #fff;
}
.weather-modal--loading,
.weather-modal--error {
padding: 60px;
text-align: center;
}
.weather-loading-spinner {
width: 40px;
height: 40px;
border: 3px solid rgba(255, 255, 255, 0.2);
border-top-color: #60a5fa;
border-radius: 50%;
animation: spin 1s linear infinite;
margin: 0 auto;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
.weather-modal-close {
position: absolute;
top: 12px;
right: 12px;
width: 36px;
height: 36px;
border: none;
background: rgba(255, 255, 255, 0.1);
color: #fff;
font-size: 24px;
border-radius: 50%;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.2s;
z-index: 10;
}
.weather-modal-close:hover {
background: rgba(255, 255, 255, 0.2);
}
.weather-modal-header {
padding: 24px 24px 0;
text-align: center;
}
.weather-modal-header h2 {
margin: 0;
font-size: 28px;
font-weight: 600;
}
.weather-modal-country {
color: rgba(255, 255, 255, 0.6);
font-size: 14px;
}
.weather-current {
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
}
.weather-current-icon {
font-size: 72px;
line-height: 1;
}
.weather-current-temp {
font-size: 80px;
font-weight: 300;
line-height: 1;
margin: 8px 0;
}
.weather-current-details {
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
}
.weather-condition {
font-size: 18px;
font-weight: 500;
}
.weather-feels {
font-size: 14px;
color: rgba(255, 255, 255, 0.6);
}
.weather-stats {
display: flex;
justify-content: space-around;
padding: 16px 24px;
border-top: 1px solid rgba(255, 255, 255, 0.1);
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.weather-stat {
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
}
.weather-stat-icon {
font-size: 24px;
}
.weather-stat-value {
font-size: 16px;
font-weight: 600;
}
.weather-stat-label {
font-size: 12px;
color: rgba(255, 255, 255, 0.5);
text-transform: uppercase;
letter-spacing: 0.5px;
}
.weather-tabs {
display: flex;
padding: 0 24px;
margin-top: 16px;
gap: 8px;
}
.weather-tabs button {
flex: 1;
padding: 10px 16px;
border: none;
background: rgba(255, 255, 255, 0.1);
color: rgba(255, 255, 255, 0.7);
font-size: 14px;
font-weight: 500;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s;
}
.weather-tabs button.active {
background: rgba(96, 165, 250, 0.3);
color: #fff;
}
.weather-tabs button:hover:not(.active) {
background: rgba(255, 255, 255, 0.15);
}
.weather-hourly {
display: flex;
gap: 4px;
padding: 16px 24px;
overflow-x: auto;
scrollbar-width: thin;
scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}
.weather-hourly::-webkit-scrollbar {
height: 6px;
}
.weather-hourly::-webkit-scrollbar-track {
background: transparent;
}
.weather-hourly::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.3);
border-radius: 3px;
}
.weather-hourly-item {
flex-shrink: 0;
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
padding: 12px 14px;
background: rgba(255, 255, 255, 0.05);
border-radius: 12px;
min-width: 60px;
}
.weather-hourly-time {
font-size: 12px;
color: rgba(255, 255, 255, 0.6);
}
.weather-hourly-icon {
font-size: 24px;
}
.weather-hourly-temp {
font-size: 16px;
font-weight: 600;
}
.weather-daily {
padding: 16px 24px;
display: flex;
flex-direction: column;
gap: 8px;
}
.weather-daily-item {
display: flex;
align-items: center;
padding: 12px 16px;
background: rgba(255, 255, 255, 0.05);
border-radius: 12px;
}
.weather-daily-day {
flex: 1;
font-size: 14px;
font-weight: 500;
}
.weather-daily-icon {
font-size: 24px;
margin-right: 16px;
}
.weather-daily-temps {
display: flex;
gap: 12px;
margin-right: 16px;
}
.weather-daily-high {
font-weight: 600;
}
.weather-daily-low {
color: rgba(255, 255, 255, 0.5);
}
.weather-daily-precip {
font-size: 12px;
color: #60a5fa;
min-width: 60px;
text-align: right;
}
.weather-modal-footer {
padding: 12px 24px;
text-align: center;
font-size: 11px;
color: rgba(255, 255, 255, 0.4);
border-top: 1px solid rgba(255, 255, 255, 0.1);
}
@media (max-width: 480px) {
.weather-modal {
max-width: 100%;
border-radius: 16px;
}
.weather-current-temp {
font-size: 64px;
}
.weather-current-icon {
font-size: 56px;
}
}