/* Variáveis e Reset */
:root {
    /* Cores - Tema Escuro (padrão) */
    --background: #0a0a0a;
    --foreground: #ffffff;
    --primary: #007bff;
    --primary-glow: rgba(0, 123, 255, 0.5);
    --secondary: #00c3ff;
    --accent: #ff3e3e;
    --accent-glow: rgba(255, 62, 62, 0.5);
    --border: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(30, 30, 30, 0.7);
    --server-rack: #2a2a2a;
    --server-unit: #1a1a1a;
    --server-light-on: #00ff4c;
    --server-light-glow: rgba(0, 255, 76, 0.5);
    --lightning-color: #00c3ff;
    --lightning-glow: rgba(0, 195, 255, 0.7);
    --code-color: #00c3ff;
    --particle-color: rgba(255, 255, 255, 0.5);
}

/* Tema Claro */
html.light-mode {
    --background: #f0f4f8;
    --foreground: #0a0a0a;
    --primary: #0056b3;
    --primary-glow: rgba(0, 86, 179, 0.3);
    --secondary: #0077b6;
    --accent: #d00000;
    --accent-glow: rgba(208, 0, 0, 0.3);
    --border: rgba(0, 0, 0, 0.1);
    --card-bg: rgba(255, 255, 255, 0.9);
    --server-rack: #d0d0d0;
    --server-unit: #e0e0e0;
    --server-light-on: #00cc44;
    --server-light-glow: rgba(0, 204, 68, 0.5);
    --lightning-color: #0077b6;
    --lightning-glow: rgba(0, 119, 182, 0.5);
    --code-color: #0077b6;
    --particle-color: rgba(0, 0, 0, 0.2);
}

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

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    transition: background-color 0.5s ease, color 0.5s ease;
    position: relative;
}

/* Container Principal */
.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
header {
    padding: 20px 0;
    text-align: center;
}

.logo {
    display: inline-block;
    margin-bottom: 20px;
}

.logo h1 {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    font-family: 'Orbitron', sans-serif;
}

.logo span {
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
}

.logo p {
    font-size: 1.2rem;
    color: var(--secondary);
    letter-spacing: 5px;
    margin-top: -10px;
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    width: 100%;
    text-align: center;
}

.tagline {
    font-size: 1.8rem;
    margin-bottom: 50px;
    font-weight: 500;
    letter-spacing: 1px;
}

/* Serviços Showcase */
.services-showcase {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-bottom: 50px;
}

.service {
    width: 350px;
    padding: 30px;
    border-radius: 15px;
    background-color: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service:hover {
    transform: translateY(-10px);
}

.service h3 {
    font-size: 1.5rem;
    margin: 20px 0 10px;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
}

.service p {
    margin-bottom: 25px;
    color: var(--foreground);
    opacity: 0.8;
}

.service-visual {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
}

/* API Visual com Raio */
.api-visual {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 800px;
}

.api-lightning {
    position: relative;
    width: 140px;
    height: 150px;
    transform-style: preserve-3d;
    animation: rotate3d 15s infinite linear;
}

@keyframes rotate3d {
    0% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(360deg);
    }
}

.lightning-bolt {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 120px;
    background: linear-gradient(90deg, #00c3ff, #0077ff, #00c3ff);
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M296 160H180.6l42.6-129.8C227.2 15 215.7 0 200 0H56C44 0 33.8 8.9 32.2 20.8l-32 240C-1.7 275.2 9.5 288 24 288h118.7L96.6 482.5c-3.6 15.2 8 29.5 23.3 29.5 8.4 0 16.4-4.4 20.8-12l176-304c9.3-15.9-2.2-36-20.7-36z"/></svg>');
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M296 160H180.6l42.6-129.8C227.2 15 215.7 0 200 0H56C44 0 33.8 8.9 32.2 20.8l-32 240C-1.7 275.2 9.5 288 24 288h118.7L96.6 482.5c-3.6 15.2 8 29.5 23.3 29.5 8.4 0 16.4-4.4 20.8-12l176-304c9.3-15.9-2.2-36-20.7-36z"/></svg>');
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    animation: pulseLightning 2s infinite;
    box-shadow: 0 0 30px var(--lightning-glow);
}

.lightning-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 140px;
    background: var(--lightning-glow);
    border-radius: 50%;
    filter: blur(20px);
    opacity: 0.7;
    animation: pulseGlow 2s infinite;
}

@keyframes pulseLightning {
    0%, 100% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(0.95);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.05);
        box-shadow: 0 0 40px var(--lightning-glow);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(0.9);
    }
    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

.api-code {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 8px;
    border-left: 3px solid var(--code-color);
}

.code-line {
    height: 4px;
    background: var(--code-color);
    border-radius: 2px;
    opacity: 0.8;
    position: relative;
    overflow: hidden;
}

.code-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    animation: codeScan 3s infinite;
}

.code-line:nth-child(1) {
    width: 80%;
}

.code-line:nth-child(2) {
    width: 60%;
}

.code-line:nth-child(3) {
    width: 40%;
}

@keyframes codeScan {
    0% {
        left: -50%;
    }
    100% {
        left: 150%;
    }
}

/* Servidor Visual */
.server-rack {
    width: 160px;
    height: 180px;
    background: linear-gradient(135deg, var(--server-rack), #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);
    animation: serverFloat 6s ease-in-out infinite;
}

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

.server-rack::before {
    content: '';
    position: absolute;
    top: 0;
    right: -15px;
    width: 15px;
    height: 100%;
    background: linear-gradient(to right, var(--server-rack), #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, var(--server-rack));
    filter: brightness(1.3);
    transform: rotateX(90deg) translateZ(-15px);
    border-radius: 8px 8px 0 0;
}

.server-unit {
    flex: 1;
    background: linear-gradient(90deg, var(--server-unit), #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: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.server-unit::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, 
        rgba(0, 0, 0, 0.2), 
        rgba(0, 0, 0, 0.1), 
        rgba(0, 0, 0, 0.2)
    );
}

.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, var(--server-unit), #252525);
    }
    50% {
        background: linear-gradient(90deg, 
            color-mix(in srgb, var(--server-unit) 90%, var(--server-light-on) 10%), 
            color-mix(in srgb, #252525 90%, var(--server-light-on) 5%)
        );
    }
}

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

.light {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--server-light-on);
    box-shadow: 0 0 8px var(--server-light-glow);
    position: relative;
    animation: blinkLight 2s infinite;
}

.light::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: radial-gradient(circle, var(--server-light-glow) 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);
}

.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%;
    }
}

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

/* Botões */
.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.4s ease;
    z-index: -1;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background-color: var(--accent);
    color: white;
    box-shadow: 0 5px 15px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.btn-secondary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 5px 15px var(--primary-glow);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--primary-glow);
}

/* Footer */
footer {
    padding: 20px 0;
    text-align: center;
}

/* Relógio */
.clock {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--foreground);
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 2px;
}

/* Alternador de Tema */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease;
}

.theme-toggle i {
    font-size: 1.5rem;
    color: var(--foreground);
    position: absolute;
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0.5);
}

.theme-toggle i.active {
    opacity: 1;
    transform: scale(1);
}

.theme-toggle:hover {
    transform: rotate(15deg);
}

/* Partículas de Fundo */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background-color: var(--particle-color);
    border-radius: 50%;
    animation: floatParticle 15s infinite linear;
}

.particle:nth-child(1) { top: 10%; left: 20%; animation-duration: 20s; }
.particle:nth-child(2) { top: 30%; left: 80%; animation-duration: 18s; }
.particle:nth-child(3) { top: 50%; left: 50%; animation-duration: 16s; }
.particle:nth-child(4) { top: 70%; left: 30%; animation-duration: 22s; }
.particle:nth-child(5) { top: 80%; left: 70%; animation-duration: 19s; }
.particle:nth-child(6) { top: 15%; left: 60%; animation-duration: 21s; }
.particle:nth-child(7) { top: 45%; left: 15%; animation-duration: 17s; }
.particle:nth-child(8) { top: 65%; left: 85%; animation-duration: 23s; }
.particle:nth-child(9) { top: 90%; left: 10%; animation-duration: 24s; }
.particle:nth-child(10) { top: 5%; left: 90%; animation-duration: 25s; }
.particle:nth-child(11) { top: 25%; left: 40%; animation-duration: 19s; }
.particle:nth-child(12) { top: 55%; left: 75%; animation-duration: 20s; }
.particle:nth-child(13) { top: 75%; left: 25%; animation-duration: 22s; }
.particle:nth-child(14) { top: 85%; left: 55%; animation-duration: 18s; }
.particle:nth-child(15) { top: 35%; left: 5%; animation-duration: 21s; }

@keyframes floatParticle {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translate(100px, -100px) scale(0);
        opacity: 0;
    }
}

/* Media Queries */
@media screen and (max-width: 992px) {
    .services-showcase {
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }
    
    .service {
        width: 100%;
        max-width: 400px;
    }
    
    .logo h1 {
        font-size: 3rem;
    }
    
    .tagline {
        font-size: 1.5rem;
    }
}

@media screen and (max-width: 576px) {
    .logo h1 {
        font-size: 2.5rem;
    }
    
    .logo p {
        font-size: 1rem;
    }
    
    .tagline {
        font-size: 1.2rem;
    }
    
    .clock {
        font-size: 1.5rem;
    }
    
    .theme-toggle {
        width: 40px;
        height: 40px;
    }
    
    .theme-toggle i {
        font-size: 1.2rem;
    }
}
