/* Base & Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-dark: #121214;
    --text-main: #FFFFFF;
    --text-muted: #A1A1AA;
    --primary: #FF3B30;
    --primary-hover: #D73027;
    --success: #34C759;
    --success-hover: #2DA94F;
    --surface: rgba(30, 30, 32, 0.6);
    --surface-border: rgba(255, 255, 255, 0.08);
    --warning-yellow: #FFD60A;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    line-height: 1.5;
}

/* Background effects */
.warning-stripes-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 10px;
    background: repeating-linear-gradient(45deg,
            #FFD60A,
            #FFD60A 20px,
            #FF3B30 20px,
            #FF3B30 40px);
    z-index: 100;
}

.glass-bg {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(255, 59, 48, 0.05) 0%, rgba(18, 18, 20, 1) 45%);
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
}

.badge {
    display: inline-block;
    background: rgba(255, 214, 10, 0.1);
    color: var(--warning-yellow);
    padding: 0.4rem 1rem;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 214, 10, 0.2);
}

header h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    background: linear-gradient(180deg, #FFFFFF 0%, #A1A1AA 100%);
    -webkit-background-clip: text;
  background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.glass-panel {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.stats-panel {
    width: 100%;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.stats-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.status-indicator {
    font-size: 0.85rem;
    color: var(--warning-yellow);
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background-color: var(--warning-yellow);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 214, 10, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(255, 214, 10, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 214, 10, 0);
    }
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.chart-note {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: right;
}

/* Scenarios */
.leak-scenarios {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.scenario-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 3px solid transparent;
}

.scenario-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.scenario-card.error-themed:hover {
    border-top-color: var(--primary);
}

.card-header {
    margin-bottom: 1rem;
}

.scenario-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.scenario-title h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.tooltip-wrapper {
    position: relative;
    display: inline-flex;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: help;
    transition: all 0.2s ease;
}

.info-icon:hover {
    background: var(--text-main);
    color: var(--bg-dark);
}

.tooltip-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 260px;
    background: #25252A;
    color: #FFF;
    text-align: left;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 50;
    pointer-events: none;
}

.tooltip-wrapper:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.scenario-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    flex-grow: 1;
}

/* Buttons */
.card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    border: none;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.btn-danger {
    background-color: rgba(255, 59, 48, 0.15);
    color: #FF6B64;
    border: 1px solid rgba(255, 59, 48, 0.3);
}

.btn-danger:hover:not(:disabled) {
    background-color: var(--primary);
    color: #FFF;
    border-color: var(--primary);
}

.btn-danger:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-success {
    background-color: rgba(52, 199, 89, 0.15);
    color: #5ED47D;
    border: 1px solid rgba(52, 199, 89, 0.3);
}

.btn-success:hover:not(:disabled) {
    background-color: var(--success);
    color: #FFF;
    border-color: var(--success);
}

.btn-success:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-outline {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--surface-border);
    max-width: 250px;
    margin: 0 auto;
    display: block;
}

.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

footer {
    margin-top: 4rem;
    padding-top: 2rem;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
}