* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

:root {
    --primary: #6c5ce7;
    --primary-dark: #5649c0;
    --secondary: #a29bfe;
    --light: #f9f9ff;
    --dark: #2d3436;
    --gray: #dfe6e9;
    --success: #00b894;
    --danger: #e74c3c;
    --warning: #fdcb6e;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --radius: 12px;
}

body {
    background-color: #f8f9ff;
    color: var(--dark);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius);
    color: white;
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    font-weight: 700;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto;
}

.app-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr;
    }
}

.panel {
    background: white;
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
}

.panel-title {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--gray);
}

.panel-title i {
    color: var(--primary);
    font-size: 1.4rem;
    margin-right: 12px;
}

.panel-title h2 {
    font-size: 1.6rem;
    font-weight: 600;
}

/* Animation Preview Styles */
#animationPreview {
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: var(--radius);
}

.animated-element {
    width: 120px;
    height: 120px;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    box-shadow: 0 10px 20px rgba(108, 92, 231, 0.3);
    position: relative;
}

.animated-element span {
    font-size: 1.2rem;
    position: absolute;
    bottom: -30px;
    color: var(--dark);
    font-weight: 600;
    width: 182px;
}

/* Animation Keyframes */
@keyframes slide {
    0% { transform: translateX(-150px); opacity: 0; }
    70% { transform: translateX(10px); }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-30px); }
    60% { transform: translateY(-15px); }
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fade {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

@keyframes flip {
    0% { transform: perspective(400px) rotateY(0); }
    100% { transform: perspective(400px) rotateY(360deg); }
}

@keyframes zoom {
    0% { transform: scale(0.3); opacity: 0; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* Animation Classes */
.slide {
    animation-name: slide;
}

.bounce {
    animation-name: bounce;
}

.rotate {
    animation-name: rotate;
}

.fade {
    animation-name: fade;
}

.pulse {
    animation-name: pulse;
}

.shake {
    animation-name: shake;
}

.flip {
    animation-name: flip;
}

.zoom {
    animation-name: zoom;
}

/* Controls Panel */
.controls-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

@media (max-width: 768px) {
    .controls-grid {
        grid-template-columns: 1fr;
    }
}

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
}

.slider-container {
    display: flex;
    align-items: center;
}

.slider-container input[type="range"] {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: var(--gray);
    outline: none;
    -webkit-appearance: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.slider-value {
    width: 50px;
    text-align: center;
    font-weight: 600;
    color: var(--primary);
}

select, input[type="color"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--gray);
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    color: var(--dark);
    transition: all 0.3s ease;
}

select:focus, input[type="color"]:focus {
    border-color: var(--primary);
    outline: none;
}

.color-inputs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

/* Timing Functions */
.timing-functions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.timing-btn {
    flex: 1;
    min-width: 100px;
    padding: 10px;
    background: white;
    border: 2px solid var(--gray);
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.timing-btn:hover {
    border-color: var(--primary);
    background: rgba(108, 92, 231, 0.05);
}

.timing-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Action Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 25px;
}

.btn {
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn i {
    margin-right: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 7px 15px rgba(108, 92, 231, 0.3);
}

.btn-secondary {
    background: var(--gray);
    color: var(--dark);
}

.btn-secondary:hover {
    background: #c8d0d8;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #00a085;
}

/* Code Output */
#codeOutput {
    background: #1e1e2e;
    color: #f8f8f2;
    padding: 20px;
    border-radius: var(--radius);
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.5;
    height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    margin-bottom: 20px;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.copy-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.copy-btn i {
    margin-right: 5px;
}

/* Animations Library */
.animations-library {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 10px;
}

@media (max-width: 768px) {
    .animations-library {
        grid-template-columns: repeat(2, 1fr);
    }
}

.animation-preset {
    background: white;
    border: 2px solid var(--gray);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.animation-preset:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.animation-preset i {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.animation-preset h4 {
    font-size: 1rem;
    font-weight: 600;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    color: #666;
    font-size: 0.9rem;
    border-top: 1px solid var(--gray);
}

.highlight {
    color: var(--primary);
    font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.2rem;
    }
    
    .panel {
        padding: 20px;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
}