/* Animation Generator Styles */

/* Generator info box */
.generator-info-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(106, 252, 255, 0.08);
    border: 1px solid rgba(106, 252, 255, 0.2);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.9em;
    color: #aaccee;
    line-height: 1.5;
}

.generator-info-box svg {
    flex-shrink: 0;
    stroke: #6afcff;
    margin-top: 2px;
}

.generator-info-box strong {
    color: #6afcff;
}

/* Animation output container */
.animation-output {
    background: #1e1e2e;
    border: 1px solid #304f78;
    border-radius: 8px;
    margin: 20px 0;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    padding: 15px;
}

/* Animation viewer container - Three.js canvas parent */
.animation-viewer-container {
    background: #0a0a15;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    width: 100%;
    height: 350px;
    margin-bottom: 12px;
}

.animation-viewer-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    cursor: grab;
}

.animation-viewer-container canvas:active {
    cursor: grabbing;
}

/* Animation viewer controls overlay */
.animation-viewer-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
    flex-wrap: wrap;
}

.animation-control-btn {
    background: rgba(106, 252, 255, 0.15);
    border: 1px solid rgba(106, 252, 255, 0.4);
    color: #6afcff;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.animation-control-btn:hover {
    background: rgba(106, 252, 255, 0.25);
    border-color: #6afcff;
    transform: scale(1.05);
}

.animation-control-btn.active {
    background: rgba(106, 252, 255, 0.35);
    border-color: #6afcff;
    box-shadow: 0 0 10px rgba(106, 252, 255, 0.3);
}

.animation-control-btn svg {
    width: 16px;
    height: 16px;
}

.animation-control-btn.play-pause {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.animation-control-btn.play-pause svg {
    width: 18px;
    height: 18px;
}

/* Timeline scrubber */
.animation-timeline {
    flex: 1;
    min-width: 100px;
    max-width: 200px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 10px;
    border-radius: 4px;
}

.timeline-scrubber {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(106, 252, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
}

.timeline-scrubber::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #6afcff;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s;
}

.timeline-scrubber::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.timeline-scrubber::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #6afcff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.timeline-time {
    font-size: 0.75em;
    color: rgba(106, 252, 255, 0.8);
    min-width: 35px;
    text-align: right;
    font-family: monospace;
}

/* Speed control dropdown */
.speed-control {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(106, 252, 255, 0.3);
    color: #6afcff;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    cursor: pointer;
    min-width: 50px;
}

.speed-control:hover {
    border-color: rgba(106, 252, 255, 0.6);
}

.speed-control option {
    background: #1e1e2e;
    color: #fff;
}

/* Help text overlay */
.animation-viewer-help {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: rgba(106, 252, 255, 0.8);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8em;
    pointer-events: none;
    opacity: 0.8;
    transition: opacity 0.3s;
    z-index: 5;
}

.animation-viewer-container:hover .animation-viewer-help {
    opacity: 0;
}

/* Animation info badges */
.animation-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.animation-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(106, 252, 255, 0.1);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #6afcff;
}

.animation-type-badge.character {
    background: rgba(255, 180, 106, 0.15);
    color: #ffb46a;
}

.rigged-badge {
    background: rgba(255, 180, 106, 0.3);
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75em;
    margin-left: 6px;
}

.animation-duration-badge,
.animation-loop-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(140, 204, 255, 0.1);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #8cf;
}

.animation-stats {
    color: #aab;
    font-size: 0.85em;
}

/* Animation actions */
.animation-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.animation-download-btn,
.animation-copy-btn {
    background: rgba(106, 252, 255, 0.1);
    border: 1px solid #6afcff;
    color: #6afcff;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.animation-download-btn:hover,
.animation-copy-btn:hover {
    background: rgba(106, 252, 255, 0.2);
    border-color: #8cfdff;
}

.animation-download-btn svg,
.animation-copy-btn svg {
    flex-shrink: 0;
}

/* Animation preview placeholder (browse view) */
.animation-preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    background: linear-gradient(135deg, #0a0a15 0%, #1a1a2e 100%);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    border: 1px solid rgba(106, 252, 255, 0.2);
}

.animation-preview-placeholder:hover {
    background: linear-gradient(135deg, #0f0f1a 0%, #1e1e35 100%);
    border-color: rgba(106, 252, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.animation-preview-placeholder svg {
    opacity: 0.6;
    transition: all 0.3s;
}

.animation-preview-placeholder:hover svg {
    opacity: 0.9;
    transform: scale(1.1);
}

.animation-preview-placeholder p {
    margin-top: 12px;
    color: #aab;
    font-size: 0.9em;
    transition: color 0.3s;
}

.animation-preview-placeholder:hover p {
    color: #6afcff;
}

/* Animation title and description */
.animation-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #fff;
    margin: 0 0 8px 0;
}

.animation-description {
    font-size: 0.95em;
    color: #aab;
    line-height: 1.4;
    margin: 0 0 12px 0;
}

/* Source mesh link */
.source-mesh-link {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(106, 252, 255, 0.05);
    border-radius: 4px;
    font-size: 0.85em;
}

.source-mesh-link svg {
    color: #6afcff;
}

.source-mesh-link a {
    color: #6afcff;
    text-decoration: none;
}

.source-mesh-link a:hover {
    text-decoration: underline;
}

/* Source mesh info badge on prompt page */
.source-mesh-info {
    margin-bottom: 15px;
}

.source-mesh-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(106, 252, 255, 0.1);
    border: 1px solid rgba(106, 252, 255, 0.3);
    padding: 10px 15px;
    border-radius: 8px;
    color: #6afcff;
    font-size: 0.9em;
}

.source-mesh-badge svg {
    flex-shrink: 0;
}

.view-source-link {
    margin-left: auto;
    color: #8cf;
    text-decoration: none;
    font-size: 0.85em;
}

.view-source-link:hover {
    text-decoration: underline;
}

/* Mesh paste area */
.mesh-paste-area {
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px dashed rgba(106, 252, 255, 0.3);
    border-radius: 8px;
}

.mesh-paste-area label {
    display: block;
    margin-bottom: 10px;
    color: #aab;
    font-size: 0.9em;
}

.mesh-data-textarea {
    width: 100%;
    min-height: 120px;
    padding: 10px;
    background: #0a0a15;
    border: 1px solid rgba(106, 252, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    font-family: monospace;
    font-size: 0.85em;
    resize: vertical;
}

.mesh-data-textarea:focus {
    outline: none;
    border-color: rgba(106, 252, 255, 0.5);
}

.mesh-data-textarea::placeholder {
    color: #556;
}

/* Rigging notice */
.rigging-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    padding: 10px 15px;
    background: rgba(255, 180, 106, 0.1);
    border: 1px solid rgba(255, 180, 106, 0.3);
    border-radius: 8px;
    color: #ffb46a;
    font-size: 0.85em;
}

.rigging-notice svg {
    flex-shrink: 0;
}

/* Loading state */
.animation-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
    background: #0a0a15;
    border-radius: 8px;
    color: #6afcff;
    font-size: 1.1em;
}

.animation-loading::after {
    content: '...';
    animation: animationLoading 1.5s infinite;
}

@keyframes animationLoading {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Error state */
.animation-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
    background: #0a0a15;
    border-radius: 8px;
    color: #ff6b6b;
    font-size: 0.95em;
}

/* Responsive styles */
@media (max-width: 768px) {
    .animation-output {
        padding: 10px;
    }

    .animation-viewer-container {
        height: 250px;
    }

    .animation-viewer-controls {
        top: 5px;
        left: 5px;
        right: 5px;
        gap: 5px;
    }

    .animation-control-btn {
        padding: 6px;
    }

    .animation-control-btn.play-pause {
        width: 36px;
        height: 36px;
    }

    .animation-timeline {
        flex: 0 0 100%;
        order: 10;
        margin-top: 5px;
        max-width: none;
    }

    .animation-actions {
        flex-direction: column;
    }

    .animation-download-btn,
    .animation-copy-btn {
        width: 100%;
        justify-content: center;
    }

    .animation-info {
        gap: 8px;
    }

    .animation-viewer-help {
        font-size: 0.7em;
        padding: 4px 8px;
    }

    .source-mesh-badge {
        flex-wrap: wrap;
    }

    .view-source-link {
        flex: 0 0 100%;
        margin-left: 0;
        margin-top: 8px;
    }
}

/* Animation type specific styling */
.animation-output[data-animation-type="rotate"] .animation-type-badge,
.animation-output[data-animation-type="bounce"] .animation-type-badge,
.animation-output[data-animation-type="float"] .animation-type-badge,
.animation-output[data-animation-type="pulse"] .animation-type-badge,
.animation-output[data-animation-type="orbit"] .animation-type-badge,
.animation-output[data-animation-type="wobble"] .animation-type-badge {
    background: rgba(106, 252, 255, 0.15);
}

.animation-output[data-animation-type="walk"] .animation-type-badge,
.animation-output[data-animation-type="idle"] .animation-type-badge,
.animation-output[data-animation-type="jump"] .animation-type-badge,
.animation-output[data-animation-type="wave"] .animation-type-badge {
    background: rgba(255, 180, 106, 0.15);
    color: #ffb46a;
}

/* Selection highlight */
.animation-output::selection,
.animation-output *::selection {
    background: rgba(106, 252, 255, 0.3);
}

/* Animation for smooth transitions */
.animation-viewer-container,
.animation-control-btn,
.animation-preview-placeholder {
    transition: all 0.3s ease;
}

/* Canvas focus state */
.animation-viewer-container:focus-within {
    outline: 2px solid rgba(106, 252, 255, 0.5);
    outline-offset: 2px;
}

/* Hide axis setting by default (shown via JS when rotate is selected) */
.axis-setting {
    display: none;
}
