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

body {
    min-height: 100vh;
    background: #030308;
    font-family: 'JetBrains Mono', monospace;
    overflow-x: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-void {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: radial-gradient(ellipse at 30% 20%, rgba(15, 20, 60, 0.8) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 80%, rgba(20, 10, 50, 0.6) 0%, transparent 60%),
                radial-gradient(ellipse at 50% 50%, rgba(5, 5, 20, 1) 0%, #030308 100%);
}

.bg-particles {
    position: fixed;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(100, 140, 255, 0.4);
    border-radius: 50%;
    animation: floatParticle linear infinite;
}

@keyframes floatParticle {
    0% { transform: translateY(100vh) translateX(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-10vh) translateX(40px); opacity: 0; }
}

.scanlines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
}

.noise-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 11;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
}

.portal-panel {
    position: relative;
    z-index: 5;
    background: rgba(10, 10, 30, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 16px;
    border: 1px solid rgba(80, 100, 220, 0.2);
    box-shadow:
        0 0 40px rgba(60, 80, 200, 0.08),
        0 0 80px rgba(60, 80, 200, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    opacity: 0.25;
    transition: opacity 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
    max-width: 940px;
    width: 95vw;
}

.portal-panel:hover,
.portal-panel.active {
    opacity: 0.97;
    border-color: rgba(80, 100, 220, 0.35);
    box-shadow:
        0 0 60px rgba(60, 80, 200, 0.12),
        0 0 120px rgba(60, 80, 200, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.glow-border {
    position: absolute;
    inset: -1px;
    border-radius: 17px;
    background: linear-gradient(135deg, rgba(100, 120, 255, 0.15), rgba(180, 100, 255, 0.1), rgba(100, 120, 255, 0.15));
    z-index: -1;
    filter: blur(1px);
}

.divider-glow {
    width: 1px;
    background: linear-gradient(180deg, transparent 5%, rgba(100, 130, 255, 0.3) 30%, rgba(150, 100, 255, 0.2) 70%, transparent 95%);
    flex-shrink: 0;
}

.title-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 4px;
}

.title-ornament .line {
    width: 40px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(100, 130, 255, 0.4), transparent);
}

.title-ornament .diamond {
    width: 6px;
    height: 6px;
    background: rgba(100, 130, 255, 0.5);
    transform: rotate(45deg);
}

/* Toggle Switch */
.toggle-track {
    width: 52px;
    height: 28px;
    border-radius: 14px;
    background: rgba(40, 40, 60, 0.8);
    border: 1px solid rgba(80, 80, 120, 0.3);
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.toggle-track.on {
    background: rgba(30, 80, 220, 0.6);
    border-color: rgba(60, 120, 255, 0.5);
    box-shadow: 0 0 12px rgba(60, 120, 255, 0.3);
}

.toggle-knob {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(200, 210, 255, 0.9);
    position: absolute;
    top: 2px;
    left: 2px;
    transition: all 0.3s cubic-bezier(0.68, -0.3, 0.32, 1.3);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.toggle-track.on .toggle-knob {
    left: 26px;
    background: #fff;
    box-shadow: 0 0 8px rgba(100, 150, 255, 0.5);
}

/* Filter Key Button */
.filter-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(80, 80, 120, 0.4);
    background: rgba(30, 30, 50, 0.6);
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-btn.on {
    border-color: rgba(60, 200, 120, 0.6);
    box-shadow: 0 0 12px rgba(60, 200, 120, 0.3);
    animation: filterPulse 0.4s ease;
}

@keyframes filterPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.filter-btn .inner-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(80, 80, 120, 0.5);
    transition: background 0.3s ease;
}

.filter-btn.on .inner-dot {
    background: rgba(60, 200, 120, 0.8);
    box-shadow: 0 0 6px rgba(60, 200, 120, 0.5);
}

/* Custom Slider */
.custom-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, #3b6bdb, #6b8bff, #ff8844, #ff6622);
    outline: none;
    cursor: pointer;
}

.custom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e8ecff;
    box-shadow: 0 0 8px rgba(100, 140, 255, 0.5), 0 2px 4px rgba(0,0,0,0.3);
    cursor: grab;
    transition: box-shadow 0.2s;
}

.custom-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 0 16px rgba(100, 140, 255, 0.7), 0 2px 6px rgba(0,0,0,0.4);
}

.custom-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e8ecff;
    border: none;
    box-shadow: 0 0 8px rgba(100, 140, 255, 0.5), 0 2px 4px rgba(0,0,0,0.3);
    cursor: grab;
}

/* Keyboard Key */
.kb-key {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 20, 45, 0.7);
    border: 1px solid rgba(80, 100, 200, 0.2);
    border-radius: 4px;
    color: rgba(180, 195, 255, 0.8);
    font-size: 9px;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.3s ease;
    position: relative;
    text-transform: uppercase;
    min-height: 28px;
    box-shadow: 0 0 4px rgba(60, 80, 200, 0.05);
}

.kb-key::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 4px;
    box-shadow: 0 0 6px rgba(100, 140, 255, 0.08);
    animation: keyPulse 3s ease-in-out infinite;
}

@keyframes keyPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.kb-key:hover {
    background: rgba(40, 40, 80, 0.8);
    border-color: rgba(100, 130, 255, 0.4);
    box-shadow: 0 0 12px rgba(100, 140, 255, 0.2);
    color: rgba(220, 230, 255, 1);
}

/* Styled Select */
.styled-select {
    background: rgba(15, 15, 35, 0.8);
    border: 1px solid rgba(80, 100, 200, 0.25);
    border-radius: 8px;
    color: rgba(200, 210, 255, 0.9);
    padding: 8px 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7bff' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.styled-select:focus {
    border-color: rgba(100, 130, 255, 0.5);
    box-shadow: 0 0 16px rgba(60, 100, 255, 0.2);
}

.styled-select option {
    background: #0a0a1e;
    color: #c8d2ff;
}

/* Styled Input */
.styled-input {
    background: rgba(15, 15, 35, 0.8);
    border: 1px solid rgba(80, 100, 200, 0.25);
    border-radius: 8px;
    color: rgba(200, 210, 255, 0.9);
    padding: 8px 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    outline: none;
    width: 100%;
    transition: all 0.3s ease;
}

.styled-input:focus {
    border-color: rgba(100, 130, 255, 0.5);
    box-shadow: 0 0 16px rgba(60, 100, 255, 0.2);
}

.styled-input::placeholder {
    color: rgba(120, 130, 180, 0.5);
}

/* Segmented Button */
.seg-btn {
    padding: 6px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    border: 1px solid rgba(80, 100, 200, 0.25);
    background: rgba(15, 15, 35, 0.6);
    color: rgba(150, 160, 200, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
}

.seg-btn:first-child {
    border-radius: 8px 0 0 8px;
}

.seg-btn:last-child {
    border-radius: 0 8px 8px 0;
}

.seg-btn.active {
    background: rgba(40, 60, 160, 0.5);
    color: #c8d2ff;
    border-color: rgba(100, 130, 255, 0.4);
    box-shadow: 0 0 10px rgba(60, 100, 255, 0.15);
}

/* Action Buttons */
.btn-apply {
    padding: 10px 28px;
    border-radius: 10px;
    border: 1px solid rgba(60, 200, 120, 0.3);
    background: rgba(20, 60, 40, 0.6);
    color: rgba(120, 255, 170, 0.9);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(60, 200, 120, 0.1);
    letter-spacing: 1px;
}

.btn-apply:hover {
    box-shadow: 0 0 30px rgba(60, 200, 120, 0.25);
    border-color: rgba(60, 200, 120, 0.5);
    background: rgba(20, 80, 50, 0.7);
}

.btn-reset {
    padding: 10px 28px;
    border-radius: 10px;
    border: 1px solid rgba(80, 80, 120, 0.3);
    background: rgba(25, 25, 40, 0.6);
    color: rgba(150, 155, 180, 0.8);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 1px;
}

.btn-reset:hover {
    border-color: rgba(100, 100, 150, 0.4);
    color: rgba(180, 185, 210, 0.9);
}

/* Sync Button */
.btn-sync {
    padding: 8px 20px;
    border-radius: 8px;
    border: 1px solid rgba(60, 100, 255, 0.3);
    background: rgba(20, 30, 80, 0.6);
    color: rgba(140, 170, 255, 0.9);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-sync:hover {
    box-shadow: 0 0 20px rgba(60, 100, 255, 0.2);
    border-color: rgba(60, 100, 255, 0.5);
}

@keyframes sonarPing {
    0% { transform: scale(0.5); opacity: 0.8; }
    100% { transform: scale(2.5); opacity: 0; }
}

.sonar-ring {
    position: absolute;
    inset: 0;
    border-radius: 8px;
    border: 2px solid rgba(60, 120, 255, 0.5);
    animation: sonarPing 1s ease-out;
    pointer-events: none;
}

/* Toast */
.toast {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    padding: 10px 20px;
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    z-index: 100;
    animation: toastIn 0.3s ease forwards;
    white-space: nowrap;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(100, 130, 255, 0.2);
}

@keyframes toastIn {
    0% { transform: translateX(-50%) translateY(-100%); opacity: 0; }
    100% { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@keyframes toastOut {
    0% { transform: translateX(-50%) translateY(0); opacity: 1; }
    100% { transform: translateX(-50%) translateY(-100%); opacity: 0; }
}

.toast.leaving {
    animation: toastOut 0.3s ease forwards;
}

.green-flash {
    animation: greenFlash 0.4s ease;
}

@keyframes greenFlash {
    0% { box-shadow: inset 0 0 0 rgba(60, 200, 120, 0); }
    30% { box-shadow: inset 0 0 60px rgba(60, 200, 120, 0.15); }
    100% { box-shadow: inset 0 0 0 rgba(60, 200, 120, 0); }
}

/* Clock styles */
.clock-face {
    position: relative;
    width: 160px;
    height: 160px;
}

/* Checkbox */
.custom-checkbox {
    width: 16px;
    height: 16px;
    border: 1px solid rgba(80, 100, 200, 0.3);
    border-radius: 3px;
    background: rgba(15, 15, 35, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.custom-checkbox.checked {
    background: rgba(40, 60, 160, 0.5);
    border-color: rgba(100, 130, 255, 0.5);
}

/* Timezone dropdown */
.tz-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(12, 12, 30, 0.95);
    border: 1px solid rgba(80, 100, 200, 0.25);
    border-radius: 0 0 8px 8px;
    max-height: 160px;
    overflow-y: auto;
    z-index: 50;
    backdrop-filter: blur(12px);
}

.tz-dropdown::-webkit-scrollbar {
    width: 4px;
}

.tz-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.tz-dropdown::-webkit-scrollbar-thumb {
    background: rgba(80, 100, 200, 0.3);
    border-radius: 2px;
}

.tz-item {
    padding: 6px 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: rgba(180, 190, 230, 0.8);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tz-item:hover {
    background: rgba(40, 50, 100, 0.4);
    color: #c8d2ff;
}

/* Tooltip */
.tooltip-trigger {
    position: relative;
    cursor: help;
}

.tooltip-trigger .tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: rgba(20, 20, 50, 0.95);
    border: 1px solid rgba(80, 100, 200, 0.3);
    border-radius: 4px;
    font-size: 9px;
    color: rgba(180, 190, 230, 0.8);
    white-space: nowrap;
    transition: all 0.2s ease;
    z-index: 60;
}

.tooltip-trigger:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

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

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(60, 100, 255, 0.2);
    border-top-color: rgba(60, 120, 255, 0.8);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

/* Responsive */
@media (max-width: 700px) {
    .portal-panel {
        max-height: 90vh;
        overflow-y: auto;
    }

    .portal-panel::-webkit-scrollbar {
        width: 3px;
    }

    .portal-panel::-webkit-scrollbar-thumb {
        background: rgba(80, 100, 200, 0.2);
        border-radius: 2px;
    }
}