/* ==========================================
   BASE STYLES
   ========================================== */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    overflow: hidden;
}

h1, h2, h3 {
    font-family: 'Sora', sans-serif;
}

/* ==========================================
   GRADIENT UTILITIES
   These override Tailwind since they're 
   custom multi-color gradients
   ========================================== */
.bg-gradient-primary {
    background: linear-gradient(270deg, rgba(164,199,221,0.5) 0.14%, rgba(164,199,221,0) 99.86%) !important;
}

.bg-gradient-secondary {
    background: linear-gradient(321deg, #FFF -90.09%, #0088DE 190.09%) !important;
}

/* ==========================================
   ICON SYSTEM — CSS Mask with Iconify API
   Icons are rendered as masks so they inherit
   color from background-color / gradient
   ========================================== */
.si--double-arrow-right-line,
.si--dashboard-fill,
.mynaui--danger-diamond-solid,
.solar--bell-bold,
.mingcute--ship-fill,
.material-symbols--history-rounded,
.iconamoon--arrow-up-2 {
    display: inline-block;
    width: 1em;
    height: 1em;
    background-color: currentColor;
    mask-size: 100% 100%;
    mask-repeat: no-repeat;
    -webkit-mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
}

.si--double-arrow-right-line {
    -webkit-mask-image: url('https://api.iconify.design/mdi/chevron-double-right.svg');
    mask-image: url('https://api.iconify.design/mdi/chevron-double-right.svg');
}

.si--dashboard-fill {
    -webkit-mask-image: url('https://api.iconify.design/mdi/view-dashboard.svg');
    mask-image: url('https://api.iconify.design/mdi/view-dashboard.svg');
}

.mynaui--danger-diamond-solid {
    -webkit-mask-image: url('https://api.iconify.design/mdi/alert-rhombus.svg');
    mask-image: url('https://api.iconify.design/mdi/alert-rhombus.svg');
}

.solar--bell-bold {
    -webkit-mask-image: url('https://api.iconify.design/mdi/bell.svg');
    mask-image: url('https://api.iconify.design/mdi/bell.svg');
}

.mingcute--ship-fill {
    -webkit-mask-image: url('https://api.iconify.design/mdi/ferry.svg');
    mask-image: url('https://api.iconify.design/mdi/ferry.svg');
}

.material-symbols--history-rounded {
    -webkit-mask-image: url('https://api.iconify.design/material-symbols/history-rounded.svg');
    mask-image: url('https://api.iconify.design/material-symbols/history-rounded.svg');
}

.iconamoon--arrow-up-2 {
    -webkit-mask-image: url('https://api.iconify.design/mdi/chevron-down.svg');
    mask-image: url('https://api.iconify.design/mdi/chevron-down.svg');
}

/* ==========================================
   AUTO / MANUAL TOGGLE
   ========================================== */
.toggle > div {
    user-select: none;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    transition: all 0.3s ease;
}

.toggle > div.active {
    background: white;
    color: #030303;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ==========================================
   BRIDGE SLIDER — Animated Arrow
   ========================================== */
.bridge-arrow {
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
}

/* ==========================================
   GATE BUTTONS
   ========================================== */
.btn-gate {
    display: flex;
    width: 67px;
    height: 46px;
    transform: rotate(-15deg);
    justify-content: center;
    align-items: center;
    gap: 10px;
    border: none;
    border-radius: 9999px;
    background: linear-gradient(321deg, #FFF -90.09%, #0088DE 190.09%);
    font-size: 12px;
    font-weight: 300;
    line-height: 1.2;
    letter-spacing: -0.24px;
    color: white;
    cursor: pointer;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.btn-gate:hover {
    transform: rotate(-15deg) scale(1.05);
}

/* ==========================================
   TRAFFIC LIGHT TOGGLE
   ========================================== */
.btn-traffic {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    border-radius: 14px;
    border: none;
    background: transparent;
    color: rgba(100, 100, 100, 0.6);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: all 0.3s ease;
}

.btn-traffic.active {
    background: white;
    color: #030303;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* ==========================================
   SENSOR INDICATOR
   ========================================== */
.sensor {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    align-self: stretch;
    padding: 12px;
    margin: 0;
    border-radius: 5px;
    background: rgba(28, 28, 28, 0.60);
    backdrop-filter: blur(2.31px);
    -webkit-backdrop-filter: blur(2.31px);
    color: white;
    font-size: 16px;
    font-weight: 300;
    line-height: 120%;
    letter-spacing: -0.32px;
}

.sensor span {
    transition: opacity 0.3s ease;
}

/* ==========================================
   CONNECTION INDICATOR
   ========================================== */
.connection-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.connection-dot.connected {
    background: #22c55e;
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
    }
    50% {
        opacity: 0.8;
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }
}

/* ==========================================
   ALARM BUTTON HOVER EFFECT
   ========================================== */
#btn-alarm {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#btn-alarm:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(0, 136, 222, 0.3);
}

#btn-alarm:active {
    transform: scale(0.95);
}

/* ==========================================
   STATUS PANEL CARDS — Hover Effect
   ========================================== */
.grid > div {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.grid > div:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ==========================================
   NAV LINK HOVER
   ========================================== */
header a {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

header a:hover {
    opacity: 1 !important;
    transform: translateY(-1px);
}

/* ==========================================
   AUTO MODE — Disabled Controls
   ========================================== */
.controls-disabled {
    opacity: 0.45;
    pointer-events: none;
    cursor: not-allowed;
    position: relative;
    filter: grayscale(30%);
    transition: opacity 0.4s ease, filter 0.4s ease;
}
