* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: white;
    --text-color: #333;
    --text-secondary: #666;
    --border-color: #dee2e6;
    --header-text: white;
}

body.dark-mode {
    --bg-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --card-bg: #2c3e50;
    --text-color: #ecf0f1;
    --text-secondary: #bdc3c7;
    --border-color: #34495e;
    --header-text: #ecf0f1;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-color);
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: var(--header-text);
    margin-bottom: 30px;
}

header h1 {
    font-size: 2em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1em;
    opacity: 0.9;
}

.card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

body.dark-mode .card {
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.card h3 {
    margin-bottom: 15px;
    color: var(--text-color);
}

.status-box {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    text-align: center;
    transition: background 0.3s ease, color 0.3s ease;
}

.status-box.success {
    background: #d4edda;
    color: #155724;
}

body.dark-mode .status-box.success {
    background: #1e3a2e;
    color: #4ade80;
}

.status-box.error {
    background: #f8d7da;
    color: #721c24;
}

body.dark-mode .status-box.error {
    background: #3a1e1e;
    color: #f87171;
}

.status-box.info {
    background: #d1ecf1;
    color: #0c5460;
}

body.dark-mode .status-box.info {
    background: #1e3a4a;
    color: #60a5fa;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    margin-top: 10px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-warning:hover {
    background: #e0a800;
}

.help-text {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-top: 10px;
}

body.dark-mode .help-text {
    color: var(--text-secondary);
}

/* Toggle Switch Styles */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #667eea;
}

body.dark-mode .toggle-switch input:checked + .toggle-slider {
    background-color: #28a745;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 1px #667eea;
}

.permission-status {
    margin-top: 15px;
    padding: 15px;
    border-radius: 5px;
    background: #f8f9fa;
}

.permission-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #dee2e6;
}

.permission-item:last-child {
    border-bottom: none;
}

.permission-name {
    font-weight: 600;
}

.permission-badge {
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.permission-badge.granted {
    background: #d4edda;
    color: #155724;
}

.permission-badge.denied {
    background: #f8d7da;
    color: #721c24;
}

/* Alert View Styles */
.alert-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-view.hidden {
    display: none;
}

.alert-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.alert-flash {
    text-align: center;
    color: white;
    animation: flash 1s infinite;
    max-width: 500px;
    width: 100%;
}

@keyframes flash {
    0%, 100% {
        background: #dc3545;
        transform: scale(1);
    }
    50% {
        background: #ff4757;
        transform: scale(1.05);
    }
}

.alert-title {
    font-size: 3em;
    margin-bottom: 30px;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.alert-message {
    font-size: 1.5em;
    margin-bottom: 20px;
    line-height: 1.6;
    font-weight: 600;
}

.alert-time {
    font-size: 1.2em;
    margin-bottom: 30px;
    opacity: 0.9;
}

.btn-acknowledge {
    background: white;
    color: #dc3545;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.btn-acknowledge:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

.btn-ops-network {
    background: #28a745;
    color: white;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.btn-ops-network:hover {
    background: #218838;
    transform: scale(1.05);
    box-shadow: 0 6px 8px rgba(0,0,0,0.4);
}

.btn-ops-network:active {
    transform: scale(0.98);
}

/* Night Mask Overlay - Reduces brightness to 10% */
.night-mask-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* 90% opacity black = 10% brightness */
    z-index: 9999; /* Below alert view (10000) but above everything else */
    pointer-events: none; /* Allow clicks to pass through */
    transition: opacity 0.3s ease;
}

.night-mask-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

@media (max-width: 768px) {
    .alert-title {
        font-size: 2em;
    }
    
    .alert-message {
        font-size: 1.2em;
    }
}
