* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-dark: #0a0a0a;
    --secondary-dark: #1a0a00;
    --tertiary-dark: #2c0a00;
    --accent-orange: #ffa500;
    --accent-light: #ffcc99;
    --accent-warm: #ff9933;
    --hero-bg: url('imágenes/PIA09579~medium.jpg');
}

html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0a;
    color: #e0e0e0;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

/* MAIN LAYOUT */
.monitoring-system {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
}

main.main-content {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    padding-top: 70px;
    overflow: visible;
}

/* TOP NAVBAR */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(90deg, rgba(10, 10, 10, 0.95) 0%, rgba(26, 10, 0, 0.95) 100%);
    border-bottom: 1px solid rgba(255, 165, 0, 0.3);
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
    z-index: 100;
    height: 70px;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.navbar-title {
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.navbar-center {
    display: flex;
    gap: 40px;
    flex: 1;
    justify-content: center;
}

.navbar-center a {
    color: #b0b0b0;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
}

.navbar-center a:hover {
    color: var(--accent-orange);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

.search-btn {
    background: transparent;
    border: 1px solid rgba(255, 165, 0, 0.3);
    color: var(--accent-orange);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    border-color: var(--accent-orange);
    box-shadow: 0 0 12px rgba(255, 165, 0, 0.3);
}

.language {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    text-transform: uppercase;
}

/* HERO SECTION */
.hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.6), rgba(10,5,0,0.7)), var(--hero-bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    border-bottom: 2px solid rgba(255, 165, 0, 0.2);
    flex-shrink: 0;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 60% 40%, rgba(255,165,0,0.05), transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: left;
    max-width: 700px;
    margin-left: -100px;
}

.hero-title {
    font-size: 5.5rem;
    font-weight: 900;
    color: #ffffff;
    margin: 0 0 8px 0;
    line-height: 1;
    letter-spacing: -1px;
    text-shadow: 0 6px 30px rgba(0, 0, 0, 0.9);
}

.hero-title .highlight {
    color: var(--accent-orange);
    display: block;
    text-shadow: 0 0 25px rgba(255, 165, 0, 0.6);
}

.hero-description {
    font-size: 0.95rem;
    color: #d0d0d0;
    margin: 20px 0 30px 0;
    line-height: 1.6;
    max-width: 500px;
}

.btn-hero {
    background: transparent;
    color: #ffffff;
    padding: 12px 28px;
    border: 1px solid rgba(255, 165, 0, 0.5);
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-hero:hover {
    background: rgba(255, 165, 0, 0.15);
    border-color: var(--accent-orange);
    box-shadow: 0 0 15px rgba(255, 165, 0, 0.4);
}

/* CARDS CONTAINER (para mostrar debajo del hero) */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    padding: 50px 60px;
    background: linear-gradient(to bottom, rgba(10,10,10,0.9), #0a0a0a);
}

.card-large {
    background: rgba(26, 10, 0, 0.6);
    border: 1px solid rgba(255, 165, 0, 0.2);
    border-radius: 8px;
    padding: 25px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.card-large::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-orange), transparent);
}

.card-large:hover {
    border-color: rgba(255, 165, 0, 0.5);
    box-shadow: 0 8px 25px rgba(255, 165, 0, 0.1);
    transform: translateY(-5px);
}

.card-header {
    padding: 0 0 15px 0;
    color: var(--accent-orange);
    font-weight: 600;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 165, 0, 0.2);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-content {
    padding: 0;
}

.card-content p {
    color: #b0b0b0;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* MONITORING SECTION */
.monitoring-section {
    position: relative;
    width: 100%;
    height: 100vh;
    padding: 40px;
    background: linear-gradient(to bottom, rgba(10,10,10,0.95), #0a0a0a);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}

.monitoring-header {
    margin-bottom: 30px;
}

.monitoring-header h2 {
    color: var(--accent-warm);
    font-size: 1.8rem;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 102, 0, 0.3);
}

.status-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.tag {
    background: rgba(255, 102, 0, 0.15);
    border: 1px solid rgba(255, 102, 0, 0.3);
    color: var(--accent-light);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* MAIN CONTENT GRID (for monitoring) */
.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

@media (min-width: 1200px) {
    .main-content {
        grid-template-columns: 2fr 1fr;
        gap: 30px;
    }
}

/* STATUS PANEL */
.status-panel {
    background: rgba(8, 4, 0, 0.85);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 102, 0, 0.1);
    border: 2px solid rgba(255, 102, 0, 0.25);
    position: relative;
    overflow: hidden;
}

.status-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255, 102, 0, 0.1), transparent 70%);
    pointer-events: none;
}

.status-panel h2 {
    color: var(--accent-warm);
    margin-bottom: 20px;
    font-size: 1.5rem;
    text-shadow: 0 0 5px rgba(255, 102, 0, 0.3);
    border-bottom: 2px solid rgba(255, 102, 0, 0.3);
    padding-bottom: 10px;
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.status-light {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.5s ease;
    border: 3px solid rgba(255, 255, 255, 0.1);
    position: relative;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.status-green {
    background: radial-gradient(circle at 30% 30%, #4CAF50, #2E7D32);
    box-shadow: 0 0 30px #4CAF50;
    color: white;
}

.status-yellow {
    background: radial-gradient(circle at 30% 30%, #FFC107, #FF8F00);
    box-shadow: 0 0 30px #FFC107;
    color: #333;
}

.status-red {
    background: radial-gradient(circle at 30% 30%, #F44336, #C62828);
    box-shadow: 0 0 30px #F44336;
    color: white;
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0%, 100% { transform: scale(1); box-shadow: 0 0 30px #F44336; }
    50% { transform: scale(1.05); box-shadow: 0 0 40px #F44336; }
}

.status-message {
    text-align: center;
    font-size: 1.3rem;
    margin-bottom: 15px;
    font-weight: bold;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.3;
    padding: 12px;
    background: rgba(8, 4, 0, 0.8);
    border-radius: 8px;
    border-left: 4px solid var(--accent-orange);
    box-shadow: inset 0 1px 0 rgba(255, 102, 0, 0.1);
}

.proximity-timer {
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 102, 0, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 102, 0, 0.3);
}

.timer-label {
    font-size: 0.8rem;
    opacity: 0.7;
    text-align: center;
}

.timer-display {
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    margin: 5px 0;
}

.status-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
}

.status-message-item {
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    font-size: 0.9rem;
    border: 2px solid;
    background: rgba(0, 0, 0, 0.5);
}

.status-green-msg {
    border-color: #4CAF50;
    color: #4CAF50;
}

.status-yellow-msg {
    border-color: #FFC107;
    color: #FFC107;
}

.status-red-msg {
    border-color: #F44336;
    color: #F44336;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* SENSORS GRID */
.sensors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.sensor-card {
    background: rgba(8, 4, 0, 0.8);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 102, 0, 0.08);
}

.sensor-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-orange), var(--accent-warm));
}

.sensor-card.critical {
    border-color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
    animation: alert-pulse 2s infinite;
}

.sensor-card.warning {
    border-color: #ffaa00;
    background: rgba(255, 170, 0, 0.1);
}

.sensor-card.normal {
    border-color: #00C851;
    background: rgba(0, 200, 81, 0.05);
}

@keyframes alert-pulse {
    0% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0); }
}

.sensor-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.sensor-value {
    font-size: 1.3rem;
    font-weight: bold;
    margin: 10px 0;
    color: var(--accent-light);
}

.sensor-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 5px;
    color: var(--accent-warm);
}

.sensor-status {
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 12px;
    display: inline-block;
    margin-top: 5px;
}

.status-critical {
    background: linear-gradient(135deg, #ff4444, #cc0000);
    color: white;
}

.status-warning {
    background: linear-gradient(135deg, #ffaa00, #ff8800);
    color: black;
}

.status-normal {
    background: linear-gradient(135deg, #00C851, #007E33);
    color: white;
}

/* THREAT INDICATORS */
.threat-indicators {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.threat-indicator {
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    background: rgba(8, 4, 0, 0.8);
    border: 2px solid rgba(255, 102, 0, 0.2);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 102, 0, 0.08);
}

.threat-high {
    background: linear-gradient(135deg, rgba(255, 68, 68, 0.3), rgba(204, 0, 0, 0.3));
    border-color: #ff4444;
}

.threat-medium {
    background: linear-gradient(135deg, rgba(255, 170, 0, 0.3), rgba(255, 136, 0, 0.3));
    border-color: #ffaa00;
}

.threat-low {
    background: linear-gradient(135deg, rgba(0, 200, 81, 0.2), rgba(0, 126, 51, 0.2));
    border-color: #00C851;
}

/* CONTROLS */
.controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

@media (min-width: 480px) {
    .controls {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
}

button {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.5px;
}

.btn-success {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-success:hover {
    background: linear-gradient(135deg, #45a049, #1B5E20);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(76, 175, 80, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #F44336, #C62828);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #E53935, #B71C1C);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(244, 67, 54, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #FF9800, #EF6C00);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #e68900, #E65100);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 152, 0, 0.3);
}

/* CAMERA FEED STYLES */
.camera-feed-panel {
    background: rgba(8, 4, 0, 0.85);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 102, 0, 0.1);
    border: 2px solid rgba(255, 102, 0, 0.25);
    position: relative;
    overflow: hidden;
}

.camera-container {
    position: relative;
    width: 100%;
    height: 300px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    margin-bottom: 15px;
}

#cameraFeed {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.camera-icon {
    font-size: 4rem;
    color: var(--accent-orange);
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.camera-status {
    color: var(--accent-light);
    font-size: 1.1rem;
    text-align: center;
    padding: 0 20px;
}

.camera-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.camera-btn {
    flex: 1;
    min-width: 120px;
}

.camera-data {
    background: rgba(20, 10, 0, 0.8);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    border: 1px solid rgba(255, 102, 0, 0.2);
}

.camera-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.camera-metric {
    padding: 8px;
    background: rgba(255, 102, 0, 0.1);
    border-radius: 6px;
    font-size: 0.9rem;
}

.metric-value {
    font-weight: bold;
    color: var(--accent-warm);
    margin-top: 3px;
}

.environment-info {
    background: rgba(20, 10, 0, 0.8);
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
    text-align: center;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 102, 0, 0.2);
}

.environment-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.sound-logic {
    background: rgba(20, 10, 0, 0.8);
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.4;
    border: 1px solid rgba(255, 102, 0, 0.2);
}

.sound-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.sound-btn {
    padding: 8px 12px;
    background: rgba(255, 102, 0, 0.2);
    border: 1px solid rgba(255, 102, 0, 0.4);
    border-radius: 5px;
    color: var(--accent-light);
    cursor: pointer;
    font-size: 0.8rem;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.3s ease;
}

.sound-btn:hover {
    background: rgba(255, 102, 0, 0.4);
    transform: translateY(-2px);
}

/* MAP STYLES */
.map-container {
    height: 300px;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    position: relative;
    background: #2c0a00;
    border: 1px solid rgba(255, 102, 0, 0.3);
    margin-top: 20px;
}

#map {
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.leaflet-container {
    background: #2c0a00 !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.selection-info {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.9);
    color: var(--accent-light);
    padding: 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    z-index: 1000;
    max-width: calc(100% - 100px);
    line-height: 1.3;
    border: 1px solid rgba(255, 102, 0, 0.3);
}

/* ALERT CONTAINER */
.alert-container {
    position: fixed;
    top: 70px;
    right: 10px;
    left: 10px;
    z-index: 3000;
    max-width: 600px;
    margin: 0 auto;
}

@media (min-width: 768px) {

/* Simulación visual de Marte (solo estética) */
.mars-sim {
    position: relative;
    width: 100%;
    height: 800px;
    margin: 20px 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255,165,0,0.12);
    box-shadow: 0 8px 30px rgba(0,0,0,0.6), inset 0 2px 20px rgba(255,165,0,0.03);
    background: radial-gradient(circle at 30% 20%, rgba(255,200,150,0.03), transparent 10%),
                linear-gradient(180deg, rgba(18,6,4,0.85), rgba(10,4,3,0.9));
}
.mars-surface {
    position: absolute;
    inset: 0;
    background-image: url('imágenes/PIA08653~medium.jpg');
    background-size: cover;
    background-position: center bottom;
    filter: saturate(0.9) contrast(1.05) brightness(0.7);
    transform: scale(1.08);
    opacity: 0.95;
}
.mars-dust {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,200,120,0.02) 0.5px, transparent 0.6px);
    background-size: 6px 6px;
    pointer-events: none;
    opacity: 0.85;
    animation: drift 18s linear infinite;
    mix-blend-mode: screen;
}

@keyframes drift {
    0% { transform: translate3d(-5%, -2%, 0) scale(1); }
    50% { transform: translate3d(8%, 2%, 0) scale(1.02); }
    100% { transform: translate3d(-5%, -2%, 0) scale(1); }
}

/* small particle layer to simulate flying debris */
.mars-sim::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.03) 0.5px, transparent 0.6px);
    background-size: 30px 30px;
    opacity: 0.7;
    transform: translateZ(0);
    animation: floaters 26s linear infinite;
    pointer-events: none;
}

@keyframes floaters {
    0% { transform: translate3d(0,0,0); opacity: 0.6; }
    50% { transform: translate3d(30px,-20px,0); opacity: 0.9; }
    100% { transform: translate3d(0,0,0); opacity: 0.6; }
}

/* iframe panorama 360 dentro de mars-sim */
.mars-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    z-index: 5;
    background: transparent;
}

.mars-link {
    position: absolute;
    left: 18px;
    bottom: 12px;
    z-index: 60;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255,165,0,0.18);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    backdrop-filter: blur(6px);
}

.mars-link:hover {
    background: rgba(255,165,0,0.12);
    color: #fff;
    box-shadow: 0 6px 18px rgba(255,165,0,0.12);
}

/* Si el iframe no carga (X-Frame-Options), el enlace queda visible y funcional */
.mars-iframe[style*="display:none"] + .mars-surface + .mars-dust + .mars-link { display: block; }
    .alert-container {
        right: 20px;
        left: auto;
    }
}

.alert {
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.5s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    border-left: 5px solid;
}

.alert-green {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.9), rgba(46, 125, 50, 0.9));
    border-left-color: #2E7D32;
    color: white;
}

.alert-yellow {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.9), rgba(255, 143, 0, 0.9));
    border-left-color: #FF8F00;
    color: #333;
}

.alert-red {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.9), rgba(198, 40, 40, 0.9));
    border-left-color: #C62828;
    color: white;
    animation: pulse-alert 1s infinite, slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse-alert {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* HISTORY PANEL */
.history-panel {
    background: rgba(8, 4, 0, 0.85);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    border: 2px solid rgba(255, 102, 0, 0.25);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 102, 0, 0.1);
}

.history-list {
    max-height: 250px;
    overflow-y: auto;
    margin-top: 15px;
    padding-right: 10px;
}

.history-item {
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(20, 10, 0, 0.8);
    border-radius: 6px;
    border-left: 4px solid;
    font-size: 0.9rem;
}

.history-green { border-left-color: #4CAF50; }
.history-yellow { border-left-color: #FFC107; }
.history-red {
    border-left-color: #F44336;
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0%, 100% { border-left-width: 4px; }
    50% { border-left-width: 8px; }
}

.history-time {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 4px;
    color: var(--accent-light);
}

/* FOOTER */
footer {
    position: relative;
    width: 100%;
    padding: 30px 40px;
    background: linear-gradient(to bottom, rgba(10,10,10,0.95), #0a0a0a);
    border-top: 2px solid rgba(255, 165, 0, 0.3);
    text-align: center;
    font-size: 0.9rem;
    color: var(--accent-light);
    flex-shrink: 0;
}

/* SYSTEMS LIST */
.systems-list {
    margin-top: 20px;
}

.system-item {
    background: rgba(20, 10, 0, 0.8);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid var(--accent-orange);
}

.system-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.system-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--accent-warm);
}

.system-status {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.system-green {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    color: white;
}

.system-yellow {
    background: linear-gradient(135deg, #FFC107, #FF8F00);
    color: #333;
}

.system-red {
    background: linear-gradient(135deg, #F44336, #C62828);
    color: white;
}

.system-data {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 10px;
    color: var(--accent-light);
}

.last-saved {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 8px;
    text-align: right;
    color: var(--accent-warm);
}

.distance-info {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 5px;
    padding: 8px;
    background: rgba(255, 102, 0, 0.1);
    border-radius: 5px;
    border: 1px solid rgba(255, 102, 0, 0.2);
}

.hidden {
    display: none !important;
}

.notification-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
        padding: 15px 0;
    }

    .monitoring-system {
        margin-left: 70px;
    }

    .top-navbar {
        flex-direction: column;
        gap: 15px;
        padding: 12px 15px;
    }

    .navbar-center {
        display: none;
    }

    .hero-section {
        padding: 40px 20px;
        height: auto;
        min-height: 250px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .cards-container {
        padding: 30px 20px;
        grid-template-columns: 1fr;
    }

    .monitoring-section {
        padding: 30px 20px;
    }

    .main-content {
        grid-template-columns: 1fr;
    }
}
