/* CSS v1015 - Fixed progress bars + Storyboard improvements */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: #e0e0e0;
    font-family: "Helvetica Neue", Arial, sans-serif;
    color: #333;
    font-size: 16px;
}

body.dark-theme {
    background: #222;
    color: #eee;
}

/* Splash Screen */
.splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #e0e0e0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

body.dark-theme .splash {
    background: #222;
}

#ascii-art {
    font-family: monospace;
    margin: 0 0 1rem 0;
    white-space: pre;
    color: #666;
    text-align: center;
    line-height: 1.2;
}

body.dark-theme #ascii-art {
    color: #aaa;
}

.ascii-version {
    margin: 0 0 3rem 0;
    font-size: 1.2rem;
    color: #666;
}

body.dark-theme .ascii-version {
    color: #bbb;
}

/* Language Selector */
.language-selector {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
}


/* Login Form */
#password-box {
    background: #e0e0e0;
    padding: 2rem;
    border-radius: 15px;
    box-shadow:
        8px 8px 16px #bebebe,
        -8px -8px 16px #ffffff;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

body.dark-theme #password-box {
    background: #333;
    box-shadow:
        8px 8px 16px #1a1a1a,
        -8px -8px 16px #2a2a2a;
}

#password-box p {
    margin: 0 0 1rem 0;
    color: #444;
    text-align: left;
}

body.dark-theme #password-box p {
    color: #eee;
}

.password-input-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

#passwordInput, #usernameInput, .neo-input {
    flex: 1;
    min-width: 200px;
    padding: 0.8rem;
    border: none;
    border-radius: 8px;
    background: #e0e0e0;
    font-size: 1rem;
    box-shadow:
        inset 3px 3px 6px #bebebe,
        inset -3px -3px 6px #ffffff;
}

body.dark-theme #passwordInput,
body.dark-theme #usernameInput,
body.dark-theme .neo-input {
    background: #444;
    color: #eee;
    box-shadow:
        inset 3px 3px 6px #1a1a1a,
        inset -3px -3px 6px #2a2a2a;
}

/* Remember Me and Logo Container */
.remember-logo-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding-right: 0.5rem;
}

/* Login Logo */
.login-logo {
    width: 80px;
    height: auto;
}

.login-logo.light {
    display: none;
}

body.dark-theme .login-logo.light {
    display: block;
}

body.dark-theme .login-logo.dark {
    display: none;
}

/* Top Bar */
#top-bar {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: #e0e0e0;
    box-shadow:
        3px 3px 6px #bebebe,
        -3px -3px 6px #ffffff;
}

body.dark-theme #top-bar {
    background: #333;
    box-shadow:
        3px 3px 6px #1a1a1a,
        -3px -3px 6px #2a2a2a;
}

#logo-credits-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 2rem;
    margin-left: 0.5rem;
}

#credits-panel {
    margin-top: -10px;
    margin-bottom: 26px;
}

.logo {
    width: 250px;
    height: auto;
    margin-bottom: 30px;
    margin-top: 16px;
}

/* Credits Display */
.credits-display {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    padding: 6px 16px;
    font-size: 20px;
    width: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
    border-radius: 20px;
    box-shadow: 
        inset 2px 2px 4px #d0d0d0,
        inset -2px -2px 4px #ffffff;
    font-size: 24px;
    font-weight: 700;
    width: 260px;
}

body.dark-theme .credits-display {
    background: #2a2a2a;
    box-shadow: 
        inset 2px 2px 4px #1a1a1a,
        inset -2px -2px 4px #3a3a3a;
    color: #eee;
}


#credits-count {
    font-weight: bold;
    color: #6366f1;
    margin-right: 4px;
}

body.dark-theme #credits-count {
    color: #8b5cf6;
}

.credits-label {
    color: #666;
    font-size: 12px;
}

body.dark-theme .credits-label {
    color: #aaa;
}

/* Low credits warning */
.credits-display.low-credits #credits-count {
    color: #ff9800;
}

.credits-display.no-credits #credits-count {
    color: #f44336;
}

#thinking-face {
    font-size: 2rem;
    margin-left: 1rem;
}

/* Progress Panel - Improved */
#progress-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 1rem;
    padding: 1rem;
    background: #e0e0e0;
    border-radius: 12px;
    box-shadow:
        inset 3px 3px 6px #bebebe,
        inset -3px -3px 6px #ffffff;
    position: relative;
    z-index: 1;
}

body.dark-theme #progress-panel {
    background: #333;
    box-shadow:
        inset 3px 3px 6px #1a1a1a,
        inset -3px -3px 6px #2a2a2a;
}

.progress-bar {
    width: 100%;
    max-width: 400px;
    background: #d1d1d1;
    border-radius: 12px;
    height: 24px;
    overflow: hidden;
    box-shadow:
        inset 4px 4px 8px #bebebe,
        inset -4px -4px 8px #ffffff;
    position: relative;
}

body.dark-theme .progress-bar {
    background: #2a2a2a;
    box-shadow:
        inset 4px 4px 8px #1a1a1a,
        inset -4px -4px 8px #3a3a3a;
}

.progress-fill {
    background: linear-gradient(90deg, #5a8dee, #76a6f0);
    height: 100%;
    width: 0%;
    transition: width 3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Continuous animation for progress bars */
.progress-fill.animating {
    background: linear-gradient(270deg, #5a8dee, #76a6f0, #5a8dee, #76a6f0);
    background-size: 400% 100%;
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Frame circular progress bars */
.frame-progress-circle {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 10px auto;
}

.frame-progress-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.frame-progress-circle .progress-track {
    fill: none;
    stroke: #d1d1d1;
    stroke-width: 4;
}

.frame-progress-circle .progress-fill-circle {
    fill: none;
    stroke: #5a8dee;
    stroke-width: 4;
    stroke-dasharray: 0, 251.2;
    transition: stroke-dasharray 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.frame-progress-circle.spinning .progress-fill-circle {
    animation: spin 2s linear infinite;
    stroke-dasharray: 62.8, 188.4;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.frame-status {
    text-align: center;
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
    min-height: 16px;
}

body.dark-theme .frame-status {
    color: #aaa;
}

body.dark-theme .frame-progress-circle .progress-track {
    stroke: #444;
}

/* Frame regenerate section */
.frame-regenerate {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #d1d1d1;
    text-align: center;
}

body.dark-theme .frame-regenerate {
    border-top-color: #444;
}

.frame-regenerate-btn {
    background: #e0e0e0;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    color: #444;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 2px 2px 4px #bebebe, -2px -2px 4px #ffffff;
    transition: all 0.2s ease;
    margin: 5px;
}

body.dark-theme .frame-regenerate-btn {
    background: #444;
    color: #eee;
    box-shadow: 2px 2px 4px #1a1a1a, -2px -2px 4px #2a2a2a;
}

.frame-regenerate-btn:hover {
    transform: scale(1.05);
}

.frame-regenerate-checkbox {
    margin-right: 8px;
}

/* Scene frame actions */
.scene-frame-actions {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    justify-content: flex-start; /* Align buttons to the left */
}

.scene-draw-btn, .scene-reference-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    padding: 8px 12px;
}

.scene-references {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.scene-reference-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 2px 2px 4px #bebebe, -2px -2px 4px #ffffff;
}

body.dark-theme .scene-reference-item {
    box-shadow: 2px 2px 4px #1a1a1a, -2px -2px 4px #2a2a2a;
}

.scene-reference-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scene-reference-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reference-label {
    position: absolute;
    bottom: 2px;
    left: 2px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 3px;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

#progressStatus {
    margin-top: 0.8rem;
    font-size: 1rem;
    font-weight: 500;
    color: #333;
    max-width: 400px;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

body.dark-theme #progressStatus {
    color: #eee;
}

#timeRemaining {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.4rem;
    font-weight: 400;
}

body.dark-theme #timeRemaining {
    color: #bbb;
}

.progress-details {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #666;
    text-align: center;
    max-width: 400px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

body.dark-theme .progress-details {
    color: #aaa;
}

/* Tabs */
.tab-bar {
    display: flex;
    background: #e0e0e0;
    box-shadow:
        inset 3px 3px 6px #bebebe,
        inset -3px -3px 6px #ffffff;
}

body.dark-theme .tab-bar {
    background: #333;
    box-shadow:
        inset 3px 3px 6px #1a1a1a,
        inset -3px -3px 6px #2a2a2a;
}

.tab-btn {
    flex: 1;
    border: none;
    background: none;
    font-size: 1rem;
    padding: 0.8rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #444;
}

body.dark-theme .tab-btn {
    color: #eee;
}

.tab-btn:hover {
    background: #d4d4d4;
}

body.dark-theme .tab-btn:hover {
    background: #444;
}

.tab-btn.active {
    background: #e0e0e0;
    font-weight: bold;
    box-shadow:
        inset 4px 4px 8px #bebebe,
        inset -4px -4px 8px #ffffff;
}

body.dark-theme .tab-btn.active {
    background: #333;
    box-shadow:
        inset 4px 4px 8px #1a1a1a,
        inset -4px -4px 8px #2a2a2a;
}

/* Buttons */
.neo-button {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    background: #e0e0e0;
    color: #444;
    font-size: 1rem;
    cursor: pointer;
    box-shadow:
        3px 3px 6px #bebebe,
        -3px -3px 6px #ffffff;
    transition: all 0.2s ease;
    margin-right: 0.5rem;
}

body.dark-theme .neo-button {
    background: #444;
    color: #eee;
    box-shadow:
        3px 3px 6px #1a1a1a,
        -3px -3px 6px #2a2a2a;
}

.neo-button:hover {
    transform: translateY(-1px);
    box-shadow:
        4px 4px 8px #bebebe,
        -4px -4px 8px #ffffff;
}

body.dark-theme .neo-button:hover {
    box-shadow:
        4px 4px 8px #1a1a1a,
        -4px -4px 8px #2a2a2a;
}

.neo-button:active {
    transform: translateY(1px);
    box-shadow:
        inset 2px 2px 4px #bebebe,
        inset -2px -2px 4px #ffffff;
}

.neo-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Primary Button - highlighted without color */
.primary-button {
    font-weight: bold;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    box-shadow:
        5px 5px 10px #bebebe,
        -5px -5px 10px #ffffff;
}

body.dark-theme .primary-button {
    box-shadow:
        5px 5px 10px #1a1a1a,
        -5px -5px 10px #2a2a2a;
}

/* Sign In Button - white text */
#btn-signin {
    color: #ffffff !important;
}

body.dark-theme #btn-signin {
    color: #ffffff !important;
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow:
        6px 6px 12px #bebebe,
        -6px -6px 12px #ffffff;
}

body.dark-theme .primary-button:hover {
    box-shadow:
        6px 6px 12px #1a1a1a,
        -6px -6px 12px #2a2a2a;
}

/* Stop Button */
.stop-button {
    padding: 0.8rem 1.2rem;
    min-width: auto;
    margin-right: 0.5rem;
}

/* Parameters */
.params-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.params-box {
    padding: 1.5rem;
    background: #e0e0e0;
    border-radius: 12px;
    box-shadow:
        3px 3px 6px #bebebe,
        -3px -3px 6px #ffffff;
}

body.dark-theme .params-box {
    background: #333;
    box-shadow:
        3px 3px 6px #1a1a1a,
        -3px -3px 6px #2a2a2a;
    color: #eee;
}

.param-label {
    font-weight: bold;
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    background: #e0e0e0;
    border-radius: 8px;
    box-shadow:
        3px 3px 6px #bebebe,
        -3px -3px 6px #ffffff;
    color: #444;
}

body.dark-theme .param-label {
    background: #333;
    box-shadow:
        3px 3px 6px #1a1a1a,
        -3px -3px 6px #2a2a2a;
    color: #eee;
}

.param-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.5rem;
}

/* Aspect Ratio Slider */
.aspect-ratio-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.aspect-ratio-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: #d1d1d1;
    border-radius: 4px;
    outline: none;
    box-shadow:
        inset 2px 2px 4px #bebebe,
        inset -2px -2px 4px #ffffff;
}

body.dark-theme .aspect-ratio-slider {
    background: #2a2a2a;
    box-shadow:
        inset 2px 2px 4px #1a1a1a,
        inset -2px -2px 4px #3a3a3a;
}

.aspect-ratio-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #76a6f0;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.aspect-ratio-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #76a6f0;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    border: none;
}

.aspect-ratio-display {
    text-align: center;
    font-weight: bold;
    color: #444;
}

body.dark-theme .aspect-ratio-display {
    color: #eee;
}

/* Neo Radio and Checkbox */
.neo-radio, .neo-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    color: #444;
}

body.dark-theme .neo-radio,
body.dark-theme .neo-checkbox {
    color: #eee;
}

.neo-radio input,
.neo-checkbox input {
    display: none;
}

.radio-mark {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e0e0e0;
    box-shadow:
        inset 2px 2px 4px #bebebe,
        inset -2px -2px 4px #ffffff;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-mark {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: #e0e0e0;
    box-shadow:
        inset 2px 2px 4px #bebebe,
        inset -2px -2px 4px #ffffff;
    position: relative;
    transition: all 0.2s ease;
}

body.dark-theme .radio-mark,
body.dark-theme .checkbox-mark {
    background: #333;
    box-shadow:
        inset 2px 2px 4px #1a1a1a,
        inset -2px -2px 4px #2a2a2a;
}

.neo-radio input:checked + .radio-mark::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: #76a6f0;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.neo-checkbox input:checked + .checkbox-mark {
    background: #76a6f0;
}

.neo-checkbox input:checked + .checkbox-mark::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.neo-radio input:disabled + .radio-mark,
.neo-checkbox input:disabled + .checkbox-mark {
    opacity: 0.5;
    cursor: not-allowed;
}

#colorizeLabel {
    margin-left: 1rem;
}

/* Additional Instructions Chat */
.additional-instructions {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #e0e0e0;
    border-radius: 12px;
    box-shadow:
        inset 2px 2px 4px #bebebe,
        inset -2px -2px 4px #ffffff;
}

body.dark-theme .additional-instructions {
    background: #333;
    box-shadow:
        inset 2px 2px 4px #1a1a1a,
        inset -2px -2px 4px #2a2a2a;
}

.additional-instructions h4 {
    margin: 0 0 1rem 0;
    color: #444;
    font-size: 1.1rem;
}

body.dark-theme .additional-instructions h4 {
    color: #eee;
}

.instructions-input-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#additionalInstructions {
    min-height: 100px;
    resize: vertical;
}

.instructions-attachments {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.attachment-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #d0d0d0;
    border-radius: 8px;
    box-shadow:
        2px 2px 4px #bebebe,
        -2px -2px 4px #ffffff;
}

body.dark-theme .attachment-item {
    background: #444;
    box-shadow:
        2px 2px 4px #1a1a1a,
        -2px -2px 4px #2a2a2a;
}

.attachment-remove {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
}

/* Style References */
.style-references-container {
    margin-top: 1rem;
    padding: 1rem;
    background: #e0e0e0;
    border-radius: 8px;
    box-shadow:
        inset 2px 2px 4px #bebebe,
        inset -2px -2px 4px #ffffff;
    display: none;
}

body.dark-theme .style-references-container {
    background: #333;
    box-shadow:
        inset 2px 2px 4px #1a1a1a,
        inset -2px -2px 4px #2a2a2a;
}

.style-references-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.style-reference-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    box-shadow:
        2px 2px 4px #bebebe,
        -2px -2px 4px #ffffff;
}

body.dark-theme .style-reference-item {
    box-shadow:
        2px 2px 4px #1a1a1a,
        -2px -2px 4px #2a2a2a;
}

.style-reference-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.style-reference-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
}

/* Form Elements */
textarea, .neo-textarea {
    width: 100%;
    font-family: inherit;
    font-size: 1rem;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    background: #e0e0e0;
    color: #444;
    box-shadow:
        inset 3px 3px 6px #bebebe,
        inset -3px -3px 6px #ffffff;
    transition: all 0.3s ease;
    resize: vertical;
}

body.dark-theme textarea,
body.dark-theme .neo-textarea {
    background: #333;
    color: #eee;
    box-shadow:
        inset 3px 3px 6px #1a1a1a,
        inset -3px -3px 6px #2a2a2a;
}

select, .neo-select {
    width: auto;
    min-width: 120px;
    font-family: inherit;
    font-size: 1rem;
    padding: 0.8rem;
    border: none;
    border-radius: 8px;
    background: #e0e0e0;
    color: #444;
    box-shadow:
        inset 3px 3px 6px #bebebe,
        inset -3px -3px 6px #ffffff;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23444444%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem top 50%;
    background-size: 0.65rem auto;
    padding-right: 2rem;
}

body.dark-theme select,
body.dark-theme .neo-select {
    background: #333;
    color: #eee;
    box-shadow:
        inset 3px 3px 6px #1a1a1a,
        inset -3px -3px 6px #2a2a2a;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23eeeeee%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
}

.neo-box {
    padding: 1.5rem;
    background: #e0e0e0;
    border-radius: 12px;
    box-shadow:
        3px 3px 6px #bebebe,
        -3px -3px 6px #ffffff;
    margin-bottom: 1rem;
}

body.dark-theme .neo-box {
    background: #333;
    box-shadow:
        3px 3px 6px #1a1a1a,
        -3px -3px 6px #2a2a2a;
}

.neo-box textarea {
    margin-bottom: 1.5rem;
}

/* Characters */
.character-card {
    background: #e0e0e0;
    border-radius: 12px;
    box-shadow:
        3px 3px 6px #bebebe,
        -3px -3px 6px #ffffff;
    padding: 1rem;
    margin-bottom: 1rem;
}

body.dark-theme .character-card {
    background: #333;
    box-shadow:
        3px 3px 6px #1a1a1a,
        -3px -3px 6px #2a2a2a;
}

.character-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.character-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: #444;
}

body.dark-theme .character-name {
    color: #eee;
}

.character-actions,
.scene-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.character-action-btn {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 6px;
    background: #e0e0e0;
    color: #444;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow:
        2px 2px 4px #bebebe,
        -2px -2px 4px #ffffff;
}

body.dark-theme .character-action-btn {
    background: #444;
    color: #eee;
    box-shadow:
        2px 2px 4px #1a1a1a,
        -2px -2px 4px #2a2a2a;
}

.character-preview-container {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    align-items: center;
}

.character-preview {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    background: #d0d0d0;
    box-shadow:
        3px 3px 6px #bebebe,
        -3px -3px 6px #ffffff;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.character-preview:hover {
    transform: scale(1.05);
}

body.dark-theme .character-preview {
    background: #444;
    box-shadow:
        3px 3px 6px #1a1a1a,
        -3px -3px 6px #2a2a2a;
}

.character-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.character-preview-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.9rem;
}

.character-references {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.character-reference-item {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    box-shadow:
        2px 2px 4px #bebebe,
        -2px -2px 4px #ffffff;
}

body.dark-theme .character-reference-item {
    box-shadow:
        2px 2px 4px #1a1a1a,
        -2px -2px 4px #2a2a2a;
}

.character-reference-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.character-description {
    width: 100%;
    min-height: 100px;
    resize: vertical;
}

.character-add-container {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
}

.button-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    margin-top: 1rem;
    align-items: center;
}

/* Frames */
.frames-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-gap: 1.5rem;
    margin-bottom: 0; /* Fixed bottom panel removed */
}

.frame-card {
    background: #e0e0e0;
    border-radius: 12px;
    box-shadow:
        3px 3px 6px #bebebe,
        -3px -3px 6px #ffffff;
    padding: 1rem;
    position: relative;
}

body.dark-theme .frame-card {
    background: #333;
    box-shadow:
        3px 3px 6px #1a1a1a,
        -3px -3px 6px #2a2a2a;
}

.frame-card h3 {
    margin-top: 0;
    color: #444;
}

body.dark-theme .frame-card h3 {
    color: #eee;
}

.frame-card img {
    width: 100%;
    display: block;
    border-radius: 6px;
    box-shadow:
        3px 3px 6px #bebebe,
        -3px -3px 6px #ffffff;
    cursor: pointer;
}

body.dark-theme .frame-card img {
    box-shadow:
        3px 3px 6px #1a1a1a,
        -3px -3px 6px #2a2a2a;
}

/* Frame Navigation */
.frame-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 0.5rem 0;
}

.frame-nav-btn {
    padding: 0.3rem 0.6rem;
    border: none;
    border-radius: 4px;
    background: #e0e0e0;
    color: #444;
    font-size: 1rem;
    cursor: pointer;
    box-shadow:
        2px 2px 4px #bebebe,
        -2px -2px 4px #ffffff;
    transition: all 0.2s ease;
}

body.dark-theme .frame-nav-btn {
    background: #444;
    color: #eee;
    box-shadow:
        2px 2px 4px #1a1a1a,
        -2px -2px 4px #2a2a2a;
}

.frame-nav-btn:hover {
    transform: scale(1.1);
}

.frame-version {
    font-size: 0.9rem;
    color: #666;
}

body.dark-theme .frame-version {
    color: #aaa;
}

/* Global Regeneration Panel - FIXED AT BOTTOM */
.global-regen-panel {
    display: none !important; /* Hide deprecated fixed panel */
}

body.dark-theme .global-regen-panel {
    background: #333;
    box-shadow:
        0px -8px 16px #1a1a1a,
        0px 8px 16px #2a2a2a;
}

.global-regen-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.global-regen-label {
    font-weight: 600;
    color: #444;
    font-size: 1rem;
}

body.dark-theme .global-regen-label {
    color: #eee;
}

/* Улучшенный глобальный переключатель */
.global-toggle-switch {
    position: relative;
    display: inline-block;
    width: 120px;
    height: 40px;
    margin: 0 1rem;
}

.global-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.global-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #8a8a8a, #a0a0a0);
    transition: all 0.4s ease;
    border-radius: 40px;
    box-shadow:
        4px 4px 8px #bebebe,
        -4px -4px 8px #ffffff;
}

body.dark-theme .global-toggle-slider {
    background: linear-gradient(135deg, #555, #666);
    box-shadow:
        4px 4px 8px #1a1a1a,
        -4px -4px 8px #2a2a2a;
}

.global-toggle-slider:before {
    position: absolute;
    content: "";
    height: 32px;
    width: 32px;
    left: 4px;
    bottom: 4px;
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
    transition: all 0.4s ease;
    border-radius: 50%;
    box-shadow:
        2px 2px 4px rgba(0,0,0,0.3),
        inset 1px 1px 2px rgba(255,255,255,0.8);
}

body.dark-theme .global-toggle-slider:before {
    background: linear-gradient(135deg, #ddd, #ccc);
}

/* UNCHECKED = Edit mode (серый) */
input:not(:checked) + .global-toggle-slider {
    background: linear-gradient(135deg, #8a8a8a, #a0a0a0);
}

input:not(:checked) + .global-toggle-slider:before {
    transform: translateX(0px);
}

/* CHECKED = New frame mode (фиолетовый) */
input:checked + .global-toggle-slider {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
}

input:checked + .global-toggle-slider:before {
    transform: translateX(84px);
}

body.dark-theme input:checked + .global-toggle-slider {
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
}

/* Индикаторы состояния */
.global-mode-indicators {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.mode-indicator {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.mode-indicator.edit {
    background: linear-gradient(135deg, #8a8a8a, #a0a0a0);
    color: white;
}

.mode-indicator.new {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
    color: white;
}

body.dark-theme .mode-indicator.edit {
    background: linear-gradient(135deg, #555, #666);
}

body.dark-theme .mode-indicator.new {
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
}

.mode-indicator.inactive {
    opacity: 0.4;
}

/* Project Title */
.project-title-container {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #e0e0e0;
    border-radius: 8px;
    box-shadow:
        inset 2px 2px 4px #bebebe,
        inset -2px -2px 4px #ffffff;
    margin-bottom: 1rem;
}

body.dark-theme .project-title-container {
    background: #333;
    box-shadow:
        inset 2px 2px 4px #1a1a1a,
        inset -2px -2px 4px #2a2a2a;
}

.project-title-text {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
}

body.dark-theme .project-title-text {
    color: #e0e0e0;
}

.project-title-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.2s ease;
}

.project-title-edit-btn:hover {
    color: #333;
    transform: scale(1.1);
}

body.dark-theme .project-title-edit-btn {
    color: #999;
}

body.dark-theme .project-title-edit-btn:hover {
    color: #e0e0e0;
}

.project-title-input {
    background: #f5f5f5;
    border: 2px solid #5ba4fc;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 1.1rem;
    font-weight: 600;
    outline: none;
    min-width: 200px;
}

body.dark-theme .project-title-input {
    background: #2a2a2a;
    color: #e0e0e0;
    border-color: #5ba4fc;
}

/* Projects */
.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-gap: 1rem;
    margin-top: 1.5rem;
}

.new-project-card {
    min-height: 250px;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #e6e6e6, #c3c3c3) !important;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px dashed #999;
}

.new-project-card:hover {
    transform: scale(1.05);
    border-color: #666;
    box-shadow: 
        8px 8px 16px #b5b5b5,
        -8px -8px 16px #ffffff !important;
}

body.dark-theme .new-project-card {
    background: linear-gradient(145deg, #3a3a3a, #2a2a2a) !important;
    border-color: #555;
}

body.dark-theme .new-project-card:hover {
    border-color: #888;
    box-shadow:
        8px 8px 16px #1a1a1a,
        -8px -8px 16px #3a3a3a !important;
}

.new-project-icon {
    margin-bottom: 1rem;
    color: #666;
}

body.dark-theme .new-project-icon {
    color: #aaa;
}

.new-project-card h3 {
    margin: 0.5rem 0;
    font-size: 1.2rem;
    color: #555;
}

body.dark-theme .new-project-card h3 {
    color: #ccc;
}

.new-project-card p {
    margin: 0;
    color: #888;
    font-size: 0.9rem;
}

body.dark-theme .new-project-card p {
    color: #999;
}

.project-title-with-edit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.project-title-text {
    font-weight: bold;
    font-size: 1.1rem;
    color: #333;
    flex: 1;
}

body.dark-theme .project-title-text {
    color: #e0e0e0;
}

.project-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.2s ease;
    border-radius: 4px;
    opacity: 0.6;
}

.project-edit-btn:hover {
    color: #333;
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

body.dark-theme .project-edit-btn {
    color: #999;
}

body.dark-theme .project-edit-btn:hover {
    color: #e0e0e0;
    background: rgba(255, 255, 255, 0.1);
}

.project-card {
    background: #e0e0e0;
    border-radius: 12px;
    box-shadow:
        3px 3px 6px #bebebe,
        -3px -3px 6px #ffffff;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.2s ease;
}

body.dark-theme .project-card {
    background: #333;
    box-shadow:
        3px 3px 6px #1a1a1a,
        -3px -3px 6px #2a2a2a;
}

.project-card:hover {
    transform: translateY(-3px);
    box-shadow:
        5px 5px 10px #bebebe,
        -5px -5px 10px #ffffff;
}

body.dark-theme .project-card:hover {
    box-shadow:
        5px 5px 10px #1a1a1a,
        -5px -5px 10px #2a2a2a;
}

.project-preview {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.8rem;
    background: #d0d0d0;
}

body.dark-theme .project-preview {
    background: #444;
}

.project-title {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #444;
}

body.dark-theme .project-title {
    color: #eee;
}

.project-date {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.8rem;
}

body.dark-theme .project-date {
    color: #aaa;
}

.project-actions {
    margin-top: auto;
}

.project-input-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Branding Logo Container */
#branding-logo-container {
    padding: 1rem;
    background: #e0e0e0;
    border-radius: 8px;
    box-shadow:
        inset 2px 2px 4px #bebebe,
        inset -2px -2px 4px #ffffff;
}

body.dark-theme #branding-logo-container {
    background: #333;
    box-shadow:
        inset 2px 2px 4px #1a1a1a,
        inset -2px -2px 4px #2a2a2a;
}

#branding-logo-preview {
    text-align: center;
}

#branding-logo-preview img {
    border-radius: 4px;
    box-shadow:
        2px 2px 4px #bebebe,
        -2px -2px 4px #ffffff;
}

body.dark-theme #branding-logo-preview img {
    box-shadow:
        2px 2px 4px #1a1a1a,
        -2px -2px 4px #2a2a2a;
}

/* Error Message */
#passwordError {
    margin-top: 1rem;
    color: #e74c3c !important;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
}

.modal-content {
    background: #e0e0e0;
    margin: 5% auto;
    padding: 20px;
    border-radius: 15px;
    box-shadow:
        8px 8px 16px #bebebe,
        -8px -8px 16px #ffffff;
    max-width: 90%;
    max-height: 90%;
    position: relative;
    overflow: auto;
}

body.dark-theme .modal-content {
    background: #333;
    box-shadow:
        8px 8px 16px #1a1a1a,
        -8px -8px 16px #2a2a2a;
    color: #eee;
}

/* Custom Style Panel (now a regular column) */
.custom-style-panel {
    animation: slideIn 0.3s ease-out;
    flex: 1;
    min-width: 200px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}


.style-references-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    min-height: 50px;
    padding: 15px;
    border-radius: 8px;
    background: rgba(255,255,255,0.5);
    border: 2px dashed #ccc;
    max-width: 100%;
    position: relative;
    overflow: visible;
}

body.dark-theme .style-references-preview {
    background: rgba(0,0,0,0.3);
    border-color: #555;
}

.style-ref-item {
    position: relative;
    width: 45px;
    height: 45px;
    border-radius: 6px;
    overflow: visible;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.style-ref-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.style-ref-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ff4444;
    color: white;
    border: 2px solid #fff;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.style-ref-remove:hover {
    background: #ff6666;
}

/* Improved attachment styling */
.attach-section {
    border-top: 1px solid #ccc;
    padding-top: 15px;
    margin-top: 15px;
}

body.dark-theme .attach-section {
    border-color: #555;
}

.instructions-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
    min-height: 50px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.3);
    border: 2px dashed #ddd;
    transition: all 0.3s ease;
    align-items: flex-start;
    align-content: flex-start;
}

body.dark-theme .instructions-attachments {
    background: rgba(0,0,0,0.3);
    border-color: #555;
}

.instructions-attachments:empty::before {
    content: "No materials attached yet";
    color: #999;
    font-style: italic;
    width: 100%;
    text-align: center;
    line-height: 20px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0f0f0;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    max-width: 280px;
    min-width: 120px;
    position: relative;
    flex-shrink: 0;
}

.attachment-item span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0; /* Important for text truncation */
}

body.dark-theme .attachment-item {
    background: #444;
    color: #eee;
}

.attachment-remove {
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    margin-left: auto;
}

.attachment-remove:hover {
    background: #ff6666;
}

.action-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: flex-start;
    padding-top: 15px;
    border-top: 1px solid #ddd;
    margin-top: 1rem;
    flex-wrap: nowrap;
}

.action-buttons-layout {
    margin-top: 1rem;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.action-buttons-row {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 10px;
}

.action-buttons-row:last-child {
    margin-bottom: 0;
}

.action-buttons .neo-button {
    flex: 0 0 auto;
    min-width: 110px;
    white-space: nowrap;
}

body.dark-theme .action-buttons {
    border-color: #555;
}

.close {
    position: absolute;
    top: 10px;
    right: 20px;
    color: #444;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

body.dark-theme .close {
    color: #eee;
}

#modalImage {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    margin: 0 auto;
}

/* Empty state messages */
.empty-projects-message,
.empty-characters-message {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
    font-style: italic;
}

body.dark-theme .empty-projects-message,
body.dark-theme .empty-characters-message {
    color: #aaa;
}

/* Loading spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #76a6f0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    /* REMOVED animation: spin to fix jerky animation */
    margin: 20px auto;
}

/* DELETED: @keyframes spin animation to fix jerky circular progress */

/* Validation styles */
.field-error {
    border: 2px solid #ff4444 !important;
    box-shadow:
        inset 3px 3px 6px #ff9999,
        inset -3px -3px 6px #ffffff !important;
}

body.dark-theme .field-error {
    box-shadow:
        inset 3px 3px 6px #aa0000,
        inset -3px -3px 6px #2a2a2a !important;
}

.error-message {
    color: #ff4444;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #ascii-art {
        font-size: 0.4em;
        line-height: 1;
    }

    .language-selector {
        position: static;
        margin-bottom: 1rem;
        justify-content: center;
    }

    #progress-panel {
        padding: 0.5rem;
    }

    .progress-bar {
        max-width: 100%;
    }

    .tab-btn {
        font-size: 0.9rem;
        padding: 0.6rem;
    }

    #thinking-face {
        font-size: 1.5rem;
    }

    .logo {
        width: 100px;
    }

    .params-row {
        flex-direction: column;
    }

    .frames-container {
        grid-template-columns: 1fr;
    }

    .password-input-container {
        flex-direction: column;
    }

    .character-preview-container {
        flex-direction: column;
    }

    .project-input-container,
    .character-add-container {
        flex-direction: column;
    }

    .global-regen-content {
        flex-direction: column;
        gap: 1rem;
    }

    .global-toggle-switch {
        width: 100px;
        height: 35px;
    }
}

/* ================================
   STORYBOARD TEMPLATES & PROGRESS
   ================================ */

/* Frame Templates */
.frame-template {
    background: #e0e0e0;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow:
        inset 2px 2px 4px #bebebe,
        inset -2px -2px 4px #ffffff;
    position: relative;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed #bbb;
    transition: all 0.3s ease;
}

body.dark-theme .frame-template {
    background: #333;
    box-shadow:
        inset 2px 2px 4px #1a1a1a,
        inset -2px -2px 4px #2a2a2a;
    border-color: #555;
}

.frame-template.generating {
    border-color: #6366f1;
    background: linear-gradient(135deg, #e0e0e0 0%, #f0f0f0 100%);
}

body.dark-theme .frame-template.generating {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, #333 0%, #444 100%);
}

.frame-template.completed {
    border: none;
    background: #fff;
    box-shadow:
        4px 4px 8px #bebebe,
        -4px -4px 8px #ffffff;
}

body.dark-theme .frame-template.completed {
    background: #2a2a2a;
    box-shadow:
        4px 4px 8px #1a1a1a,
        -4px -4px 8px #3a3a3a;
}

/* Neomorphism Progress Bar */
.neo-progress-container {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(145deg, #e0e0e0, #f0f0f0);
    box-shadow:
        20px 20px 40px #bebebe,
        -20px -20px 40px #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 1rem;
}

body.dark-theme .neo-progress-container {
    background: linear-gradient(145deg, #2a2a2a, #3a3a3a);
    box-shadow:
        20px 20px 40px #1a1a1a,
        -20px -20px 40px #4a4a4a;
}

.neo-progress-ring {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: linear-gradient(145deg, #f0f0f0, #e0e0e0);
    box-shadow:
        inset 8px 8px 16px #bebebe,
        inset -8px -8px 16px #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

body.dark-theme .neo-progress-ring {
    background: linear-gradient(145deg, #333, #222);
    box-shadow:
        inset 8px 8px 16px #1a1a1a,
        inset -8px -8px 16px #4a4a4a;
}

.neo-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        #6366f1 0deg,
        #8b5cf6 calc(var(--progress) * 3.6deg),
        transparent calc(var(--progress) * 3.6deg),
        transparent 360deg
    );
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* Animation will be added via JavaScript only during generation */
}

/* Spinning animation for progress indicators during generation */
.neo-progress-fill.spinning {
    background: conic-gradient(
        from 0deg,
        #6366f1 0deg,
        #8b5cf6 90deg,
        transparent 90deg,
        transparent 360deg
    ) !important;
    animation: spin-radar 2s linear infinite;
}

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

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


.neo-progress-text {
    position: absolute;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    z-index: 10;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

body.dark-theme .neo-progress-text {
    color: #eee;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.frame-template-header {
    text-align: center;
    margin-bottom: 1rem;
}

.frame-template-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

body.dark-theme .frame-template-title {
    color: #eee;
}

.frame-template-status {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
}

body.dark-theme .frame-template-status {
    color: #aaa;
}

.frame-template-status.generating {
    color: #6366f1;
    font-weight: 500;
}

body.dark-theme .frame-template-status.generating {
    color: #8b5cf6;
}

.frame-template-status.error {
    color: #ef4444;
    font-weight: 500;
}

.frame-template-status.completed {
    color: #10b981;
    font-weight: 500;
}

/* Frame Template Action Buttons */
.frame-template-actions {
    display: none;
    margin-top: 1rem;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

.frame-template.error .frame-template-actions {
    display: flex;
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.retry-frame-btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow:
        4px 4px 12px rgba(99, 102, 241, 0.3),
        -4px -4px 12px #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.retry-frame-btn::before {
    content: "🔄 ";
}

body.dark-theme .retry-frame-btn {
    box-shadow:
        4px 4px 8px #1a1a1a,
        -4px -4px 8px #4a4a4a;
}

.retry-frame-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        6px 6px 12px #bebebe,
        -6px -6px 12px #ffffff;
}

body.dark-theme .retry-frame-btn:hover {
    box-shadow:
        6px 6px 12px #1a1a1a,
        -6px -6px 12px #4a4a4a;
}

/* Retry Modal */
.retry-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
}

.retry-modal-content {
    background: #e0e0e0;
    padding: 2rem;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    box-shadow:
        20px 20px 40px #bebebe,
        -20px -20px 40px #ffffff;
    animation: slideInUp 0.3s ease-out;
}

body.dark-theme .retry-modal-content {
    background: #333;
    box-shadow:
        20px 20px 40px #1a1a1a,
        -20px -20px 40px #4a4a4a;
}

.retry-modal h3 {
    margin: 0 0 1rem 0;
    color: #333;
    font-size: 1.4rem;
    text-align: center;
}

body.dark-theme .retry-modal h3 {
    color: #eee;
}

.retry-modal p {
    margin: 0 0 1rem 0;
    color: #666;
    text-align: center;
}

body.dark-theme .retry-modal p {
    color: #aaa;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Frame Header with Delete Button */
.frame-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    position: relative;
}

.frame-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
}

body.dark-theme .frame-header h3 {
    color: #eee;
}

.delete-frame-btn {
    background: #ef4444;
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow:
        2px 2px 6px rgba(239, 68, 68, 0.3),
        -2px -2px 6px #ffffff;
    line-height: 1;
}

body.dark-theme .delete-frame-btn {
    box-shadow:
        2px 2px 6px rgba(239, 68, 68, 0.3),
        -2px -2px 6px #4a4a4a;
}

.delete-frame-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
    box-shadow:
        3px 3px 8px rgba(239, 68, 68, 0.4),
        -3px -3px 8px #ffffff;
}

body.dark-theme .delete-frame-btn:hover {
    box-shadow:
        3px 3px 8px rgba(239, 68, 68, 0.4),
        -3px -3px 8px #4a4a4a;
}

/* Add Frame Button */
.add-frame-template {
    background: #e0e0e0;
    border: 2px dashed #6366f1;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

body.dark-theme .add-frame-template {
    background: #333;
    border-color: #8b5cf6;
}

.add-frame-template:hover {
    border-color: #4f46e5;
    background: #f0f0f0;
    transform: translateY(-2px);
}

body.dark-theme .add-frame-template:hover {
    border-color: #7c3aed;
    background: #3a3a3a;
}

.add-frame-icon {
    font-size: 3rem;
    color: #6366f1;
    margin-bottom: 1rem;
}

body.dark-theme .add-frame-icon {
    color: #8b5cf6;
}

.add-frame-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
    text-align: center;
}

body.dark-theme .add-frame-text {
    color: #eee;
}

/* Frame Addition Modal */
.frame-add-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.frame-add-modal-content {
    background: #e0e0e0;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 20px;
    box-shadow:
        8px 8px 16px #bebebe,
        -8px -8px 16px #ffffff;
    max-width: 600px;
    position: relative;
}

body.dark-theme .frame-add-modal-content {
    background: #333;
    box-shadow:
        8px 8px 16px #1a1a1a,
        -8px -8px 16px #4a4a4a;
}

.frame-add-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.frame-add-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

body.dark-theme .frame-add-modal-header h2 {
    color: #e0e0e0;
}

.frame-add-modal-close {
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    box-shadow:
        2px 2px 4px #bebebe,
        -2px -2px 4px #ffffff;
}

body.dark-theme .frame-add-modal-close {
    background: #2a2a2a;
    color: #e0e0e0;
    box-shadow:
        2px 2px 4px #1a1a1a,
        -2px -2px 4px #3a3a3a;
}

.frame-add-modal-close:hover {
    background: #e8e8e8;
    box-shadow:
        inset 2px 2px 4px #bebebe,
        inset -2px -2px 4px #ffffff;
}

body.dark-theme .frame-add-modal-close:hover {
    background: #353535;
    box-shadow:
        inset 2px 2px 4px #1a1a1a,
        inset -2px -2px 4px #3a3a3a;
}

.frame-add-modal-subtitle {
    color: #666;
    margin-bottom: 1.5rem;
    text-align: center;
}

body.dark-theme .frame-add-modal-subtitle {
    color: #aaa;
}

.frame-add-option-content {
    flex: 1;
}

.frame-add-option-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #333;
}

body.dark-theme .frame-add-option-title {
    color: #e0e0e0;
}

.frame-add-option-desc {
    font-size: 0.9rem;
    color: #666;
    opacity: 0.8;
}

body.dark-theme .frame-add-option-desc {
    color: #aaa;
}

.frame-add-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.frame-add-option {
    background: #f0f0f0;
    border: none;
    border-radius: 15px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow:
        2px 2px 4px #bebebe,
        -2px -2px 4px #ffffff;
}

body.dark-theme .frame-add-option {
    background: #2a2a2a;
    box-shadow:
        2px 2px 4px #1a1a1a,
        -2px -2px 4px #3a3a3a;
    color: #eee;
}

.frame-add-option:hover {
    transform: translateY(-2px);
    box-shadow:
        4px 4px 8px #bebebe,
        -4px -4px 8px #ffffff;
}

body.dark-theme .frame-add-option:hover {
    box-shadow:
        4px 4px 8px #1a1a1a,
        -4px -4px 8px #3a3a3a;
}

.frame-add-option-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow:
        inset 1px 1px 2px #bebebe,
        inset -1px -1px 2px #ffffff;
}

body.dark-theme .frame-add-option-icon {
    background: #333;
    box-shadow:
        inset 1px 1px 2px #1a1a1a,
        inset -1px -1px 2px #4a4a4a;
}

.frame-add-option-icon svg {
    color: #666;
}

body.dark-theme .frame-add-option-icon svg {
    color: #aaa;
}

.frame-add-option-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.frame-add-option-desc {
    font-size: 0.85rem;
    color: #666;
}

body.dark-theme .frame-add-option-desc {
    color: #aaa;
}

/* Camera Presets */
.camera-presets-btn {
    background: #6366f1;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 0.5rem;
    width: 100%;
    box-shadow:
        4px 4px 8px #bebebe,
        -4px -4px 8px #ffffff;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

body.dark-theme .camera-presets-btn {
    box-shadow:
        4px 4px 8px #1a1a1a,
        -4px -4px 8px #4a4a4a;
}

.camera-presets-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        6px 6px 12px #bebebe,
        -6px -6px 12px #ffffff;
}

body.dark-theme .camera-presets-btn:hover {
    box-shadow:
        6px 6px 12px #1a1a1a,
        -6px -6px 12px #4a4a4a;
}

.camera-presets-modal {
    display: none;
    position: fixed;
    z-index: 1002;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.camera-presets-modal-content {
    background: #e0e0e0;
    margin: 3% auto;
    padding: 2rem;
    border-radius: 20px;
    box-shadow:
        20px 20px 40px #bebebe,
        -20px -20px 40px #ffffff;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

body.dark-theme .camera-presets-modal-content {
    background: #333;
    box-shadow:
        20px 20px 40px #1a1a1a,
        -20px -20px 40px #4a4a4a;
}

.camera-presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.camera-preset-item {
    background: #f0f0f0;
    border: none;
    border-radius: 15px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    box-shadow:
        4px 4px 8px #bebebe,
        -4px -4px 8px #ffffff;
}

body.dark-theme .camera-preset-item {
    background: #2a2a2a;
    box-shadow:
        4px 4px 8px #1a1a1a,
        -4px -4px 8px #3a3a3a;
    color: #eee;
}

.camera-preset-item:hover {
    transform: translateY(-3px);
    box-shadow:
        8px 8px 16px #bebebe,
        -8px -8px 16px #ffffff;
}

body.dark-theme .camera-preset-item:hover {
    box-shadow:
        8px 8px 16px #1a1a1a,
        -8px -8px 16px #3a3a3a;
}

.camera-preset-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #6366f1;
}

body.dark-theme .camera-preset-name {
    color: #8b5cf6;
}

.camera-preset-desc {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
}

body.dark-theme .camera-preset-desc {
    color: #aaa;
}

.camera-preset-tech {
    font-size: 0.75rem;
    color: #888;
    font-style: italic;
}

body.dark-theme .camera-preset-tech {
    color: #999;
}

    .global-toggle-slider:before {
        height: 27px;
        width: 27px;
        left: 4px;
        bottom: 4px;
    }

    input:checked + .global-toggle-slider:before {
        transform: translateX(69px);
    }

    .global-mode-indicators {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    #ascii-art {
        font-size: 0.25em;
    }

    .neo-button {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .tab-bar {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1 0 33%;
    }

    .global-regen-panel {
        padding: 1rem;
    }

    .global-toggle-switch {
        width: 90px;
        height: 32px;
    }

    .global-toggle-slider:before {
        height: 24px;
        width: 24px;
    }

    input:checked + .global-toggle-slider:before {
        transform: translateX(58px);
    }
}

/* Desktop specific optimizations */
@media (min-width: 1024px) {
    .global-regen-content {
        gap: 3rem;
    }

    .global-toggle-switch {
        width: 140px;
        height: 45px;
    }

    .global-toggle-slider:before {
        height: 37px;
        width: 37px;
        left: 4px;
        bottom: 4px;
    }

    input:checked + .global-toggle-slider:before {
        transform: translateX(99px);
    }
}

/* ============================================================================
   Frame Placeholders with Animated Progress
   ============================================================================ */

.frame-placeholder {
    position: relative;
    min-height: 400px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border: 2px dashed #ccc;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    margin: 1rem 0;
    transition: all 0.3s ease;
    cursor: pointer;
}

body.dark-theme .frame-placeholder {
    background: linear-gradient(135deg, #333 0%, #2a2a2a 100%);
    border-color: #555;
}

.frame-placeholder:hover {
    border-color: var(--primary-color, #007bff);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

body.dark-theme .frame-placeholder:hover {
    background: linear-gradient(135deg, #3a3a3a 0%, #333 100%);
    border-color: var(--primary-color, #007bff);
}

.frame-placeholder.generating {
    border-color: var(--primary-color, #007bff);
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
}

body.dark-theme .frame-placeholder.generating {
    background: linear-gradient(135deg, #1a2332 0%, #0f1419 100%);
}

/* Animated Circular Progress */
.progress-circle {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 1.5rem;
}

.progress-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

/* Вращающаяся анимация для круговой диаграммы во время генерации */
.progress-circle.spinning svg {
    animation: spin-smooth 4s linear infinite;
}

@keyframes spin-smooth {
    0% { transform: rotate(-90deg); }
    100% { transform: rotate(270deg); }
}

.progress-circle .progress-bg {
    fill: none;
    stroke: #e9ecef;
    stroke-width: 8;
}

body.dark-theme .progress-circle .progress-bg {
    stroke: #444;
}

.progress-circle .progress-bar {
    fill: none;
    stroke: var(--primary-color, #007bff);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283; /* 2 * π * 45 */
    stroke-dashoffset: 283;
    filter: drop-shadow(0 0 6px rgba(0, 123, 255, 0.3));
    /* SMOOTH CSS transition instead of keyframes for better control */
    transition: stroke-dashoffset 2.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Pure CSS progress animation - SMOOTH transitions for each progress level */
.progress-circle .progress-bar.progress-animating {
    stroke-dashoffset: 14; /* 95% progress - smooth transition */
    transition: stroke-dashoffset 60s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-circle .progress-bar.progress-to-25 {
    stroke-dashoffset: 212; /* 25% progress - smooth transition */
}

.progress-circle .progress-bar.progress-to-50 {
    stroke-dashoffset: 141; /* 50% progress - smooth transition */
}

.progress-circle .progress-bar.progress-to-75 {
    stroke-dashoffset: 71; /* 75% progress - smooth transition */
}

.progress-circle .progress-bar.progress-to-100 {
    stroke-dashoffset: 0; /* 100% progress - smooth transition */
    transition-duration: 1.5s; /* Slightly faster for final completion */
}

/* Keyframes removed - using smooth CSS transitions instead for better performance */

.progress-circle .progress-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: var(--primary-color, #007bff);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.8; }
}

.progress-circle .progress-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color, #007bff);
}

.placeholder-status {
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    color: #666;
    margin-bottom: 1rem;
}

body.dark-theme .placeholder-status {
    color: #ccc;
}

.placeholder-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1.5rem;
}

.placeholder-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 15px;
    background: #e0e0e0;
    color: #333;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 140px;
    justify-content: center;
    box-shadow:
        6px 6px 12px #bebebe,
        -6px -6px 12px #ffffff;
}

body.dark-theme .placeholder-btn {
    background: #333;
    color: #ccc;
    box-shadow:
        6px 6px 12px #1a1a1a,
        -6px -6px 12px #4a4a4a;
}

.placeholder-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        8px 8px 16px #bebebe,
        -8px -8px 16px #ffffff;
}

body.dark-theme .placeholder-btn:hover {
    box-shadow:
        8px 8px 16px #1a1a1a,
        -8px -8px 16px #4a4a4a;
}

.placeholder-btn.secondary {
    background: #f0f0f0;
}

body.dark-theme .placeholder-btn.secondary {
    background: #2a2a2a;
}

.placeholder-btn.success {
    background: #f0f0f0;
    color: #333;
    border: 2px solid #e0e0e0;
    box-shadow: 
        6px 6px 12px rgba(0, 0, 0, 0.1),
        -6px -6px 12px rgba(255, 255, 255, 0.9);
}

.placeholder-btn.success:hover {
    background: #e8e8e8;
    box-shadow:
        inset 3px 3px 6px rgba(0, 0, 0, 0.1),
        inset -3px -3px 6px rgba(255, 255, 255, 0.9);
    transform: translateY(1px);
}

body.dark-theme .placeholder-btn.success {
    background: #2a2a2a;
    color: #e0e0e0;
    border: 2px solid #404040;
    box-shadow:
        6px 6px 12px rgba(0, 0, 0, 0.3),
        -6px -6px 12px rgba(255, 255, 255, 0.05);
}

body.dark-theme .placeholder-btn.success:hover {
    background: #353535;
    box-shadow:
        inset 3px 3px 6px rgba(0, 0, 0, 0.3),
        inset -3px -3px 6px rgba(255, 255, 255, 0.05);
}

/* Frame Management Buttons */
.frame-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.frame-placeholder:hover .frame-controls,
.frame-item:hover .frame-controls {
    opacity: 1;
}

.frame-control-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.frame-control-btn:hover {
    background: var(--primary-color, #007bff);
    transform: scale(1.1);
}

.frame-control-btn.delete {
    background: rgba(220, 53, 69, 0.8);
}

.frame-control-btn.delete:hover {
    background: #dc3545;
}

/* Add Frame Button */
.add-frame-btn {
    min-height: 200px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 3px dashed #007bff;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 1rem 0;
    color: #007bff;
}

body.dark-theme .add-frame-btn {
    background: linear-gradient(135deg, #2a2a2a 0%, #333 100%);
    color: #58a6ff;
    border-color: #58a6ff;
}

.add-frame-btn:hover {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.15);
}

body.dark-theme .add-frame-btn:hover {
    background: linear-gradient(135deg, #1a2332 0%, #0f1419 100%);
}

.add-frame-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.add-frame-text {
    font-size: 1.2rem;
    font-weight: 600;
}

/* Camera Presets */
.camera-presets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.preset-btn {
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

body.dark-theme .preset-btn {
    background: #2a2a2a;
    border-color: #444;
    color: #ccc;
}

.preset-btn:hover {
    border-color: var(--primary-color, #007bff);
    background: #f8f9fa;
    transform: translateY(-2px);
}

body.dark-theme .preset-btn:hover {
    background: #333;
}

.preset-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color, #007bff);
}

.preset-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

body.dark-theme .preset-description {
    color: #aaa;
}

/* Drawing Canvas Modal */
.draw-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.draw-modal.active {
    display: flex;
}

.draw-content {
    background: #e0e0e0;
    border-radius: 20px;
    padding: 2rem;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow:
        20px 20px 40px #bebebe,
        -20px -20px 40px #ffffff;
    position: relative;
}

.draw-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.draw-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.draw-close {
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    color: #666;
    box-shadow:
        2px 2px 4px #bebebe,
        -2px -2px 4px #ffffff;
}

.draw-close:hover {
    background: #e8e8e8;
    color: #333;
    box-shadow:
        inset 2px 2px 4px #bebebe,
        inset -2px -2px 4px #ffffff;
}

body.dark-theme .draw-content {
    background: #333;
    color: #ccc;
    box-shadow:
        20px 20px 40px #1a1a1a,
        -20px -20px 40px #4a4a4a;
}

body.dark-theme .draw-header h3 {
    color: #e0e0e0;
}

body.dark-theme .draw-close {
    background: #2a2a2a;
    color: #e0e0e0;
    box-shadow:
        2px 2px 4px #1a1a1a,
        -2px -2px 4px #3a3a3a;
}

body.dark-theme .draw-close:hover {
    background: #353535;
    color: #fff;
    box-shadow:
        inset 2px 2px 4px #1a1a1a,
        inset -2px -2px 4px #3a3a3a;
}

.draw-canvas {
    border: none;
    border-radius: 12px;
    cursor: crosshair;
    background: white;
    width: 100%;
    max-width: 600px;
    height: 400px;
    box-shadow:
        inset 4px 4px 8px #bebebe,
        inset -4px -4px 8px #ffffff;
}

body.dark-theme .draw-canvas {
    background: #2a2a2a;
    box-shadow:
        inset 4px 4px 8px #1a1a1a,
        inset -4px -4px 8px #3a3a3a;
}

.draw-tools {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
    align-items: center;
}

.tool-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tool-btn {
    padding: 0.75rem 1.25rem;
    border: none;
    background: #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow:
        4px 4px 8px #bebebe,
        -4px -4px 8px #ffffff;
    color: #333;
}

body.dark-theme .tool-btn {
    background: #333;
    color: #ccc;
    box-shadow:
        4px 4px 8px #1a1a1a,
        -4px -4px 8px #4a4a4a;
}

.tool-btn.active,
.tool-btn:hover {
    background: #6366f1;
    color: white;
    transform: translateY(-1px);
    box-shadow:
        6px 6px 12px rgba(99, 102, 241, 0.3),
        -6px -6px 12px #ffffff;
}

body.dark-theme .tool-btn.active,
body.dark-theme .tool-btn:hover {
    background: #8b5cf6;
    box-shadow:
        6px 6px 12px rgba(139, 92, 246, 0.3),
        -6px -6px 12px #4a4a4a;
}

.brush-size {
    width: 100px;
    margin: 0 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .placeholder-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .placeholder-btn {
        width: 100%;
        max-width: 250px;
    }
    
    .camera-presets {
        grid-template-columns: 1fr;
    }
    
    .draw-content {
        width: 95%;
        padding: 1rem;
    }
    
    .draw-tools {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tool-group {
        justify-content: center;
    }
}

/* Scenes Frames Styling */
.scenes-frames-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.scene-frame {
    background: #e0e0e0;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 
        inset 4px 4px 8px #bebebe,
        inset -4px -4px 8px #ffffff;
    position: relative;
    transition: all 0.3s ease;
}

body.dark-theme .scene-frame {
    background: #333;
    box-shadow: 
        inset 4px 4px 8px #1a1a1a,
        inset -4px -4px 8px #4a4a4a;
}

.scene-frame-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.scene-frame-title {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    margin: 0;
}

body.dark-theme .scene-frame-title {
    color: #eee;
}

.scene-frame-delete {
    background: #e0e0e0;
    border: none;
    border-radius: 8px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 
        3px 3px 6px #bebebe,
        -3px -3px 6px #ffffff;
}

.scene-frame-delete:hover {
    color: #e74c3c;
    transform: translateY(-1px);
    box-shadow: 
        4px 4px 8px #bebebe,
        -4px -4px 8px #ffffff;
}

body.dark-theme .scene-frame-delete {
    background: #333;
    color: #aaa;
    box-shadow: 
        3px 3px 6px #1a1a1a,
        -3px -3px 6px #4a4a4a;
}

body.dark-theme .scene-frame-delete:hover {
    color: #e74c3c;
    box-shadow: 
        4px 4px 8px #1a1a1a,
        -4px -4px 8px #4a4a4a;
}

.scene-frame-textarea {
    width: 100%;
    min-height: 100px;
    resize: vertical;
    background: rgba(255,255,255,0.7);
    border: none;
    border-radius: 10px;
    padding: 15px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    box-shadow: 
        inset 2px 2px 4px rgba(190, 190, 190, 0.5),
        inset -2px -2px 4px rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.scene-frame-textarea:focus {
    outline: none;
    box-shadow: 
        inset 3px 3px 6px rgba(190, 190, 190, 0.7),
        inset -3px -3px 6px rgba(255, 255, 255, 0.7);
}

body.dark-theme .scene-frame-textarea {
    background: rgba(0,0,0,0.3);
    color: #eee;
    box-shadow: 
        inset 2px 2px 4px rgba(26, 26, 26, 0.8),
        inset -2px -2px 4px rgba(74, 74, 74, 0.3);
}

body.dark-theme .scene-frame-textarea:focus {
    box-shadow: 
        inset 3px 3px 6px rgba(26, 26, 26, 0.9),
        inset -3px -3px 6px rgba(74, 74, 74, 0.4);
}

.scenes-actions {
    text-align: center;
    margin-bottom: 20px;
}
}
