/* Cumulus MX Weather Template - Optimierte Styles */

:root {
    --primary-blue: #2563eb;
    --secondary-blue: #3b82f6;
    --light-blue: #eff6ff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --green: #10b981;
    --orange: #f59e0b;
    --red: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.6;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
}

.h1-style,
.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}

.status-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.status-display {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-200);
    font-size: 0.875rem;
    color: var(--gray-700);
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-led {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-online {
    background: var(--green);
}

.status-offline {
    background: var(--red);
}

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

.status-timer {
    background: var(--primary-blue);
    color: white;
    border-radius: 6px;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.location-info {
    color: var(--gray-600);
    font-size: 0.875rem;
    text-align: right;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Page Title */
.page-title {
    text-align: center;
    margin-bottom: 2rem;
}

.page-title h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.page-title p {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Navigation */
.navigation {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1rem;
    margin: 2rem 0;
    box-shadow: var(--shadow);
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.nav-link {
    color: var(--primary-blue);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: var(--light-blue);
    transform: translateY(-1px);
}

.nav-link.current {
    background: var(--primary-blue);
    color: white;
}

/* Grid Layouts */
.main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.weather-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

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

/* Cards */
.current-conditions,
.weather-card,
.gauge-card,
.sidebar-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.weather-card,
.gauge-card {
    padding: 1.5rem;
    border-radius: 12px;
}

.weather-card:hover,
.gauge-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.gauge-card {
    position: relative;
    overflow: hidden;
}

.gauge-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-blue), var(--secondary-blue));
}

/* Fire Index Full Width Card */
.weather-card.fire-index-full {
    grid-column: 1 / -1;
    max-width: none;
}

.fire-index-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.fire-index-main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.fire-index-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.fire-status-main {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-radius: 12px;
    border: 2px solid #f59e0b;
}

.fire-level-display {
    font-size: 3rem;
    font-weight: 800;
    color: #f59e0b;
    margin-bottom: 0.5rem;
}

.fire-description {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 1rem;
}

.fire-advice {
    font-size: 1rem;
    color: var(--gray-600);
    line-height: 1.5;
    max-width: 400px;
    margin: 0 auto;
}

/* Current Conditions */
.current-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.current-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.temp-display {
    text-align: center;
    margin: 2rem 0;
}

.temp-main {
    font-size: 4rem;
    font-weight: 300;
    color: var(--primary-blue);
    line-height: 1;
}

.temp-feels {
    color: var(--gray-600);
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* Card Headers */
.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.card-icon {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-blue);
    border-radius: 8px;
    font-size: 1.5rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.card-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.card-details {
    border-top: 1px solid var(--gray-200);
    padding-top: 1rem;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Fire Index Sources */
.fire-index-sources {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
    align-items: center;
}

.source-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.source-primary {
    background: #22c55e;
    color: white;
}

.source-secondary {
    background: #94a3b8;
    color: white;
}

.sources-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.source-comparison-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
}

.source-comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.source-success-rate {
    background: #22c55e;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.source-success-rate.warning {
    background: #f59e0b;
}

.source-success-rate.error {
    background: #ef4444;
}

/* History Enhanced */
.history-enhanced {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin: 0.5rem 0;
}

.history-day-enhanced {
    background: var(--day-color, #e5e7eb);
    color: white;
    padding: 0.5rem;
    border-radius: 8px;
    text-align: center;
    min-width: 50px;
    font-weight: 600;
    flex: 1;
    max-width: 60px;
}

.history-day-enhanced.today {
    box-shadow: 0 0 0 2px #3b82f6;
    border: 2px solid #3b82f6;
}

/* Gauge Specific */
.gauge-header {
    text-align: center;
    margin-bottom: 1rem;
}

.gauge-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.gauge-subtitle {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.gauge-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 250px;
    position: relative;
}

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

.gauge-large .gauge-container {
    min-height: 300px;
}

.gauge-medium .gauge-container {
    min-height: 250px;
}

.gauge-small .gauge-container {
    min-height: 200px;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Detail Rows */
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 500;
    color: var(--gray-600);
    flex: 1;
    min-width: 40%;
    margin-right: 1rem;
    flex-shrink: 0;
}

.detail-value {
    font-weight: 600;
    color: var(--gray-800);
    text-align: right;
    flex: 1;
    word-wrap: break-word;
    line-height: 1.4;
}

/* Special formatting for multi-line recommendations */
.detail-value[style*="line-height"] {
    text-align: left;
    padding-left: 0.5rem;
    border-left: 2px solid var(--gray-200);
    margin-left: 0.5rem;
}

/* Enhanced color coding for success rates */
.detail-value[style*="color: #22c55e"] {
    background: rgba(34, 197, 94, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.detail-value[style*="color: #f59e0b"] {
    background: rgba(245, 158, 11, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.detail-value[style*="color: #ef4444"] {
    background: rgba(239, 68, 68, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

/* Sun/Moon Info */
.sun-moon-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.time-entry {
    text-align: center;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: 8px;
}

.time-label {
    font-size: 0.75rem;
    color: var(--gray-600);
    text-transform: uppercase;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.time-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-800);
}

/* Status Bar */
.status-bar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    color: var(--gray-600);
    font-size: 0.875rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
    border-color: rgba(239, 68, 68, 0.2);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
}

.footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Tooltip Styles */
.ddimgtooltip {
    position: absolute;
    background: white;
    border: 2px solid var(--primary-blue);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    z-index: 500;
    font-size: 0.875rem;
    line-height: 1.4;
    display: none;
    pointer-events: none;
}

.tipimg {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.tipinfo {
    color: var(--gray-700);
}

.ddimgtooltip[style*="left: 0"],
.ddimgtooltip[style*="left: -"] {
    display: none !important;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--gray-300);
    border-radius: 50%;
    border-top-color: var(--primary-blue);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utility Classes */
.text-green { color: var(--green); }
.text-orange { color: var(--orange); }
.text-red { color: var(--red); }
.text-blue { color: var(--primary-blue); }

/* Layout Specific for Gauges Page */
.main-layout {
    display: grid;
    grid-template-columns: 2fr 300px;
    gap: 2rem;
    margin: 2rem 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-grid,
    .main-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .sidebar {
        order: 2;
    }
    
    .gauges-grid {
        order: 1;
    }
    
    .fire-index-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .sources-comparison {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .status-section {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .location-info {
        text-align: center;
    }
    
    .page-title h1 {
        font-size: 2rem;
    }
    
    .temp-main {
        font-size: 3rem;
    }
    
    .weather-grid,
    .gauges-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .sun-moon-info {
        grid-template-columns: 1fr;
    }
    
    .nav-links {
        flex-direction: column;
        align-items: center;
    }
    
    .current-conditions,
    .weather-card,
    .gauge-card {
        padding: 1rem;
    }
    
    .gauge-container {
        min-height: 200px;
    }
    
    .gauge-large .gauge-container {
        min-height: 220px;
    }
    
    .fire-status-main {
        padding: 1rem;
    }
    
    .fire-level-display {
        font-size: 2.5rem;
    }
    
    .fire-description {
        font-size: 1.1rem;
    }
    
    .history-enhanced {
        gap: 0.25rem;
    }
    
    .history-day-enhanced {
        padding: 0.4rem 0.2rem;
        font-size: 0.75rem;
        min-width: 40px;
    }
    
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.25rem 0;
    }
    
    .detail-label {
        min-width: auto;
        margin-right: 0;
        margin-bottom: 0.25rem;
    }
    
    .detail-value {
        text-align: left;
        margin-left: 1rem;
    }
    
    .detail-value[style*="line-height"] {
        margin-left: 1rem;
        padding-left: 0.5rem;
    }
}

@media (max-width: 480px) {
    .page-title h1 {
        font-size: 1.75rem;
    }
    
    .gauge-container {
        min-height: 180px;
    }
    
    .gauge-large .gauge-container {
        min-height: 200px;
    }
    
    .fire-level-display {
        font-size: 2rem;
    }
    
    .fire-description {
        font-size: 1rem;
    }
    
    .fire-advice {
        font-size: 0.875rem;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .fire-index-sources {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}