/* Tech Style Enhancements */

/* 1. Digital Grid Floor */
.tech-grid-layer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 35%;
    z-index: -1;
    perspective: 1000px;
    overflow: hidden;
    pointer-events: none;
    mask-image: linear-gradient(to top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 100%);
    -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 100%);
}

.tech-grid {
    position: absolute;
    bottom: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image:
        linear-gradient(rgba(0, 242, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 242, 255, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    transform: rotateX(60deg);
    animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
    0% {
        transform: rotateX(60deg) translateY(0);
    }

    100% {
        transform: rotateX(60deg) translateY(40px);
    }
}

/* 2. Tech Corners for Cards */
.module-card,
.dept-card {
    /* Ensure relative positioning for pseudo-elements */
    position: relative;
}

/* Corner Brackets */
.module-card::after,
.dept-card::after {
    content: '';
    position: absolute;
    inset: -2px;
    /* Slightly outside the border */
    border: 2px solid transparent;
    border-radius: 16px;
    /* Match card radius */
    background:
        linear-gradient(to right, var(--primary-color) 2px, transparent 2px) top left,
        linear-gradient(to bottom, var(--primary-color) 2px, transparent 2px) top left,
        linear-gradient(to left, var(--primary-color) 2px, transparent 2px) top right,
        linear-gradient(to bottom, var(--primary-color) 2px, transparent 2px) top right,
        linear-gradient(to right, var(--primary-color) 2px, transparent 2px) bottom left,
        linear-gradient(to top, var(--primary-color) 2px, transparent 2px) bottom left,
        linear-gradient(to left, var(--primary-color) 2px, transparent 2px) bottom right,
        linear-gradient(to top, var(--primary-color) 2px, transparent 2px) bottom right;
    background-size: 15px 15px;
    background-repeat: no-repeat;
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.3s;
}

.module-card:hover::after,
.dept-card:hover::after {
    opacity: 1;
    filter: drop-shadow(0 0 5px var(--primary-color));
}

/* 3. Scanning Line Effect */


/* Let's use a subtle background scan on the card itself */
.module-card,
.dept-card {
    background-image: linear-gradient(180deg,
            rgba(0, 242, 255, 0) 0%,
            rgba(0, 242, 255, 0.05) 50%,
            rgba(0, 242, 255, 0) 100%);
    background-size: 100% 200%;
    background-position: 0% -100%;
    transition: background-position 0s;
    /* Reset */
}

.module-card:hover,
.dept-card:hover {
    animation: scan-move 2s linear infinite;
}

@keyframes scan-move {
    0% {
        background-position: 0% -100%;
    }

    100% {
        background-position: 0% 200%;
    }
}

/* 4. HUD Decorative Elements */
.hud-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.hud-corner {
    position: absolute;
    width: 150px;
    height: 150px;
    border: 1px solid rgba(0, 242, 255, 0.1);
    opacity: 0.5;
}

.hud-top-left {
    top: 20px;
    left: 20px;
    border-right: none;
    border-bottom: none;
    border-top-left-radius: 20px;
}

.hud-top-right {
    top: 20px;
    right: 20px;
    border-left: none;
    border-bottom: none;
    border-top-right-radius: 20px;
}

.hud-bottom-left {
    bottom: 20px;
    left: 20px;
    border-right: none;
    border-top: none;
    border-bottom-left-radius: 20px;
}

.hud-bottom-right {
    bottom: 20px;
    right: 20px;
    border-left: none;
    border-top: none;
    border-bottom-right-radius: 20px;
}

.hud-text {
    position: absolute;
    font-family: 'Outfit', monospace;
    font-size: 10px;
    color: var(--primary-color);
    opacity: 0.7;
    letter-spacing: 1px;
}

.hud-top-left .hud-text {
    top: 10px;
    left: 15px;
}

.hud-top-right .hud-text {
    top: 10px;
    right: 15px;
    text-align: right;
}

.hud-bottom-left .hud-text {
    bottom: 10px;
    left: 15px;
}

.hud-bottom-right .hud-text {
    bottom: 10px;
    right: 15px;
    text-align: right;
}

/* 5. Connection Particles */
.connection-particle {
    fill: var(--primary-color);
    filter: drop-shadow(0 0 3px var(--primary-color));
    opacity: 0;
}

/* 6. Carousel Track Smoothness */
.modules-track {
    display: flex;
    will-change: transform;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    /* Smooth ease-out */
}

/* 8. Virtual Console Deck (Bottom) */
.console-deck {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    z-index: 4;
    pointer-events: none;
    perspective: 1000px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.console-glass {
    position: absolute;
    bottom: -20px;
    width: 80%;
    height: 100px;
    background: linear-gradient(to top, rgba(0, 242, 255, 0.1), transparent);
    transform: rotateX(45deg);
    border-top: 1px solid rgba(0, 242, 255, 0.3);
    box-shadow: 0 -10px 30px rgba(0, 242, 255, 0.1);
    backdrop-filter: blur(2px);
}

.console-lines {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(90deg, rgba(0, 242, 255, 0.05) 1px, transparent 1px);
    background-size: 100px 100%;
    background-position: center;
    mask-image: linear-gradient(to top, black, transparent);
    -webkit-mask-image: linear-gradient(to top, black, transparent);
}

.console-alarms {
    position: relative;
    width: 900px;
    /* Wider for table layout */
    height: 100px;
    /* Slightly taller */
    margin-bottom: 10px;
    z-index: 6;
    overflow: hidden;
    mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
}

.alarm-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    animation: alarm-scroll 60s linear infinite;
}

.alarm-list:hover {
    animation-play-state: paused;
}

@keyframes alarm-scroll {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-50%);
    }
}

.alarm-item {
    font-family: 'Outfit', monospace;
    font-size: 11px;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.4);
    border-left: 2px solid var(--primary-color);
    color: var(--text-secondary);
    display: grid;
    grid-template-columns: 2fr 1.2fr 0.8fr 0.8fr;
    gap: 10px;
    align-items: center;
    /* animation: alarm-slide-up 0.5s ease-out; Removed for smooth scroll */
    border-radius: 4px;
    flex-shrink: 0;
    /* Prevent shrinking in flex container */
}

.alarm-item:hover {
    background: rgba(0, 242, 255, 0.1);
}

.alarm-col {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alarm-status {
    text-align: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
}

/* Status Colors */
.status-pending {
    color: #ff0055;
    /* Red */
    background: rgba(255, 0, 85, 0.1);
    border: 1px solid rgba(255, 0, 85, 0.3);
}

.status-processing {
    color: #00f2ff;
    /* Cyan/Blue */
    background: rgba(0, 242, 255, 0.1);
    border: 1px solid rgba(0, 242, 255, 0.3);
}

.status-overdue {
    color: #ff9f1c;
    /* Orange */
    background: rgba(255, 159, 28, 0.1);
    border: 1px solid rgba(255, 159, 28, 0.3);
}

.status-closed {
    color: #00ff9d;
    /* Green */
    background: rgba(0, 255, 157, 0.1);
    border: 1px solid rgba(0, 255, 157, 0.3);
    opacity: 0.7;
}

.alarm-item.warning {
    border-left-color: #ff9f1c;
}

.alarm-item.error {
    border-left-color: #ff0055;
}

.alarm-item.closed {
    border-left-color: #00ff9d;
    opacity: 0.6;
}

.alarm-time {
    opacity: 0.6;
    font-size: 10px;
    text-align: right;
}

@keyframes alarm-slide-up {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.console-status {
    position: absolute;
    bottom: 20px;
    right: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 6;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 5px var(--accent-color);
    animation: blink 2s infinite;
}

.status-text {
    font-family: 'Outfit', monospace;
    font-size: 10px;
    color: var(--text-secondary);
    letter-spacing: 2px;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}