/* ============================================================================
   Blink Camera Monitor - Main Stylesheet
   static/css/style.css
   ============================================================================ */

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

:root {
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
    --card-bg: white;
    --card-text: #333;
    --card-subtext: #666;
    --stat-bg: #f8f9fa;
    --stat-text: #333;
    --header-bg: rgba(255,255,255,0.95);
    --header-text: #333;
    --subtitle-text: #666;
    --timestamp-text: #888;
    --alert-critical: #e53e3e;
    --alert-warning: #ed8936;
    --alert-info: #4299e1;
    --armed-color: #48bb78;
    --disarmed-color: #f56565;
    --snooze-bg: #9f7aea;
}

[data-theme="dark"] {
    --bg-gradient-start: #1a1a2e;
    --bg-gradient-end: #16213e;
    --card-bg: #2d3748;
    --card-text: #e2e8f0;
    --card-subtext: #a0aec0;
    --stat-bg: #1a202c;
    --stat-text: #e2e8f0;
    --header-bg: rgba(45, 55, 72, 0.95);
    --header-text: #e2e8f0;
    --subtitle-text: #a0aec0;
    --timestamp-text: #cbd5e0;
}

html {
    height: 100%;
    width: 100%;
}

body {
    min-height: 100vh;
    width: 100vw;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    background-attachment: fixed;
    transition: background 0.3s ease;
}

.container {
    width: 100%;
    padding: clamp(8px, 2vw, 20px);
    box-sizing: border-box;
}

/* Snooze Modal */
.snooze-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.snooze-modal.show { display: flex; }

.snooze-modal-content {
    background: var(--card-bg);
    color: var(--card-text);
    border-radius: 15px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

.snooze-modal-title {
    font-size: 1.5em;
    font-weight: bold;
}

.snooze-modal-close {
    background: none;
    border: none;
    font-size: 1.8em;
    line-height: 1;
    cursor: pointer;
    color: var(--card-subtext);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    transition: all 0.2s;
    font-weight: bold;
}

.snooze-modal-close:hover {
    background: var(--stat-bg);
    color: var(--alert-critical);
    transform: scale(1.1);
}

.snooze-camera-name {
    font-size: 1.1em;
    margin-bottom: 20px;
    color: var(--card-subtext);
}

.snooze-status-display {
    background: var(--snooze-bg);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
}

.snooze-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.snooze-option {
    padding: 15px;
    background: var(--stat-bg);
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    font-weight: 500;
}

.snooze-option:hover {
    background: var(--snooze-bg);
    color: white;
    transform: translateY(-2px);
}

.snooze-option.selected {
    background: var(--snooze-bg);
    color: white;
    border-color: var(--snooze-bg);
}

.snooze-custom {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid var(--stat-bg);
}

.snooze-custom-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
}

.snooze-custom-input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--stat-bg);
    border-radius: 8px;
    font-size: 1em;
    background: var(--stat-bg);
    color: var(--card-text);
}

.snooze-custom-input:focus {
    outline: none;
    border-color: var(--snooze-bg);
}

.snooze-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.snooze-btn {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.snooze-btn-primary {
    background: var(--snooze-bg);
    color: white;
}

.snooze-btn-primary:hover {
    background: #805ad5;
    transform: translateY(-2px);
}

.snooze-btn-secondary {
    background: var(--stat-bg);
    color: var(--card-text);
}

.snooze-btn-secondary:hover {
    background: var(--card-subtext);
    color: white;
}

.snooze-btn-cancel {
    background: var(--alert-critical);
    color: white;
}

.snooze-btn-cancel:hover {
    background: #c53030;
    transform: translateY(-2px);
}

.snooze-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--snooze-bg);
    color: white;
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 0.8em;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 10;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.snooze-icon-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: 2px solid white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.2s;
    z-index: 10;
}

.snooze-icon-btn:hover {
    background: var(--snooze-bg);
    transform: scale(1.1);
}

.snooze-icon-btn.active {
    background: var(--snooze-bg) !important;
}

/* Alert Banner */
.alert-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: none;
    flex-direction: column;
}

.alert-banner.show { display: flex; }

.alert-item {
    padding: 15px 20px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    animation: slideDown 0.3s ease-out;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.alert-item.critical { background: var(--alert-critical); }
.alert-item.warning { background: var(--alert-warning); }
.alert-item.info { background: var(--alert-info); }

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

/* Header */
header {
    background: var(--header-bg);
    padding: clamp(12px, 2vw, 20px) clamp(15px, 3vw, 30px);
    border-radius: clamp(8px, 1.5vw, 15px);
    margin-bottom: clamp(15px, 3vw, 30px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: clamp(10px, 2vw, 20px);
    transition: background 0.3s ease;
}

.header-left {
    flex: 1;
    min-width: 200px;
}

h1 {
    color: var(--header-text);
    font-size: clamp(1.2em, 4vw, 2em);
    margin-bottom: clamp(2px, 0.5vw, 5px);
    transition: color 0.3s ease;
}

.subtitle {
    color: var(--subtitle-text);
    font-size: clamp(0.75em, 2vw, 1em);
    transition: color 0.3s ease;
}

.timestamp {
    color: var(--timestamp-text);
    font-size: clamp(0.7em, 1.8vw, 0.9em);
    margin-top: clamp(5px, 1vw, 10px);
    transition: color 0.3s ease;
}

.status-indicator {
    display: inline-block;
    width: clamp(8px, 1vw, 10px);
    height: clamp(8px, 1vw, 10px);
    border-radius: 50%;
    background: #4CAF50;
    animation: pulse 2s infinite;
    margin-right: 5px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: clamp(10px, 2vw, 15px);
    flex-wrap: wrap;
}

/* Toggles */
.arm-toggle, .snooze-all-toggle {
    position: relative;
    width: clamp(80px, 12vw, 100px);
    height: clamp(35px, 5vw, 40px);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 0 8px;
}

.arm-toggle { background: var(--disarmed-color); }
.arm-toggle.armed { background: var(--armed-color); }
.snooze-all-toggle { background: #718096; }
.snooze-all-toggle.snoozed { background: var(--snooze-bg); }

.arm-toggle.loading, .snooze-all-toggle.loading {
    opacity: 0.6;
    cursor: not-allowed;
    animation: pulse 1s infinite;
}

.arm-toggle-slider, .snooze-all-toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: clamp(29px, 4.2vw, 34px);
    height: clamp(29px, 4.2vw, 34px);
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(14px, 2.2vw, 18px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.arm-toggle.armed .arm-toggle-slider,
.snooze-all-toggle.snoozed .snooze-all-toggle-slider {
    transform: translateX(clamp(45px, 7vw, 60px));
}

.arm-toggle-label, .snooze-all-toggle-label {
    position: absolute;
    font-size: clamp(10px, 1.8vw, 12px);
    font-weight: bold;
    color: white;
    text-transform: uppercase;
    transition: opacity 0.3s ease;
}

/* ARM TOGGLE LABEL POSITIONS */
.arm-toggle-label.disarmed-label {
    right: 8px;
    opacity: 1;
}

.arm-toggle-label.armed-label {
    left: 8px;
    opacity: 0;
}

.arm-toggle.armed .arm-toggle-label.disarmed-label {
    opacity: 0;
}

.arm-toggle.armed .arm-toggle-label.armed-label {
    opacity: 1;
}

/* SNOOZE ALL TOGGLE LABEL POSITIONS */
.snooze-all-toggle-label.active-label {
    left: 6px;
    opacity: 0;
}

.snooze-all-toggle-label.snoozed-label {
    right: 6px;
    opacity: 1;
}

.snooze-all-toggle.snoozed .snooze-all-toggle-label.active-label {
    opacity: 1;
}

.snooze-all-toggle.snoozed .snooze-all-toggle-label.snoozed-label {
    opacity: 0;
}

.theme-toggle {
    position: relative;
    width: clamp(50px, 8vw, 60px);
    height: clamp(25px, 4vw, 30px);
    background: rgba(128, 128, 128, 0.3);
    border-radius: 30px;
    cursor: pointer;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.theme-toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: clamp(19px, 3.2vw, 24px);
    height: clamp(19px, 3.2vw, 24px);
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(10px, 2vw, 14px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

[data-theme="dark"] .theme-toggle-slider {
    transform: translateX(clamp(25px, 4vw, 30px));
}

/* Widgets */
.weather-widget, .radar-widget {
    border-radius: clamp(8px, 1.5vw, 12px);
    min-width: clamp(180px, 30vw, 250px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.weather-widget {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: white;
    padding: clamp(10px, 2vw, 15px) clamp(15px, 3vw, 25px);
}

.radar-widget {
    background: var(--card-bg);
    padding: 0;
    height: 200px;
    overflow: hidden;
}

.weather-main {
    display: flex;
    align-items: center;
    gap: clamp(8px, 2vw, 15px);
    margin-bottom: clamp(5px, 1vw, 10px);
}

.weather-icon { font-size: clamp(2em, 5vw, 3em); }
.weather-temp { font-size: clamp(1.5em, 4vw, 2.5em); font-weight: bold; }
.weather-details { font-size: clamp(0.75em, 1.8vw, 0.9em); opacity: 0.9; }
.weather-location { font-weight: bold; margin-bottom: 5px; }
.weather-condition { text-transform: capitalize; }

/* Cameras */
.camera-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: clamp(12px, 2.5vw, 25px);
    margin-bottom: clamp(15px, 3vw, 30px);
}

.camera-card {
    background: var(--card-bg);
    border-radius: clamp(8px, 1.5vw, 15px);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
    position: relative;
}

.camera-card:hover { transform: translateY(-5px); }
.camera-card.offline { opacity: 0.6; border: 3px solid var(--alert-critical); }
.camera-card.snoozed { opacity: 0.85; }

.camera-header {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: white;
    padding: clamp(10px, 2vw, 15px) clamp(12px, 2.5vw, 20px);
    font-size: clamp(1em, 2.5vw, 1.2em);
    font-weight: bold;
}

.camera-timestamp {
    font-size: clamp(0.7em, 1.8vw, 0.85em);
    color: #f0f0f0;
    margin-top: 4px;
    font-weight: normal;
}

.offline-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--alert-critical);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8em;
    font-weight: bold;
    animation: pulse 2s infinite;
}

.camera-image-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 75%;
    background: #000;
    overflow: hidden;
}

.camera-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
}

.camera-image.active { display: block; }

.image-nav {
    position: absolute;
    bottom: clamp(5px, 1.5vw, 10px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: clamp(4px, 1vw, 8px);
    background: rgba(0,0,0,0.6);
    padding: clamp(5px, 1vw, 8px) clamp(8px, 1.5vw, 12px);
    border-radius: 20px;
}

.nav-dot {
    width: clamp(8px, 1.5vw, 10px);
    height: clamp(8px, 1.5vw, 10px);
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.nav-dot.active {
    background: white;
    width: clamp(20px, 3vw, 25px);
    border-radius: 5px;
}

.camera-stats {
    padding: clamp(12px, 2.5vw, 20px);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(8px, 2vw, 15px);
}

.stat {
    text-align: center;
    padding: clamp(8px, 1.5vw, 10px);
    background: var(--stat-bg);
    border-radius: clamp(6px, 1vw, 8px);
    transition: background 0.3s ease;
}

.stat.alert { background: var(--alert-warning); color: white; }
.stat.critical { background: var(--alert-critical); color: white; }
.stat.alert .stat-label,
.stat.alert .stat-value,
.stat.critical .stat-label,
.stat.critical .stat-value { color: white; }
.stat.critical .stat-value, .stat.alert .stat-value { animation: pulse 2s infinite; }

.stat-label {
    font-size: clamp(0.65em, 1.5vw, 0.8em);
    color: var(--card-subtext);
    margin-bottom: clamp(3px, 0.8vw, 5px);
    transition: color 0.3s ease;
}

.stat-value {
    font-size: clamp(0.9em, 2.2vw, 1.3em);
    font-weight: bold;
    color: var(--stat-text);
    transition: color 0.3s ease;
}

.wifi-bars {
    display: inline-flex;
    gap: clamp(1px, 0.3vw, 2px);
    align-items: flex-end;
    height: clamp(15px, 3vw, 20px);
}

.wifi-bar {
    width: clamp(3px, 0.6vw, 4px);
    background: #ddd;
    border-radius: 2px;
}

.wifi-bar.active { background: #4CAF50; }
.wifi-bar:nth-child(1){height:20%;}
.wifi-bar:nth-child(2){height:40%;}
.wifi-bar:nth-child(3){height:60%;}
.wifi-bar:nth-child(4){height:80%;}
.wifi-bar:nth-child(5){height:100%;}

.no-cameras {
    text-align: center;
    padding: clamp(40px, 8vw, 60px) clamp(15px, 3vw, 20px);
    background: var(--header-bg);
    border-radius: clamp(10px, 2vw, 15px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: background 0.3s ease;
}

.no-cameras h2{
    color: var(--header-text);
    margin-bottom: clamp(10px, 2vw, 15px);
    font-size: clamp(1.2em, 3vw, 1.5em);
    transition: color 0.3s ease;
}

.no-cameras p{
    color: var(--subtitle-text);
    font-size: clamp(0.9em, 2vw, 1.1em);
    transition: color 0.3s ease;
}

footer {
    text-align: center;
    color: white;
    padding: clamp(15px, 3vw, 20px);
    font-size: clamp(0.75em, 1.8vw, 0.9em);
}

/* Responsive */
@media(max-width: 768px){
    header {
        flex-direction: column;
        align-items: stretch;
    }
    .header-left {
        text-align: center;
    }
    .header-right {
        justify-content: center;
        width: 100%;
    }
    .weather-widget, .radar-widget {
        width: 100%;
        min-width: auto;
    }
    .camera-grid {
        grid-template-columns: 1fr;
    }
    .camera-stats {
        grid-template-columns: 1fr;
    }
    .stat {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: clamp(10px, 2vw, 12px);
    }
    .stat-label {
        text-align: left;
        margin-bottom: 0;
    }
    .snooze-options {
        grid-template-columns: 1fr;
    }
}

@media(max-width: 480px){
    body {
        padding: 5px;
    }
    .camera-image-container {
        padding-bottom: 75%;
    }
}

@media(min-width: 1400px){
    .camera-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media(min-width: 1920px){
    .camera-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media(min-width: 768px) and (max-width: 1399px){
    .camera-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Stale Image Warning Badge */
.stale-badge {
    top: 50px;
    left: 10px;
    background: var(--alert-warning);
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.85em;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    z-index: 10;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    animation: pulse 2s infinite;
}

.camera-card.stale-images {
    border: 3px solid var(--alert-warning);
}

.camera-card.stale-images .camera-header {
    background: linear-gradient(135deg, var(--alert-warning) 0%, #dd6b20 100%);
}

.camera-card.stale-images .camera-image {
    opacity: 0.7;
    filter: grayscale(30%);
}

.camera-card.stale-images.snoozed .stale-badge {
    top: 80px;
}

/* Camera Alert Badges */
.camera-offline-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--alert-critical);
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.85em;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    z-index: 10;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    animation: pulse 2s infinite;
}

.camera-duplicate-badge {
    position: absolute;
    top: 55px;
    right: 10px;
    background: var(--alert-warning);
    color: white;
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 0.75em;
    font-weight: bold;
    z-index: 10;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.camera-card.snoozed .camera-offline-badge {
    top: 50px;
}

.camera-card.snoozed .camera-duplicate-badge {
    top: 95px;
}

.camera-card.has-offline-badge .stale-badge {
    top: 95px;
}

.camera-card.camera-offline {
    border: 3px solid var(--alert-critical);
    opacity: 0.85;
}

.camera-card.camera-offline .camera-header {
    background: linear-gradient(135deg, var(--alert-critical) 0%, #c53030 100%);
}

.camera-card.camera-offline .camera-image {
    opacity: 0.6;
    filter: grayscale(50%);
}


/* If camera is both stale AND snoozed */
.camera-card.stale-images.snoozed .stale-badge {
    top: 80px; /* Move below snooze badge */
}



/* ============================================================================
   NWS ALERT WIDGET STYLES - MATCHING WEATHER & RADAR SIZE
   
   INSTRUCTIONS: In static/css/style.css, find the existing NWS section
   (search for "NWS ALERT WIDGET") and REPLACE that entire section with this.
   
   The section starts around line 680-750 and begins with:
   /* ============================================================================
      NWS ALERT WIDGET STYLES
   
   Replace everything from that comment down to the end of the NWS styles
   (before the next major section) with the code below.
   ============================================================================ */

.nws-alert-widget {
    display: none;  /* Hidden by default */
    background: linear-gradient(135deg, var(--alert-critical) 0%, #c53030 100%);
    color: white;
    border-radius: clamp(8px, 1.5vw, 12px);
    min-width: clamp(180px, 30vw, 250px);
    max-width: 250px;  /* CRITICAL: Match weather/radar max width */
    height: 200px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    padding: clamp(10px, 2vw, 15px) clamp(15px, 3vw, 25px);
    overflow: hidden;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Fade in/out animations */
.nws-alert-widget.fade-in {
    animation: fadeIn 0.3s ease-in;
}

.nws-alert-widget.fade-out {
    animation: fadeOut 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

/* Alert content container */
.nws-alert-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    transition: opacity 0.3s ease-in-out;
}

.nws-alert-content.fade-in {
    opacity: 1;
}

.nws-alert-content.fade-out {
    opacity: 0;
}

/* Alert text styling */
.nws-alert-text {
    font-size: clamp(0.75em, 1.8vw, 0.9em);
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    color: white;
    text-align: left;
    width: 100%;
}

/* Severity badge at top */
.nws-alert-severity {
    font-size: clamp(0.65em, 1.5vw, 0.75em);
    font-weight: bold;
    margin-bottom: 6px;
    padding: 3px 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    display: inline-block;
}

/* "NWS Alert:" prefix - WHITE, BOLD, BLINKING */
.nws-alert-prefix {
    color: #ffffff;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
    animation: blink 2s infinite;
    font-size: 1em;
}

/* Alert description - normal text */
.nws-alert-description {
    color: #ffffff;
    font-weight: normal;
}

/* Blink animation */
@keyframes blink {
    0%, 49% {
        opacity: 1;  /* Visible */
    }
    50%, 100% {
        opacity: 0.3;  /* Dimmed */
    }
}

/* Respect user's motion preferences (accessibility) */
@media (prefers-reduced-motion: reduce) {
    .nws-alert-prefix {
        animation: none;
        /* Still white and bold, just not blinking */
    }

    .nws-alert-widget.fade-in,
    .nws-alert-widget.fade-out,
    .nws-alert-content.fade-in,
    .nws-alert-content.fade-out {
        animation: none;
        transition: none;
    }
}

/* Responsive adjustments - match weather widget behavior */
@media(max-width: 768px) {
    .nws-alert-widget {
        width: 100%;
        min-width: auto;
        height: auto;
        min-height: 150px;
        max-height: 200px;
    }

    .nws-alert-text {
        font-size: 0.85em;
    }

    .nws-alert-severity {
        font-size: 0.75em;
    }
}

/* Ensure widgets stay in a row on larger screens */
@media(min-width: 769px) {
    /* Make sure all widgets have consistent sizing */
    .weather-widget,
    .radar-widget,
    .nws-alert-widget {
        min-width: clamp(180px, 30vw, 250px);
        max-width: 250px;
        height: 200px;
    }
}