/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    color: #e0e0e0;
    background: #0a0a0a;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 255, 198, 0.3) 0%, transparent 50%);
    animation: backgroundShift 20s ease-in-out infinite alternate;
    z-index: -1;
}

@keyframes backgroundShift {
    0% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1.1) rotate(180deg); }
}

/* Floating geometric shapes */
.shape {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    animation: float 6s ease-in-out infinite;
    z-index: -1;
}

.shape:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape:nth-child(2) {
    width: 60px;
    height: 60px;
    top: 20%;
    right: 10%;
    animation-delay: 2s;
    border-radius: 0;
    background: linear-gradient(45deg, #45b7d1, #f9ca24);
    transform: rotate(45deg);
}

.shape:nth-child(3) {
    width: 100px;
    height: 100px;
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    background: linear-gradient(45deg, #a8e6cf, #ffd3a5);
}

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

header {
    background: rgba(10, 10, 10, 0.8);
    color: #e0e0e0;
    padding: 3rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 2px solid #ff6b6b;
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #4ecdc4, transparent);
    animation: scanLine 3s linear infinite;
}

@keyframes scanLine {
    0% { left: -100%; }
    100% { left: 100%; }
}

header h1 {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    color: #ff6b6b;
    text-shadow: 0 0 20px #ff6b6b, 0 0 40px #ff6b6b;
    font-weight: bold;
    letter-spacing: 2px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 20px #ff6b6b, 0 0 40px #ff6b6b; }
    to { text-shadow: 0 0 30px #4ecdc4, 0 0 60px #4ecdc4; }
}

header p {
    font-size: 1.4rem;
    opacity: 0.8;
    font-style: italic;
}

nav {
    background: rgba(20, 20, 20, 0.9);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 107, 107, 0.3);
}

nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    flex-wrap: wrap;
}

nav li {
    margin: 0 1rem;
}

nav a {
    color: #e0e0e0;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: 0;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 107, 107, 0.5), transparent);
    transition: left 0.5s;
}

nav a:hover::before {
    left: 100%;
}

nav a:hover {
    color: #ff6b6b;
    text-shadow: 0 0 10px #ff6b6b;
    transform: perspective(1000px) rotateX(10deg);
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
}

section {
    background: rgba(20, 20, 20, 0.8);
    margin-bottom: 3rem;
    padding: 3rem;
    border-radius: 0;
    border: 1px solid rgba(78, 205, 196, 0.3);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
    transform-style: preserve-3d;
    transition: all 0.3s ease;
}

section::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #f9ca24);
    z-index: -1;
    border-radius: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

section:hover::before {
    opacity: 1;
}

section:hover {
    transform: translateY(-10px) rotateX(5deg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

section h2 {
    color: #4ecdc4;
    margin-bottom: 1.5rem;
    font-size: 2.8rem;
    text-shadow: 0 0 10px #4ecdc4;
    position: relative;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    border-radius: 2px;
}

section h3 {
    color: #45b7d1;
    margin: 2rem 0 1rem 0;
    font-size: 1.8rem;
    text-shadow: 0 0 5px #45b7d1;
}

section p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.8;
}

.image-placeholder {
    background: rgba(40, 40, 40, 0.8);
    border: 2px dashed #4ecdc4;
    padding: 2rem;
    text-align: center;
    margin: 1.5rem 0;
    border-radius: 0;
    color: #4ecdc4;
    position: relative;
}

.image-placeholder::before {
    content: '⚡';
    font-size: 2rem;
    position: absolute;
    top: 10px;
    right: 10px;
    animation: pulse 2s infinite;
}

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

/* Types grid */
.types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.type-card {
    background: rgba(30, 30, 30, 0.9);
    padding: 2rem;
    border: 1px solid rgba(249, 202, 36, 0.3);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    transform-style: preserve-3d;
}

.type-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255, 107, 107, 0.1), rgba(78, 205, 196, 0.1));
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.type-card:hover::before {
    transform: translateX(0);
}

.type-card:hover {
    transform: translateY(-15px) rotateY(5deg);
    border-color: #f9ca24;
    box-shadow: 0 15px 30px rgba(249, 202, 36, 0.2);
}

.type-card ul {
    margin-top: 1.5rem;
    padding-left: 1.5rem;
}

.type-card li {
    margin-bottom: 0.5rem;
    position: relative;
}

.type-card li::before {
    content: '▶';
    color: #ff6b6b;
    position: absolute;
    left: -1.5rem;
}

/* Algorithms */
.algorithms-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.algorithm {
    background: rgba(25, 25, 25, 0.9);
    padding: 2rem;
    border: 1px solid rgba(168, 230, 207, 0.3);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.algorithm::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 10px solid #a8e6cf;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    transform: translateY(-50%);
    transition: all 0.3s ease;
}

.algorithm:hover::after {
    right: 10px;
}

.algorithm:hover {
    transform: translateX(10px);
    border-color: #a8e6cf;
    box-shadow: 10px 0 20px rgba(168, 230, 207, 0.2);
}

.algorithm pre {
    background: rgba(10, 10, 10, 0.8);
    padding: 1rem;
    border: 1px solid #ffd3a5;
    border-radius: 0;
    overflow-x: auto;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
    color: #ffd3a5;
}

/* Applications */
.applications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.app-card {
    background: linear-gradient(45deg, rgba(255, 107, 107, 0.1), rgba(78, 205, 196, 0.1));
    color: #e0e0e0;
    padding: 2rem;
    border: 1px solid rgba(255, 107, 107, 0.3);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    transform-style: preserve-3d;
}

.app-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 107, 107, 0.5), transparent);
    animation: rotate 4s linear infinite;
    z-index: -1;
}

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

.app-card:hover {
    transform: scale(1.05) rotateY(10deg);
    border-color: #ff6b6b;
    box-shadow: 0 0 30px rgba(255, 107, 107, 0.3);
}

.app-card h3 {
    margin-bottom: 1rem;
    color: #ff6b6b;
    text-shadow: 0 0 10px #ff6b6b;
}

/* Resources */
.resources-list {
    margin-top: 2rem;
}

.resources-list h3 {
    margin: 2.5rem 0 1rem 0;
    color: #f9ca24;
    text-shadow: 0 0 5px #f9ca24;
}

.resources-list ul {
    padding-left: 2rem;
}

.resources-list li {
    margin-bottom: 0.5rem;
    position: relative;
}

.resources-list li::before {
    content: '⚡';
    color: #4ecdc4;
    position: absolute;
    left: -2rem;
}

/* Footer */
footer {
    background: rgba(10, 10, 10, 0.9);
    color: #e0e0e0;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 2px solid #ff6b6b;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 10px,
        rgba(78, 205, 196, 0.1) 10px,
        rgba(78, 205, 196, 0.1) 20px
    );
}

/* Responsive design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.5rem;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
    }

    nav li {
        margin: 0.5rem 0;
    }

    .types-grid,
    .algorithms-container,
    .applications-grid {
        grid-template-columns: 1fr;
    }

    section {
        padding: 1.5rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

section {
    animation: fadeIn 0.8s ease-out;
    animation-fill-mode: both;
}

section:nth-child(1) { animation-delay: 0.1s; }
section:nth-child(2) { animation-delay: 0.2s; }
section:nth-child(3) { animation-delay: 0.3s; }
section:nth-child(4) { animation-delay: 0.4s; }
section:nth-child(5) { animation-delay: 0.5s; }
section:nth-child(6) { animation-delay: 0.6s; }