/* ABOUTME: Weather component styles extracted from JavaScript Web Components */
/* ABOUTME: CSS for weather widgets using CSS custom properties for theming */

/* Base styles for all weather widgets */
.weather-widget {
    display: block;
    color: var(--text-primary);
    font-family: system-ui, -apple-system, sans-serif;
}

.theme-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.error {
    color: var(--error-color);
}

.hidden {
    display: none !important;
}

.connection-status {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    z-index: 1000;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.connection-status.connected {
    background-color: var(--connection-bg-connected);
    color: white;
}

.connection-status.disconnected {
    background-color: var(--connection-bg-disconnected);
    color: white;
}

.connection-status.polling {
    background-color: var(--connection-bg-polling);
    color: white;
}

/* Weather Icon Component */
.weather-icon {
    display: inline-block;
    vertical-align: middle;
}

.weather-icon img {
    display: block;
    object-fit: contain;
}

/* Current Weather Widget */
.current-widget {
    margin-bottom: 1.5rem;
}

.temp-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.temperature {
    font-size: 2.5rem;
    font-weight: 100;
    line-height: 1;
}

.feels-like {
    font-size: 0.875rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.summary {
    font-size: 1.125rem;
    font-weight: 300;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.detail-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
}

.detail-label {
    opacity: 0.8;
}

.detail-value {
    font-weight: 500;
}

/* Hourly Forecast Widget */
.hourly-widget {
    margin-bottom: 1.5rem;
}

.chart-container {
    position: relative;
    height: 7rem;
    margin-bottom: 1rem;
}

.temperature-chart {
    width: 100%;
    height: 100%;
}

.chart-line {
    stroke: #ef4444;
    stroke-width: 2;
    fill: none;
}

.hourly-temps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    overflow-x: auto;
}

.hour-temp {
    text-align: center;
    flex-shrink: 0;
    min-width: 0;
}

.hour-temp-value {
    font-size: 0.75rem;
    opacity: 0.8;
}

.hour-icon {
    margin-top: 0.25rem;
}

.hourly-times {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    opacity: 0.6;
    overflow-x: auto;
}

.hour-time {
    flex-shrink: 0;
    min-width: 0;
}

/* Daily Forecast Widget */
.daily-widget {
    margin-bottom: 1.5rem;
}

.daily-chart-container {
    position: relative;
    height: 5rem;
    margin-bottom: 1rem;
}

.daily-chart {
    width: 100%;
    height: 100%;
}

.daily-forecast {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.day-forecast {
    text-align: center;
    padding: 0.25rem 0.5rem;
}

.day-name {
    font-size: 0.75rem;
    opacity: 0.6;
    overflow: hidden;
    text-overflow: ellipsis;
}

.day-icon {
    margin: 0.25rem 0;
}

.day-high {
    font-size: 0.75rem;
    font-weight: 500;
}

.day-low {
    font-size: 0.75rem;
    opacity: 0.6;
}

/* Hourly Timeline Widget */
.timeline-widget {
    margin-bottom: 1.5rem;
}

.timeline-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.timeline-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.timeline-dot {
    width: 0.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    flex-shrink: 0;
}

.timeline-dot.current {
    background-color: #fbbf24;
}

.timeline-dot.future {
    background-color: #9ca3af;
}

.timeline-content {
    flex: 1;
    margin-left: 0.75rem;
    min-width: 0;
}

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

.timeline-time {
    font-weight: 500;
    font-size: 0.875rem;
}

.timeline-temp {
    font-size: 0.875rem;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.timeline-desc {
    font-size: 0.75rem;
    opacity: 0.8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timeline-rain {
    font-size: 0.75rem;
    opacity: 0.6;
}

.loading-message {
    text-align: center;
    font-size: 0.875rem;
    opacity: 0.6;
}

/* Help Section Widget */
.help-widget {
    margin-bottom: 1.5rem;
}

/* Help section specific styles that remain in component due to Shadow DOM */
.param-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
}

.param-list li {
    margin: 0.5rem 0;
    padding: 0.25rem 0;
}

.help-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    color: inherit;
    font-size: 0.875rem;
    font-weight: 500;
}

.help-toggle:hover {
    background: var(--card-bg);
}

.help-icon {
    transition: transform 0.2s ease;
}

.help-expanded .help-icon {
    transform: rotate(180deg);
}

.help-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.help-expanded .help-content {
    max-height: 1000px;
}

.help-section {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
}

.help-section h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.help-section p {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    line-height: 1.5;
    opacity: 0.9;
}

.help-section p:last-child {
    margin-bottom: 0;
}

.help-section code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-family: monospace;
    font-size: 0.8125rem;
}

.help-section ul {
    margin: 0 0 0.75rem 1rem;
    padding: 0;
    list-style-type: disc;
}

.help-section li {
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 640px) {
    .sm\:hidden { display: none !important; }
    .text-xs { font-size: 0.75rem; }
    .text-sm { font-size: 0.875rem; }
    .text-base { font-size: 1rem; }
    .text-lg { font-size: 1.125rem; }
}

@media (min-width: 641px) {
    .sm\:block { display: block !important; }
    .sm\:inline { display: inline !important; }
    .sm\:text-sm { font-size: 0.875rem; }
    .sm\:text-base { font-size: 1rem; }
    .sm\:text-lg { font-size: 1.125rem; }
    .sm\:text-xl { font-size: 1.25rem; }

    .current-widget {
        margin-bottom: 2rem;
    }

    .temp-display {
        gap: 1rem;
    }

    .temperature {
        font-size: 3rem;
    }

    .feels-like {
        font-size: 1rem;
    }

    .summary {
        font-size: 1.25rem;
    }

    .detail-card {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .hourly-widget {
        margin-bottom: 2rem;
    }

    .chart-container {
        height: 9rem;
    }

    .hour-temp-value {
        font-size: 0.875rem;
    }

    .daily-widget {
        margin-bottom: 2rem;
    }

    .daily-chart-container {
        height: 7rem;
    }

    .daily-forecast {
        grid-template-columns: repeat(7, 1fr);
        gap: 0.5rem;
    }

    .day-forecast {
        padding: 0.5rem;
    }

    .day-high {
        font-size: 0.875rem;
    }

    .timeline-widget {
        margin-bottom: 2rem;
    }

    .timeline-container {
        gap: 0.75rem;
    }

    .timeline-dot {
        height: 2rem;
        margin-left: 0.25rem;
    }

    .timeline-content {
        margin-left: 1rem;
    }

    .timeline-time {
        font-size: 1rem;
    }

    .timeline-temp {
        font-size: 1rem;
    }

    .timeline-desc {
        font-size: 0.875rem;
    }
}

@media (min-width: 768px) {
    .hourly-temps {
        margin-bottom: 1rem;
    }

    .hour-temp-value {
        font-size: 1rem;
    }

    .hourly-times {
        font-size: 0.875rem;
    }

    .daily-item {
        padding: 1rem 1.25rem;
    }

    .daily-day {
        font-size: 1rem;
    }

    .daily-temps {
        font-size: 1rem;
    }

    .timeline-item {
        padding: 1rem 1.25rem;
    }

    .timeline-time {
        font-size: 1rem;
        min-width: 4rem;
    }

    .timeline-temp {
        font-size: 1rem;
        min-width: 3rem;
    }

    .timeline-desc {
        font-size: 0.875rem;
    }

    .timeline-rain {
        font-size: 0.875rem;
        min-width: 3rem;
    }

    .daily-chart-container {
        height: 9rem;
    }
}

@media (min-width: 1024px) {
    .temperature {
        font-size: 4rem;
    }

    .weather-details {
        grid-template-columns: repeat(4, 1fr);
    }

    .detail-card {
        flex-direction: column;
        text-align: center;
        gap: 0.25rem;
    }

    .chart-container {
        height: 11rem;
    }

    .daily-chart-container {
        height: 10rem;
    }
}

@media (min-width: 1280px) {
    .chart-container {
        height: 13rem;
    }
}

/* Dashboard theme - High contrast for eInk displays */
[data-theme="dashboard"] .weather-widget {
    border: 2px solid #000000;
    margin-bottom: 2.5rem;
}

[data-theme="dashboard"] .theme-card {
    background: #ffffff;
    border: 2px solid #000000;
    box-shadow: none;
}

[data-theme="dashboard"] .chart-line {
    stroke: #000000 !important;
    stroke-width: 6 !important;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Make graph lines more pronounced for all themes */
.chart-line {
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

[data-theme="dashboard"] .timeline-dot.current {
    background-color: #000000;
    border: 2px solid #000000;
    width: 0.75rem;
}

[data-theme="dashboard"] .timeline-dot.future {
    background-color: #ffffff;
    border: 2px solid #000000;
    width: 0.75rem;
}

[data-theme="dashboard"] .connection-status {
    display: none !important;
}

[data-theme="dashboard"] .help-toggle:hover {
    background-color: #f0f0f0;
}

[data-theme="dashboard"] .weather-icon img {
    filter: contrast(2) brightness(0.8);
    width: 20rem !important;
    height: 20rem !important;
    min-width: 20rem;
    min-height: 20rem;
}

/* Adjust layout for larger main icon */
[data-theme="dashboard"] .temp-display {
    gap: 2.5rem;
    margin-bottom: 2.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Make temperature bigger to match large icon */
[data-theme="dashboard"] .temperature {
    font-size: 6rem;
    font-weight: 900;
    line-height: 1;
}

[data-theme="dashboard"] .feels-like {
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
}

[data-theme="dashboard"] .summary {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
}

[data-theme="dashboard"] .detail-value {
    font-weight: 900;
    font-size: 1.25rem;
}

[data-theme="dashboard"] .detail-label {
    font-size: 1.125rem;
    font-weight: 800;
}

[data-theme="dashboard"] .detail-card {
    padding: 1rem 1.5rem;
    font-size: 1.125rem;
}

[data-theme="dashboard"] .weather-details {
    gap: 1.25rem;
    margin-top: 1.5rem;
}

[data-theme="dashboard"] .timeline-time {
    font-weight: 900;
    font-size: 1.25rem;
}

[data-theme="dashboard"] .timeline-temp {
    font-weight: 900;
    font-size: 1.25rem;
}

[data-theme="dashboard"] .timeline-desc {
    font-size: 1.125rem;
    font-weight: 800;
}

[data-theme="dashboard"] .day-high {
    font-weight: 900;
    font-size: 1.25rem;
}

[data-theme="dashboard"] .day-low {
    font-weight: 800;
    font-size: 1.125rem;
}

[data-theme="dashboard"] .day-name {
    font-size: 1.125rem;
    font-weight: 800;
}

[data-theme="dashboard"] .hour-temp-value {
    font-weight: 900;
    font-size: 1.25rem;
}

/* Bigger icons for hourly forecast in dashboard theme */
[data-theme="dashboard"] .hour-icon img {
    width: 6rem !important;
    height: 6rem !important;
    min-width: 6rem;
    min-height: 6rem;
}

/* Bigger icons for daily forecast in dashboard theme */
[data-theme="dashboard"] .day-icon img {
    width: 6rem !important;
    height: 6rem !important;
    min-width: 6rem;
    min-height: 6rem;
}

/* Adjust spacing for bigger hourly icons */
[data-theme="dashboard"] .hour-icon {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Fix hourly forecast layout for bigger icons */
[data-theme="dashboard"] .hourly-temps {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    justify-content: space-between;
}

[data-theme="dashboard"] .hour-temp {
    min-width: 4rem;
    flex-shrink: 0;
}

[data-theme="dashboard"] .hourly-times {
    display: flex;
    overflow-x: auto;
    padding-top: 0.5rem;
    gap: 0.5rem;
    justify-content: space-between;
}

[data-theme="dashboard"] .hour-time {
    min-width: 4rem;
    flex-shrink: 0;
    text-align: center;
    font-size: 1.125rem;
    font-weight: 800;
}

/* Adjust spacing for bigger daily icons */
[data-theme="dashboard"] .day-icon {
    margin: 0.5rem 0;
}

/* Smaller buttons for dashboard theme */
[data-theme="dashboard"] .help-toggle {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 800;
}

/* General button size improvements */
.help-toggle {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

/* Footer styles */
.app-footer {
    margin-top: 2rem;
    padding: 1rem 0;
    border-top: 1px solid #e0e0e0;
    color: #666;
    font-size: 0.75rem;
}

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

.footer-left .git-hash {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background-color: #f5f5f5;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    font-size: 0.6875rem;
}

.footer-right .copyright a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-right .copyright a:hover {
    color: #333;
    text-decoration: underline;
}

/* Dashboard theme footer styles */
[data-theme="dashboard"] .app-footer {
    border-top: 2px solid #000;
    color: #000;
    font-weight: 600;
}

[data-theme="dashboard"] .footer-left .git-hash {
    background-color: #000;
    color: #fff;
    font-weight: 800;
}

[data-theme="dashboard"] .footer-right .copyright a {
    color: #000;
    font-weight: 800;
}

[data-theme="dashboard"] .footer-right .copyright a:hover {
    color: #333;
}

/* White theme footer styles */
[data-theme="white"] .app-footer {
    border-top: 1px solid #ddd;
    color: #777;
}

[data-theme="white"] .footer-left .git-hash {
    background-color: #f8f8f8;
    color: #555;
}

[data-theme="white"] .footer-right .copyright a {
    color: #777;
}

[data-theme="white"] .footer-right .copyright a:hover {
    color: #555;
}

/* PWA Install Button */
.pwa-install-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #3b82f6;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.pwa-install-button:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.pwa-install-button:active {
    transform: translateY(0);
}

.pwa-install-button:focus {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}
