/**
 * Animation Panel Styles
 */

/* ===== SECTION CONTAINER ===== */
.animation-panel-section {
    padding: 60px 32px;
    background: linear-gradient(180deg, 
        #0A1F24 0%, 
        #0D2832 50%,
        #0A1F24 100%
    );
}

.animation-panel-container {
    max-width: 1000px;
    margin: 0 auto;
}

/* ===== HEADER ===== */
.animation-panel-header {
    text-align: center;
    margin-bottom: 32px;
}

.animation-panel-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--orca-sand, #E6DCCB);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.animation-panel-title svg {
    color: var(--orca-mist, #8CA0A3);
}

.animation-panel-subtitle {
    font-size: 15px;
    color: var(--orca-mist, #8CA0A3);
}

/* ===== LOGIN PROMPT ===== */
.animation-login-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    text-align: center;
}

.animation-login-prompt svg {
    color: var(--orca-mist);
    margin-bottom: 16px;
    opacity: 0.6;
}

.animation-login-prompt p {
    color: var(--orca-sand);
    font-size: 16px;
    margin-bottom: 16px;
}

.animation-login-btn {
    background: linear-gradient(135deg, #25464A, #1A3844);
    color: var(--orca-sand);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.animation-login-btn:hover {
    background: linear-gradient(135deg, #2D5459, #1F4450);
    transform: translateY(-1px);
}

/* ===== MAIN CONTENT ===== */
.animation-panel-content {
    display: none;
}

/* ===== TYPE TOGGLE ===== */
.animation-type-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.anim-type-btn {
    flex: 1;
    padding: 14px 20px;
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--orca-mist);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.anim-type-btn:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(30, 30, 30, 0.8);
}

.anim-type-btn.active {
    background: linear-gradient(135deg, #25464A, #1A3844);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--orca-sand);
}

.anim-type-btn svg {
    opacity: 0.7;
}

.anim-type-btn.active svg {
    opacity: 1;
}

/* ===== GENERATION FORM ===== */
.animation-form {
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.animation-form-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
    margin-bottom: 16px;
}

@media (max-width: 700px) {
    .animation-form-row {
        grid-template-columns: 1fr;
    }
}

/* Upload Area */
.animation-upload-area {
    position: relative;
    aspect-ratio: 1;
    background: rgba(10, 10, 10, 0.5);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
}

.animation-upload-area:hover,
.animation-upload-area.dragover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(20, 20, 20, 0.5);
}

.animation-upload-area.has-image {
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.2);
}

.animation-upload-area svg {
    color: var(--orca-mist);
    margin-bottom: 8px;
    opacity: 0.5;
}

.animation-upload-area span {
    color: var(--orca-mist);
    font-size: 12px;
    text-align: center;
    padding: 0 16px;
}

.animation-upload-area.has-image .upload-placeholder {
    display: none;
}

.animation-image-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
}

.animation-clear-image {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.animation-clear-image:hover {
    background: rgba(255, 50, 50, 0.8);
}

/* Description Textarea */
.animation-description-wrapper {
    display: flex;
    flex-direction: column;
}

.animation-description {
    flex: 1;
    min-height: 120px;
    padding: 16px;
    background: rgba(10, 10, 10, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--orca-sand);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
}

.animation-description::placeholder {
    color: var(--orca-mist);
    opacity: 0.6;
}

.animation-description:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.25);
}

/* ===== SETTINGS ===== */
.animation-settings-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--orca-mist);
    font-size: 13px;
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 8px;
}

.animation-settings-toggle svg {
    transition: transform 0.2s;
}

.animation-settings-toggle.open svg {
    transform: rotate(180deg);
}

.animation-settings {
    display: none;
    padding: 16px;
    background: rgba(10, 10, 10, 0.4);
    border-radius: 8px;
    margin-bottom: 16px;
}

.animation-settings.open {
    display: block;
}

.animation-settings label {
    display: block;
    color: var(--orca-mist);
    font-size: 12px;
    margin-bottom: 6px;
}

.animation-settings select {
    width: 100%;
    padding: 10px 12px;
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--orca-sand);
    font-size: 13px;
}

/* ===== COUNTER ===== */
.animation-counter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

#animationCounter {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.counter-label {
    color: var(--orca-mist);
}

.counter-value {
    color: var(--orca-sand);
    font-weight: 600;
    padding: 4px 10px;
    background: rgba(37, 70, 74, 0.4);
    border-radius: 4px;
}

.counter-value.exhausted {
    background: rgba(200, 50, 50, 0.3);
    color: #ff8080;
}

/* ===== GENERATE BUTTON ===== */
.animation-generate-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #25464A, #1A3844);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: var(--orca-sand);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.animation-generate-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #2D5459, #1F4450);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

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

/* ===== PROGRESS ===== */
.animation-progress {
    display: none;
    margin-top: 20px;
    padding: 20px;
    background: rgba(10, 10, 10, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.anim-progress-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--orca-sand);
    font-weight: 500;
}

.anim-progress-header.success {
    color: #4ade80;
}

.anim-progress-header.error {
    color: #f87171;
}

.anim-progress-icon {
    font-size: 18px;
}

.anim-progress-icon.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.anim-progress-time {
    margin-left: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--orca-mist);
}

.anim-progress-desc {
    font-size: 13px;
    color: var(--orca-mist);
    margin-bottom: 8px;
}

.anim-progress-note {
    font-size: 12px;
    color: var(--orca-mist);
    opacity: 0.7;
    margin-bottom: 12px;
}

.anim-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.anim-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #25464A, #4ade80);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.anim-progress-error {
    color: #f87171;
    font-size: 13px;
    margin-top: 8px;
}

/* ===== RESULTS GRID ===== */
.anim-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.anim-result-item {
    text-align: center;
}

.anim-result-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: rgba(20, 20, 20, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.anim-result-item span {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: var(--orca-mist);
    text-transform: capitalize;
}

/* ===== ANIMATIONS LIST ===== */
.animation-list-section {
    margin-top: 32px;
}

.animation-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.animation-list-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--orca-sand);
}

.anim-loading, .anim-error, .anim-empty {
    padding: 48px;
    text-align: center;
    color: var(--orca-mist);
}

.anim-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.anim-spinner, .anim-spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--orca-sand);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.anim-spinner-small {
    width: 16px;
    height: 16px;
}

.anim-empty svg {
    opacity: 0.3;
    margin-bottom: 12px;
}

.anim-empty p {
    color: var(--orca-sand);
    font-size: 15px;
    margin-bottom: 4px;
}

.anim-empty span {
    font-size: 13px;
}

/* ===== PROJECT CARDS ===== */
.anim-project-card {
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.anim-project-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.anim-project-ref {
    background: linear-gradient(135deg, #25464A, #1A3844);
    color: var(--orca-sand);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.anim-project-name {
    color: var(--orca-sand);
    font-size: 15px;
    font-weight: 500;
}

.anim-project-animations {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.anim-item {
    text-align: center;
}

.anim-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: rgba(10, 10, 10, 0.5);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.anim-name {
    display: block;
    margin-top: 4px;
    font-size: 10px;
    color: var(--orca-mist);
    text-transform: capitalize;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.anim-project-actions {
    display: flex;
    gap: 8px;
}

.anim-action-btn {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--orca-mist);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.anim-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--orca-sand);
}

/* ===== YOUR ANIMATIONS - SCROLLABLE ===== */
.animation-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.animation-list-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--orca-sand);
    margin: 0;
}

#animationsList {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

#animationsList::-webkit-scrollbar {
    width: 6px;
}

#animationsList::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

#animationsList::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

#animationsList::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Project Card Improvements */
.anim-project-card {
    margin-bottom: 12px;
    border-radius: 10px;
    overflow: hidden;
}

.anim-project-header {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px 10px 0 0;
    transition: background 0.2s;
}

.anim-project-header:hover {
    background: rgba(30, 30, 30, 0.7);
}

.anim-project-card.collapsed .anim-project-header {
    border-radius: 10px;
}

.anim-project-card.collapsed .anim-project-animations,
.anim-project-card.collapsed .anim-project-actions {
    display: none;
}

.anim-project-arrow {
    margin-left: auto;
    color: var(--orca-mist);
    transition: transform 0.2s;
}

.anim-project-card.collapsed .anim-project-arrow {
    transform: rotate(-90deg);
}

.anim-project-count {
    font-size: 11px;
    color: var(--orca-mist);
    opacity: 0.7;
}

.anim-project-animations {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    padding: 12px;
    background: rgba(15, 15, 15, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.anim-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    background: rgba(30, 30, 30, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.2s;
}

.anim-item:hover {
    background: rgba(40, 40, 40, 0.7);
    border-color: rgba(255, 255, 255, 0.12);
}

.anim-item-preview {
    width: 64px;
    height: 64px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 6px;
}

.anim-item-preview .anim-thumb {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
}

.anim-item-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.anim-item-download {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    color: var(--orca-mist);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.anim-item-download:hover {
    background: rgba(100, 200, 150, 0.3);
    color: #4ade80;
}

.anim-project-actions {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(15, 15, 15, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: none;
    border-radius: 0 0 10px 10px;
}

/* Empty states */
.anim-no-items {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    color: var(--orca-mist);
    opacity: 0.6;
    font-size: 13px;
}

.anim-no-preview {
    font-size: 10px;
    color: var(--orca-mist);
    opacity: 0.5;
    text-align: center;
}

/* Download button in complete panel */
.anim-download-btn {
    background: rgba(100, 200, 150, 0.15);
    border: 1px solid rgba(100, 200, 150, 0.3);
    border-radius: 6px;
    padding: 6px 10px;
    color: #4ade80;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 8px;
    font-size: 11px;
    transition: all 0.2s;
}

.anim-download-btn:hover {
    background: rgba(100, 200, 150, 0.25);
    border-color: rgba(100, 200, 150, 0.5);
}

/* ===== COMPLETION PANEL ===== */
.anim-complete-panel {
    background: linear-gradient(135deg, rgba(40, 100, 80, 0.15), rgba(30, 60, 50, 0.1));
    border: 1px solid rgba(100, 200, 150, 0.3);
    border-radius: 12px;
    padding: 20px;
}

.anim-complete-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.anim-complete-icon {
    font-size: 24px;
}

.anim-complete-title {
    display: flex;
    flex-direction: column;
}

.anim-complete-title strong {
    font-size: 16px;
    color: var(--orca-sand, #E6DCCB);
}

.anim-complete-ref {
    font-size: 12px;
    color: var(--orca-mist, #8CA0A3);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 4px;
    width: fit-content;
}

.anim-complete-results {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    justify-content: center;
}

.anim-complete-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.anim-complete-preview {
    width: 128px;
    height: 128px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 2px solid rgba(100, 200, 150, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.anim-complete-gif {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
}

.anim-complete-name {
    font-size: 12px;
    color: var(--orca-sand, #E6DCCB);
    text-transform: capitalize;
    font-weight: 500;
}

.anim-complete-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.anim-complete-actions .anim-action-btn {
    padding: 10px 20px;
    font-size: 13px;
    flex: none;
}

.anim-complete-actions .anim-action-btn.primary {
    background: linear-gradient(135deg, #25665A, #1A4840);
    border-color: rgba(100, 200, 150, 0.4);
    color: var(--orca-sand, #E6DCCB);
}

.anim-complete-actions .anim-action-btn.primary:hover {
    background: linear-gradient(135deg, #2D7A6A, #1F5850);
    border-color: rgba(100, 200, 150, 0.6);
}

.anim-complete-actions .anim-action-btn.secondary {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.15);
}

.anim-complete-actions .anim-action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.05);
}

