/* CSS Animation Generator Styles */

.animation-generator {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 2rem;
    grid-template-areas: 
        "controls preview"
        "code code";
}

.controls-section {
    grid-area: controls;
    background: var(--card-bg-color);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid var(--subtle-border-color);
}

.preview-section {
    grid-area: preview;
    background: var(--card-bg-color);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid var(--subtle-border-color);
}

.code-section {
    grid-area: code;
    background: var(--card-bg-color);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid var(--subtle-border-color);
}

.controls-section h2,
.preview-section h2,
.code-section h2 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.control-group {
    margin-bottom: 1rem;
}

.control-group label {
    display: block;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.control-group select,
.control-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--subtle-border-color);
    border-radius: 4px;
    background: var(--main-bg-color);
    color: var(--text-color);
    font-size: 0.9rem;
}

.control-group select:focus,
.control-group input:focus {
    outline: none;
    border-color: var(--highlight-color);
    box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 0.5rem;
    margin-top: 1rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--highlight-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #005a9e;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #4b5563;
    transform: translateY(-1px);
}

.btn-info {
    background-color: #0891b2;
    color: white;
}

.btn-info:hover:not(:disabled) {
    background-color: #0e7490;
    transform: translateY(-1px);
}

.preview-container {
    height: 200px;
    background: var(--main-bg-color);
    border: 2px dashed var(--subtle-border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.animation-target {
    width: 80px;
    height: 80px;
    background: var(--highlight-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
    text-align: center;
}

.code-output {
    position: relative;
}

.code-output pre {
    background: var(--main-bg-color);
    border: 1px solid var(--subtle-border-color);
    border-radius: 4px;
    padding: 1rem;
    color: var(--text-color);
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    overflow-x: auto;
    white-space: pre-wrap;
    margin-bottom: 1rem;
    min-height: 100px;
}

/* Animation Keyframes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes slideInUp {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

@keyframes slideInDown {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -30px, 0);
    }
    70% {
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    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 rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes scale {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes flip {
    0% { transform: perspective(400px) rotateY(0); }
    40% { transform: perspective(400px) rotateY(-90deg); }
    60% { transform: perspective(400px) rotateY(-90deg); }
    100% { transform: perspective(400px) rotateY(0); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .animation-generator {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "controls"
            "preview"
            "code";
    }
    
    .controls-section,
    .preview-section,
    .code-section {
        padding: 1rem;
    }
    
    .btn {
        width: 100%;
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
}
