/* Weather Widget Styles */
:root {
    --widget-primary: #1a73e8;
    --widget-secondary: #5f6368;
    --widget-background: #ffffff;
    --widget-surface: #f8f9fa;
    --widget-border: #dadce0;
    --widget-text: #202124;
    --widget-text-light: #5f6368;
    --widget-alert: #ea4335;
    --widget-alert-bg: #fce8e6;
    --widget-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --widget-shadow-hover: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
}

/* Dark Mode */
.weather-widget.dark-mode {
    --widget-primary: #8ab4f8;
    --widget-secondary: #9aa0a6;
    --widget-background: #1f1f1f;
    --widget-surface: #2d2d2d;
    --widget-border: #3c4043;
    --widget-text: #e8eaed;
    --widget-text-light: #9aa0a6;
    --widget-alert: #f28b82;
    --widget-alert-bg: #3c2929;
    --widget-shadow: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.5);
    --widget-shadow-hover: 0 3px 6px rgba(0,0,0,0.5), 0 3px 6px rgba(0,0,0,0.6);
}

.weather-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--widget-background);
    border-radius: 12px;
    box-shadow: var(--widget-shadow);
    padding: 20px;
    color: var(--widget-text);
    max-width: 100%;
    box-sizing: border-box;
    transition: box-shadow 0.3s ease;
}

.weather-widget:hover {
    box-shadow: var(--widget-shadow-hover);
}

/* Logo/Branding */
.widget-branding {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--widget-border);
}

.widget-logo {
    max-width: 200px;
    height: auto;
    max-height: 50px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Alert Banner */
.widget-alert-banner {
    background: var(--widget-alert-bg);
    border: 1px solid var(--widget-alert);
    border-radius: 8px;
    padding: 10px 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s ease;
}

.widget-alert-banner:hover {
    background: #fdd;
}

.widget-alert-banner.hidden {
    display: none;
}

.alert-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--widget-alert);
}

.alert-icon {
    width: 24px;
    height: 24px;
    animation: pulse 2s infinite;
}

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

.alert-count {
    background: var(--widget-alert);
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: bold;
}

/* Alert Modal */
.alert-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.alert-modal.hidden {
    display: none;
}

.alert-modal-content {
    background: white;
    border-radius: 12px;
    padding: 20px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.alert-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--widget-border);
}

.alert-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--widget-text-light);
    padding: 5px;
    line-height: 1;
}

.alert-item {
    padding: 15px;
    margin-bottom: 10px;
    background: var(--widget-surface);
    border-left: 4px solid var(--widget-alert);
    border-radius: 4px;
}

.alert-item h4 {
    margin: 0 0 5px 0;
    color: var(--widget-alert);
}

.alert-item p {
    margin: 5px 0;
    font-size: 14px;
}

/* Current Weather */
.current-weather {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--widget-border);
}

.weather-icon-main {
    font-size: 80px;
    line-height: 1;
}

.current-temp {
    flex: 1;
}

.location-name {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: var(--widget-text);
    text-align: center;
}

.temperature {
    font-size: 48px;
    font-weight: 300;
    margin: 5px 0;
    color: var(--widget-text);
}

.condition {
    font-size: 16px;
    color: var(--widget-text-light);
    margin: 5px 0;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.detail-item {
    text-align: center;
    padding: 8px;
    background: var(--widget-surface);
    border-radius: 8px;
}

.detail-label {
    font-size: 12px;
    color: var(--widget-text-light);
    display: block;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--widget-text);
}

/* Forecast */
.forecast-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
}

.forecast-day {
    text-align: center;
    padding: 15px 10px;
    background: var(--widget-surface);
    border-radius: 8px;
    transition: transform 0.2s ease, background 0.2s ease;
}

.forecast-day:hover {
    transform: translateY(-2px);
    background: #e8f0fe;
}

.forecast-date {
    font-size: 14px;
    font-weight: 600;
    color: var(--widget-text);
    margin-bottom: 8px;
}

.forecast-icon {
    font-size: 40px;
    margin: 10px 0;
}

.forecast-temps {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.temp-high {
    font-weight: 600;
    color: var(--widget-text);
}

.temp-low {
    color: var(--widget-text-light);
}

.forecast-condition {
    font-size: 12px;
    color: var(--widget-text-light);
    margin-top: 5px;
}

/* App Links */
.widget-app-links {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--widget-border);
    text-align: center;
}

.app-links-header {
    font-size: 14px;
    font-weight: 600;
    color: var(--widget-text);
    margin-bottom: 12px;
}

.app-badges {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.app-badge {
    display: inline-block;
    transition: transform 0.2s ease, opacity 0.2s ease;
    text-decoration: none;
}

.app-badge:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.app-badge-svg {
    height: 40px;
    width: auto;
    display: block;
}

/* Dark mode adjustments for app badges */
.weather-widget.dark-mode .app-badge-svg path[fill="#000"] {
    fill: #2d2d2d;
}

/* Location Prompt */
.location-prompt {
    text-align: center;
    padding: 30px 20px;
}

.location-prompt h3 {
    margin: 0 0 8px 0;
    color: var(--widget-text);
    font-size: 22px;
    font-weight: 600;
}

.location-prompt p {
    margin: 0 0 20px 0;
    color: var(--widget-text-light);
    font-size: 14px;
}

.location-prompt-input {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.location-text-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--widget-border);
    border-radius: 8px;
    font-size: 16px;
    background: var(--widget-background);
    color: var(--widget-text);
    transition: border-color 0.3s ease;
}

.location-text-input:focus {
    outline: none;
    border-color: var(--widget-primary);
}

.location-text-input::placeholder {
    color: var(--widget-text-light);
}

.location-submit-btn {
    padding: 12px 24px;
    background: var(--widget-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.location-submit-btn:hover {
    opacity: 0.9;
}

.location-prompt-divider {
    position: relative;
    margin: 20px 0;
    text-align: center;
}

.location-prompt-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: var(--widget-border);
}

.location-prompt-divider span {
    position: relative;
    background: var(--widget-background);
    padding: 0 15px;
    color: var(--widget-text-light);
    font-size: 14px;
}

.location-geo-btn {
    width: 100%;
    padding: 12px 24px;
    background: var(--widget-surface);
    color: var(--widget-text);
    border: 2px solid var(--widget-border);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.location-geo-btn:hover {
    background: var(--widget-border);
    border-color: var(--widget-primary);
}

/* Loading State */
.widget-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--widget-text-light);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--widget-border);
    border-top-color: var(--widget-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

/* Error State */
.widget-error {
    text-align: center;
    padding: 20px;
    color: var(--widget-alert);
    background: var(--widget-alert-bg);
    border-radius: 8px;
}

/* Compact Mode */
.weather-widget.compact-mode {
    padding: 12px 16px;
}

.weather-widget.compact-mode .widget-branding {
    margin-bottom: 10px;
    padding-bottom: 10px;
}

.weather-widget.compact-mode .widget-logo {
    max-height: 30px;
    max-width: 150px;
}

.weather-widget.compact-mode .current-weather {
    margin-bottom: 12px;
    padding-bottom: 12px;
    gap: 15px;
}

.weather-widget.compact-mode .weather-icon-main {
    font-size: 50px;
}

.weather-widget.compact-mode .location-name {
    font-size: 14px;
}

.weather-widget.compact-mode .temperature {
    font-size: 32px;
}

.weather-widget.compact-mode .condition {
    font-size: 13px;
}

.weather-widget.compact-mode .forecast-day {
    padding: 10px 8px;
}

.weather-widget.compact-mode .forecast-icon {
    font-size: 30px;
}

.weather-widget.compact-mode .forecast-date {
    font-size: 12px;
}

/* Vertical Mode */
.weather-widget.vertical-mode {
    max-width: 300px;
}

.weather-widget.vertical-mode .current-weather {
    flex-direction: column;
    text-align: center;
}

.weather-widget.vertical-mode .forecast-container {
    grid-template-columns: 1fr;
}

/* Responsive Design */
@media (max-width: 768px) {
    .weather-widget {
        padding: 15px;
    }

    .current-weather {
        flex-direction: column;
        text-align: center;
    }

    .forecast-container {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 8px;
    }

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

@media (max-width: 480px) {
    .temperature {
        font-size: 36px;
    }

    .weather-icon-main {
        font-size: 60px;
    }

    .forecast-day {
        padding: 10px 5px;
    }
}

/* Demo Page Specific Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #f5f5f5;
}

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

.demo-header {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: var(--widget-shadow);
}

.demo-header h1 {
    margin: 0 0 10px 0;
    color: var(--widget-text);
}

.demo-header p {
    margin: 0;
    color: var(--widget-text-light);
}

.demo-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: var(--widget-shadow);
}

.demo-section h2 {
    margin: 0 0 20px 0;
    color: var(--widget-text);
    border-bottom: 2px solid var(--widget-primary);
    padding-bottom: 10px;
}

.demo-header-placement {
    background: #1a1a2e;
    padding: 20px;
    border-radius: 8px;
}

.demo-footer-placement {
    background: #2d2d44;
    padding: 20px;
    border-radius: 8px;
}

.demo-sidebar-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
}

.sidebar {
    background: var(--widget-surface);
    padding: 20px;
    border-radius: 8px;
}

.main-content {
    background: var(--widget-surface);
    padding: 20px;
    border-radius: 8px;
}

.location-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.location-selector input {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 1px solid var(--widget-border);
    border-radius: 8px;
    font-size: 14px;
}

.location-selector button {
    padding: 10px 20px;
    background: var(--widget-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.location-selector button:hover {
    background: #1557b0;
}

.embed-generator {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.embed-generator label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-weight: 600;
}

.embed-generator input,
.embed-generator select {
    padding: 10px 15px;
    border: 1px solid var(--widget-border);
    border-radius: 8px;
    font-size: 14px;
}

.embed-generator button {
    padding: 12px 24px;
    background: var(--widget-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s ease;
    align-self: flex-start;
}

.embed-generator button:hover {
    background: #1557b0;
}

.embed-code-output {
    display: none;
    flex-direction: column;
    gap: 10px;
}

.embed-code-output.visible {
    display: flex;
}

.embed-code-output pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.5;
}

#copy-embed {
    background: #28a745;
}

#copy-embed:hover {
    background: #218838;
}

.demo-footer {
    text-align: center;
    padding: 20px;
    color: var(--widget-text-light);
}

@media (max-width: 768px) {
    .demo-sidebar-layout {
        grid-template-columns: 1fr;
    }

    .location-selector {
        flex-direction: column;
    }

    .location-selector input {
        min-width: 100%;
    }
}
