/* Servidor Visual Aprimorado */
.server-visual {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
}

.server-rack-container {
    position: relative;
    transform-style: preserve-3d;
    animation: serverFloat 6s ease-in-out infinite;
}

@keyframes serverFloat {
    0%, 100% {
        transform: translateY(0) rotateY(-15deg);
    }
    50% {
        transform: translateY(-10px) rotateY(-15deg);
    }
}

.server-rack {
    width: 160px;
    height: 180px;
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    padding: 12px;
    gap: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    transform-style: preserve-3d;
    transform: perspective(800px) rotateY(-15deg) rotateX(5deg);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.server-rack::before {
    content: '';
    position: absolute;
    top: 0;
    right: -15px;
    width: 15px;
    height: 100%;
    background: linear-gradient(to right, #2a2a2a, #0a0a0a);
    filter: brightness(0.6);
    transform: rotateY(90deg) translateZ(15px);
    border-radius: 0 8px 8px 0;
}

.server-rack::after {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 15px;
    background: linear-gradient(to bottom, #3a3a3a, #2a2a2a);
    filter: brightness(1.3);
    transform: rotateX(90deg) translateZ(-15px);
    border-radius: 8px 8px 0 0;
}

.server-unit {
    flex: 1;
    background: linear-gradient(90deg, #1a1a1a, #252525);
    border-radius: 4px;
    padding: 8px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.server-unit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.05),
        transparent
    );
    animation: serverScan 3s infinite;
}

@keyframes serverScan {
    0% {
        left: -100%;
    }
    100% {
        left: 200%;
    }
}

.server-unit:nth-child(1) {
    animation: serverPulse 3s infinite;
}

.server-unit:nth-child(2) {
    animation: serverPulse 3s infinite 1s;
}

.server-unit:nth-child(3) {
    animation: serverPulse 3s infinite 2s;
}

@keyframes serverPulse {
    0%, 100% {
        background: linear-gradient(90deg, #1a1a1a, #252525);
    }
    50% {
        background: linear-gradient(90deg, #1f1f1f, #2a2a2a);
    }
}

.server-lights {
    display: flex;
    gap: 8px;
}

.server-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.server-port {
    width: 20px;
    height: 4px;
    background-color: #333;
    border-radius: 1px;
}

.light {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #00ff4c;
    box-shadow: 0 0 8px rgba(0, 255, 76, 0.5);
    position: relative;
    animation: blinkLight 2s infinite;
}

.light::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: radial-gradient(circle, rgba(0, 255, 76, 0.5) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
}

.light:nth-child(1) {
    animation-delay: 0s;
}

.light:nth-child(2) {
    animation-delay: 0.7s;
    background-color: #ff3e3e;
    box-shadow: 0 0 8px rgba(255, 62, 62, 0.7);
}

@keyframes blinkLight {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        transform: scale(0.8);
    }
}

/* Cabos de conexão */
.server-cables {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.cable {
    width: 4px;
    height: 30px;
    background: linear-gradient(to bottom, #00ff4c, #00aa33);
    position: relative;
    border-radius: 2px;
}

.cable:nth-child(2) {
    background: linear-gradient(to bottom, #ff3e3e, #aa2222);
}

.cable:nth-child(3) {
    background: linear-gradient(to bottom, #00c3ff, #0077ff);
}

.cable::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 5px;
    background-color: #444;
    border-radius: 2px;
}

/* Efeito de dados */
.data-flow {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.data-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: #00ff4c;
    border-radius: 50%;
    opacity: 0;
    animation: dataParticleFlow 3s infinite linear;
}

.data-particle:nth-child(1) {
    top: 20%;
    left: 10%;
    animation-delay: 0.2s;
}

.data-particle:nth-child(2) {
    top: 40%;
    left: 5%;
    animation-delay: 0.7s;
}

.data-particle:nth-child(3) {
    top: 60%;
    left: 15%;
    animation-delay: 1.2s;
}

.data-particle:nth-child(4) {
    top: 80%;
    left: 8%;
    animation-delay: 1.7s;
}

.data-particle:nth-child(5) {
    top: 30%;
    right: 10%;
    animation-delay: 0.5s;
    animation-direction: reverse;
}

.data-particle:nth-child(6) {
    top: 50%;
    right: 5%;
    animation-delay: 1s;
    animation-direction: reverse;
}

.data-particle:nth-child(7) {
    top: 70%;
    right: 15%;
    animation-delay: 1.5s;
    animation-direction: reverse;
}

@keyframes dataParticleFlow {
    0% {
        transform: translateX(0);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        transform: translateX(80px);
        opacity: 0;
    }
}

/* Status display */
.server-status {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    padding: 4px 8px;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    color: #00ff4c;
    white-space: nowrap;
    overflow: hidden;
    width: 120px;
    text-align: center;
}

.status-text {
    display: inline-block;
    animation: statusBlink 2s infinite;
}

@keyframes statusBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Tema claro */
html.light-mode .server-rack {
    background: linear-gradient(135deg, #d0d0d0, #e0e0e0);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

html.light-mode .server-rack::before {
    background: linear-gradient(to right, #d0d0d0, #c0c0c0);
}

html.light-mode .server-rack::after {
    background: linear-gradient(to bottom, #e0e0e0, #d0d0d0);
}

html.light-mode .server-unit {
    background: linear-gradient(90deg, #e0e0e0, #d0d0d0);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

html.light-mode .server-unit::before {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0, 0, 0, 0.05),
        transparent
    );
}

html.light-mode .server-port {
    background-color: #aaa;
}

html.light-mode .server-status {
    background-color: rgba(0, 0, 0, 0.1);
    color: #00aa33;
}

html.light-mode .cable::after {
    background-color: #aaa;
}

html.light-mode .light {
    background-color: #00cc44;
    box-shadow: 0 0 8px rgba(0, 204, 68, 0.5);
}

html.light-mode .light::after {
    background: radial-gradient(circle, rgba(0, 204, 68, 0.5) 0%, transparent 70%);
}

html.light-mode .light:nth-child(2) {
    background-color: #d00000;
    box-shadow: 0 0 8px rgba(208, 0, 0, 0.7);
}

html.light-mode .data-particle {
    background-color: #00cc44;
}

/* Responsividade */
@media screen and (max-width: 576px) {
    .server-rack {
        width: 140px;
        height: 160px;
    }
    
    .server-status {
        width: 100px;
        font-size: 8px;
    }
}
