﻿/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    color: white;
}

#bgCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 10;
}

/* Floating Header */
.floating-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.floating-header h1 {
    font-size: 3.5rem;
    background: linear-gradient(90deg, #ff0080, #00ffcc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 1rem;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.8;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 0.15);
    border-color: #00ffcc;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.7s;
}

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

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #00ffcc;
}

.card h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #fff;
}

.card p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

/* 3D Cube */
.cube {
    width: 80px;
    height: 80px;
    margin: 1.5rem auto 0;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(25deg) rotateY(25deg);
    transition: transform 1s;
}

.cube div {
    position: absolute;
    width: 80px;
    height: 80px;
    background: linear-gradient(45deg, #ff0080, #00ffcc);
    opacity: 0.8;
    border: 2px solid white;
}

.cube .front { transform: translateZ(40px); }
.cube .back { transform: rotateY(180deg) translateZ(40px); }
.cube .right { transform: rotateY(90deg) translateZ(40px); }
.cube .left { transform: rotateY(-90deg) translateZ(40px); }
.cube .top { transform: rotateX(90deg) translateZ(40px); }
.cube .bottom { transform: rotateX(-90deg) translateZ(40px); }

/* Control Panel */
.control-panel {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 3rem 0;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border: none;
    border-radius: 50px;
    background: linear-gradient(90deg, #ff0080, #00ffcc);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.btn:active {
    transform: translateY(0);
}

/* Stats */
.stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 3rem 0;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 15px;
    min-width: 120px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-value {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    background: linear-gradient(90deg, #ff0080, #00ffcc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.8;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#portDisplay {
    color: #00ffcc;
    font-weight: bold;
    animation: glow 2s infinite;
}

@keyframes glow {
    0%, 100% { text-shadow: 0 0 5px #00ffcc; }
    50% { text-shadow: 0 0 20px #00ffcc, 0 0 30px #00ffcc; }
}

.pivo-note {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 0.5rem;
}

/* Particle Demo */
.particle-demo, .color-cycle {
    height: 60px;
    margin-top: 1rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
}

.color-cycle {
    animation: colorShift 8s infinite alternate;
}

@keyframes colorShift {
    0% { background: linear-gradient(90deg, #ff0080, #ff8a00); }
    25% { background: linear-gradient(90deg, #ff8a00, #00ffcc); }
    50% { background: linear-gradient(90deg, #00ffcc, #0080ff); }
    75% { background: linear-gradient(90deg, #0080ff, #8000ff); }
    100% { background: linear-gradient(90deg, #8000ff, #ff0080); }
}

/* Responsive */
@media (max-width: 768px) {
    .floating-header h1 {
        font-size: 2.5rem;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .control-panel {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}
