/* Vreme Vransko - Nova stran */

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

:root {
    --header-bg: #2e5473;
    --header-color: #f7fafc;
    --widget-bg: #ffffff;
    --widget-shadow: rgba(0, 0, 0, 0.1);
    --temp-color: #2e5473;
    --label-color: #78a5c9;
    --max-color: #d43f3a;
    --min-color: #4a86b7;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f7fafc;
    color: #333;
    min-width: 320px;
}

/* Header */
.header {
    background-color: var(--header-bg);
    padding: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.header-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--header-color);
}

.header-time {
    text-align: right;
}

.header-location {
    display: flex;
    flex-direction: column;
    gap: 0;
    font-size: 13px;
}

.header-location span {
    color: var(--header-color);
}

.header-location span:first-child {
    font-size: 13px;
    font-weight: 400;
}

.header-location span:nth-child(3) {
    display: none;
}

.header-astro {
    display: flex;
    gap: 25px;
    margin-top: 4px;
}

.header-time .digi-clock {
    font-size: 32px;
    font-weight: 600;
}

.header-sun {
    display: flex;
    gap: 25px;
    font-size: 15px;
    flex-wrap: wrap;
}

.header-sun span {
    white-space: nowrap;
}

.header-moon {
    display: flex;
    gap: 25px;
    font-size: 15px;
    flex-wrap: wrap;
}

.header-moon span {
    white-space: nowrap;
}

#moonPhase {
    font-size: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    max-width: 300px;
    height: auto;
    display: block;
}

/* Main Content */
.main-content {
    padding: 60px 20px;
    min-height: calc(100vh - 120px);
}

.weather-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.weather-row > * {
    min-width: 0;
}

/* Weather Widget */
.weather-widget {
    background: var(--widget-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px var(--widget-shadow);
    text-align: center;
    border: 1px solid #e4edf4;
    display: flex;
    flex-direction: column;
}

.widget-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--temp-color);
    display: block;
}

.weather-widget hr {
    margin: 10px 0;
    border: none;
    border-top: 1px solid #e4edf4;
}

.widget-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.widget-main {
    width: 80%;
    margin: 0 auto;
    text-align: center;
    line-height: 1.2;
    min-height: 7rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.widget-side {
    width: 100%;
    text-align: left;
}

.widget-side p {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}

.widget-side p br {
    display: none;
}

.widget-side p {
    margin: 8px 0;
}

.widget-label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--temp-color);
    font-size: 16px;
}

.widget-extra {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e4edf4;
    font-size: 14px;
    text-align: left;
}

.widget-extra p {
    margin: 5px 0;
}

.temp-value, .press-value, .rain-value, .hum-value, .dew-value, .chill-value {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 600;
    color: var(--temp-color);
    line-height: 1;
    display: block;
    min-height: 1em;
}

.temp-unit, .press-unit, .rain-unit, .hum-unit, .dew-unit, .chill-unit {
    font-size: clamp(2rem, 4.2vw, 3.3rem);
    font-weight: 400;
    color: #6b8aa3;
    display: block;
    margin-top: 0.3rem;
    line-height: 1.5;
    min-height: 3.3rem;
}

.high {
    color: var(--max-color);
    font-weight: 600;
}

.low {
    color: var(--min-color);
    font-weight: 600;
}

.gauge-container {
    text-align: center;
    padding: 20px 0;
}

.gauge-size {
    max-width: 100%;
    height: auto;
}

.clock-center {
    margin: 20px 0;
}

.digi-clock {
    font-size: 300%;
    font-weight: 600;
    color: var(--temp-color);
}

/* Hide RGraph SVG overlays */
svg {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

canvas + * {
    display: none !important;
}

/* Forecast */
.forecast {
    margin-top: 50px;
}

.forecast-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 10px;
}

.forecast-header h2 {
    font-size: 22px;
    color: var(--temp-color);
}

.forecast-source {
    font-size: 13px;
    color: var(--label-color);
    font-weight: 500;
}

.forecast-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-compare {
    padding: 8px 14px;
    border: 1px solid #78a5c9;
    background: #fff;
    color: #2e5473;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-compare:hover {
    background: #2e5473;
    color: #fff;
}

/* Tooltip za modele */
.model-tooltip {
    position: fixed;
    background: rgba(46, 84, 115, 0.95);
    color: white;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    z-index: 9999;
    pointer-events: none;
    max-width: 280px;
    word-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    line-height: 1.5;
}

.model-tooltip strong {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    max-width: 1100px;
    width: 95%;
    max-height: 95vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e4edf4;
}

.modal-header h2 {
    color: #2e5473;
    font-size: 20px;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #2e5473;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #d43f3a;
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    max-height: calc(95vh - 120px);
}

.compare-controls {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.compare-controls label {
    font-weight: 600;
    color: #2e5473;
}

.compare-controls select {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #c9dbe9;
    font-size: 13px;
    color: #2e5473;
    background: #f0f4f8;
}

.compare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.compare-card {
    background: #f7fafc;
    border: 1px solid #c9dbe9;
    border-radius: 12px;
    padding: 14px;
}

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

.compare-flag {
    font-size: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.compare-flag-img {
    width: 32px;
    height: 24px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
}

.compare-model {
    font-weight: 600;
    color: #2e5473;
    font-size: 14px;
    text-align: left;
}

.compare-temps {
    display: flex;
    gap: 12px;
    margin-bottom: 6px;
}

.compare-temp {
    text-align: left;
    flex: 0 0 auto;
}

.compare-label {
    font-size: 11px;
    color: #78a5c9;
    text-transform: uppercase;
    text-align: left;
}

.compare-value {
    font-size: 18px;
    font-weight: 600;
    color: #2e5473;
    text-align: left;
}

.compare-precip {
    font-size: 13px;
    color: #4a86b7;
    margin-top: 6px;
    text-align: left;
}

.compare-wind {
    font-size: 13px;
    color: #6b7d8f;
    margin-top: 4px;
    text-align: left;
}

.forecast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.forecast-card {
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.forecast-date {
    font-weight: 600;
    color: var(--temp-color);
    font-size: 15px;
}

.forecast-icon {
    font-size: 26px;
}

.forecast-desc {
    font-size: 14px;
    color: #444;
}

.forecast-temps {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    color: var(--temp-color);
}

.forecast-precip {
    font-size: 13px;
    color: var(--label-color);
}

.forecast-wind {
    font-size: 13px;
    color: var(--label-color);
    margin-top: 4px;
}

/* Location Info */
.location-info {
    margin-bottom: 20px;
    font-size: 18px;
    color: var(--label-color);
    font-weight: 500;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.weather-time {
    font-size: 13px;
    color: var(--label-color);
    font-weight: normal;
    letter-spacing: normal;
    opacity: 0.8;
}

/* Current Temperature */
.current-temp {
    margin-bottom: 20px;
    line-height: 1;
}

.temp-value {
    font-size: 120px;
    font-weight: 600;
    color: var(--temp-color);
    display: inline-block;
}

/* Cloud Cover */
.cloud-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    padding: 15px;
    background: #f0f4f8;
    border-radius: 12px;
}

.cloud-icon {
    font-size: 24px;
}

.cloud-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--temp-color);
}

.cloud-label {
    font-size: 14px;
    color: var(--label-color);
    font-weight: 500;
}

.cloud-time {
    font-size: 12px;
    color: var(--label-color);
    margin-left: auto;
    opacity: 0.8;
}

/* Min/Max Temperatures */
.temp-minmax {
    display: flex;
    justify-content: space-around;
    gap: 40px;
    padding-top: 30px;
    border-top: 2px solid #e4edf4;
}

.temp-max,
.temp-min {
    flex: 1;
}

.temp-minmax .label {
    display: block;
    font-size: 14px;
    color: var(--label-color);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.temp-minmax .value {
    display: block;
    font-size: 32px;
    font-weight: 600;
}

.temp-max .value {
    color: var(--max-color);
}

.temp-min .value {
    color: var(--min-color);
}

.temp-time {
    font-size: 12px;
    color: var(--label-color);
    display: block;
    margin-top: 5px;
    opacity: 0.8;
}

/* Wind Widget */
.wind-widget {
    background: var(--widget-bg);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 12px var(--widget-shadow);
    border: 1px solid #e4edf4;
}

.wind-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    gap: 20px;
}

.wind-speed-display {
    text-align: left;
    flex: 1;
    white-space: nowrap;
}

.wind-speed-value {
    font-size: 72px;
    font-weight: 600;
    color: var(--temp-color);
    line-height: 1;
}

.wind-speed-unit {
    font-size: 24px;
    font-weight: 400;
    color: var(--temp-color);
    margin-left: 5px;
}

.wind-title-area {
    text-align: center;
    flex: 1;
}

.wind-title-area h3 {
    font-size: 22px;
    color: var(--temp-color);
    margin: 0;
    display: inline-block;
}

.wind-time {
    font-size: 12px;
    color: var(--label-color);
    opacity: 0.8;
    display: inline-block;
    margin-left: 5px;
}

.wind-gust-display {
    text-align: right;
    flex: 1;
}

.wind-gust-label {
    font-size: 14px;
    color: var(--label-color);
    display: block;
    margin-bottom: 5px;
}

.wind-gust-value {
    font-size: 32px;
    font-weight: 600;
    color: #d43f3a;
    display: block;
    line-height: 1;
}

.wind-gust-unit {
    font-size: 14px;
    font-weight: 400;
    color: var(--label-color);
    margin-left: 3px;
}

.wind-gauge-container {
    text-align: center;
    margin: 20px 0;
    min-height: 380px;
}

.wind-gauge-container canvas {
    max-width: 100%;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Responsive Design */
@media (max-width: 960px) {
    .weather-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .weather-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 15px 0;
    }
    
    .header-content {
        gap: 15px;
    }
    
    .logo {
        max-width: 180px;
    }
    
    .header-info {
        gap: 5px;
    }
    
    .header-time .digi-clock {
        font-size: 24px;
    }
    
    .header-location {
        font-size: 11px;
    }
    
    .header-sun {
        gap: 12px;
        font-size: 11px;
    }
    
    .main-content {
        padding: 40px 15px;
    }
    
    .weather-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .weather-widget {
        padding: 40px 30px;
    }

    .wind-widget {
        padding: 30px 20px;
    }

    .forecast-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
    
    .temp-value {
        font-size: 90px;
    }
    
    .temp-unit {
        font-size: 36px;
    }
    
    .temp-minmax {
        gap: 20px;
    }
    
    .temp-minmax .value {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 8px 0;
    }
    
    .header-content {
        gap: 8px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .logo {
        max-width: 203px;
    }
    
    .header-info {
        width: 100%;
        gap: 0 !important;
    }
    
    .header-time {
        text-align: left;
        margin: 0;
    }
    
    .header-time .digi-clock {
        font-size: 18px;
    }
    
    .header-location {
        font-size: 9px;
        line-height: 1.2;
        margin: 0;
    }
    
    .header-astro {
        display: flex;
        flex-direction: column;
        gap: 0;
        margin-top: 0;
    }
    
    .header-sun {
        gap: 8px;
        font-size: 13px;
        line-height: 1.4;
        margin: 0;
    }
    
    .header-sun span {
        white-space: nowrap;
        display: inline;
    }
    
    .header-moon {
        display: flex;
        gap: 8px;
        font-size: 13px;
        line-height: 1.4;
        margin: 0;
    }
    
    .header-moon span {
        white-space: nowrap;
        display: inline;
    }
    
    .main-content {
        padding: 30px 10px;
    }
    
    .weather-widget {
        padding: 30px 20px;
        border-radius: 15px;
    }

    .forecast-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .forecast-controls {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .btn-compare {
        flex: 1;
        min-width: 0;
        font-size: 12px;
        padding: 8px 10px;
    }
    
    #providerSelect {
        flex: 1;
        min-width: 120px;
        font-size: 12px;
    }

    .forecast-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
    
    .temp-value {
        font-size: 72px;
    }
    
    .temp-unit {
        font-size: 28px;
    }
    
    .temp-minmax {
        flex-direction: column;
        gap: 20px;
    }
    
    .temp-minmax .label {
        font-size: 12px;
    }
    
    .temp-minmax .value {
        font-size: 24px;
    }
}

/* Graph Button */
.graph-btn {
    padding: 10px 16px;
    background-color: #78a5c9;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.graph-btn:hover {
    background-color: #2e5473;
}

/* Graph Container */
.graph-container {
    position: relative;
    width: 100%;
    height: 700px;
    min-height: 700px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.graph-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Compare Controls */
.compare-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.compare-controls label {
    font-weight: 500;
    color: #2e5473;
}

.compare-controls select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Rosario', sans-serif;
    cursor: pointer;
}

@media (max-width: 768px) {
    .graph-container {
        height: 500px;
        min-height: 500px;
    }
    
    .graph-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .compare-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .compare-controls select,
    .graph-btn {
        width: 100%;
    }
}
