/* Animations Section Styles */
.animations-section {
    padding: 80px 0;
    background: var(--bg-darker);
    position: relative;
    overflow: hidden;
}

.animations-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 255, 195, 0.05) 0%, rgba(0, 163, 255, 0.05) 100%);
    pointer-events: none;
}

.animations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.animation-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 30px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.animation-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.animation-card:hover::before {
    transform: scaleX(1);
}

.animation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.animation-header {
    margin-bottom: 20px;
    text-align: center;
}

.animation-header h3 {
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
}

.animation-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Particle System */
.particle-canvas-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#particle-canvas {
    border: 2px solid var(--glass-border);
    border-radius: 8px;
    background: var(--bg-dark);
    cursor: crosshair;
    transition: border-color 0.3s ease;
}

#particle-canvas:hover {
    border-color: var(--primary-color);
}

.particle-controls {
    display: flex;
    gap: 10px;
}

.particle-btn {
    padding: 8px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.particle-btn:hover {
    background: var(--primary-color);
    color: var(--bg-dark);
    transform: translateY(-2px);
}

/* Typing Animation */
.typing-container {
    background: var(--bg-dark);
    border: 2px solid var(--glass-border);
    border-radius: 8px;
    padding: 20px;
    min-height: 80px;
    display: flex;
    align-items: center;
    position: relative;
    margin-bottom: 15px;
}

.typing-text {
    font-size: 18px;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.typing-cursor {
    width: 2px;
    height: 20px;
    background: var(--primary-color);
    margin-left: 2px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.typing-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.typing-btn {
    padding: 8px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.typing-btn:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
}

/* Memory Game */
.memory-game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.memory-game {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    max-width: 320px;
}

.memory-card {
    width: 70px;
    height: 70px;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    transform-style: preserve-3d;
}

.memory-card:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.memory-card.flipped {
    transform: rotateY(180deg);
}

.memory-card-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
    background: var(--bg-dark);
    border-radius: 6px;
    backface-visibility: hidden;
}

.memory-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.memory-score,
.memory-moves {
    font-size: 14px;
    color: var(--text-secondary);
}

.memory-score span,
.memory-moves span {
    color: var(--primary-color);
    font-weight: 600;
}

.memory-btn {
    padding: 8px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.memory-btn:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
}

/* Color Generator */
.color-generator-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.color-palette {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.color-swatch {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    border: 2px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.color-swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.color-hex {
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
}

.color-controls {
    display: flex;
    gap: 10px;
}

.color-btn {
    padding: 8px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.color-btn:hover {
    background: var(--primary-color);
    color: var(--bg-dark);
    transform: translateY(-2px);
}

/* Color notification */
.color-notification {
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .animations-section {
        padding: 60px 0;
    }
    
    .animations-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .animation-card {
        padding: 20px;
    }
    
    #particle-canvas {
        width: 100%;
        max-width: 350px;
        height: auto;
    }
    
    .memory-game {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
        max-width: 280px;
    }
    
    .memory-card {
        width: 60px;
        height: 60px;
    }
    
    .color-palette {
        gap: 6px;
    }
    
    .color-swatch {
        width: 50px;
        height: 50px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .animation-card:hover {
        transform: none;
    }
    
    .particle-btn:hover,
    .typing-btn:hover,
    .memory-btn:hover,
    .color-btn:hover {
        transform: none;
    }
    
    .memory-card:hover {
        transform: none;
    }
    
    .color-swatch:hover {
        transform: none;
    }
    
    .typing-cursor {
        animation: none;
    }
}

/* Dark/Light theme adjustments */
[data-theme="light"] .animations-section {
    background: var(--bg-darker);
}

[data-theme="light"] .animation-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] #particle-canvas {
    background: #f8f9fa;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .typing-container {
    background: #f8f9fa;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .memory-card {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .memory-card-inner {
    background: #f8f9fa;
}

/* Focus styles for accessibility */
.animation-card:focus-within {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.particle-btn:focus,
.typing-btn:focus,
.memory-btn:focus,
.color-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .animation-card {
        border: 2px solid var(--text-primary);
    }
    
    .animation-card:hover {
        border-color: var(--primary-color);
    }
    
    .particle-btn,
    .typing-btn,
    .memory-btn,
    .color-btn {
        border: 2px solid var(--text-primary);
    }
    
    .particle-btn:hover,
    .typing-btn:hover,
    .memory-btn:hover,
    .color-btn:hover {
        border-color: var(--primary-color);
    }
}
