/* =========================================================================
   MARKETING STUDIO UI
   Matching Asset Forge / Style Studio Aesthetic
   ========================================================================= */

.marketing-container {
    /* Style Studio Palette */
    --marketing-bg: #1d1a15;
    --marketing-panel: #2D2A32;
    --marketing-primary: #D0BB95;
    --marketing-primary-hover: #D6683F;
    --marketing-text: #ffffff;
    --marketing-text-muted: #a0a0a0;
    --marketing-border: rgba(255, 255, 255, 0.05);

    /* Layout */
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 30px;
    box-sizing: border-box;
    background-color: var(--marketing-bg);
    color: var(--marketing-text);
}

/* Header Section */
.marketing-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-shrink: 0;
    margin-bottom: 5px;
}

.marketing-title-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.marketing-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.marketing-main-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--marketing-text);
    letter-spacing: -0.025em;
}

@media (min-width: 768px) {
    .marketing-main-title {
        font-size: 3rem;
    }
}

.marketing-beta-badge {
    padding: 2px 8px;
    background: rgba(208, 187, 149, 0.1);
    color: var(--marketing-primary);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1px solid rgba(208, 187, 149, 0.2);
    border-radius: 6px;
}

.marketing-subtitle {
    margin: 0;
    color: var(--marketing-text-muted);
    font-size: 0.9rem;
}

/* Type Selection - Step 1 */
.marketing-type-selection {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding: 40px 20px;
}

.type-selection-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--marketing-text);
    margin: 0;
    text-align: center;
}

.type-cards {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
}

.type-card-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.type-card {
    width: 280px;
    background: var(--marketing-panel);
    border: 1px solid var(--marketing-border);
    border-radius: 20px;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.type-card:hover:not(.coming-soon) {
    border-color: var(--marketing-primary);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.type-card.coming-soon {
    opacity: 0.6;
    cursor: not-allowed;
}

.type-card-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: rgba(208, 187, 149, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.type-card-icon span {
    font-size: 32px;
    color: var(--marketing-primary);
}

.type-card h4 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--marketing-text);
}

.type-card p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--marketing-text-muted);
    line-height: 1.5;
}

.type-card-footer {
    margin-top: auto;
    padding-top: 8px;
}

.type-card-footer span {
    font-size: 24px;
    color: var(--marketing-primary);
    opacity: 0;
    transform: translateX(-8px);
    transition: all 0.2s;
}

.type-card:hover:not(.coming-soon) .type-card-footer span {
    opacity: 1;
    transform: translateX(0);
}

.type-coming-soon-label {
    font-size: 0.65rem;
    color: var(--marketing-primary);
    position: absolute;
    bottom: -20px;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* Options Panel - Step 2 */
.marketing-options-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.options-panel-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.options-panel-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--marketing-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.marketing-back-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--marketing-border);
    background: var(--marketing-panel);
    color: var(--marketing-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.marketing-back-btn:hover {
    border-color: var(--marketing-primary);
    color: var(--marketing-primary);
    background: rgba(208, 187, 149, 0.1);
}

.panel-coming-soon-badge {
    margin-left: auto;
    padding: 6px 12px;
    background: rgba(208, 187, 149, 0.1);
    color: var(--marketing-primary);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1px solid rgba(208, 187, 149, 0.2);
    border-radius: 6px;
}

/* Options Grid */
.marketing-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.marketing-option-card {
    background: var(--marketing-panel);
    border: 1px solid var(--marketing-border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.marketing-option-card:hover:not(.disabled) {
    border-color: var(--marketing-primary);
    background: rgba(208, 187, 149, 0.05);
    transform: translateX(4px);
}

.marketing-option-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.option-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(208, 187, 149, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.option-icon span {
    font-size: 24px;
    color: var(--marketing-primary);
}

.steam-icon {
    width: 24px;
    height: 24px;
    display: inline-block;
    vertical-align: middle;
}

.option-content {
    flex: 1;
    overflow: hidden;
}

.option-content h4 {
    margin: 0 0 4px 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--marketing-text);
}

.option-content p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--marketing-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.option-arrow {
    color: var(--marketing-primary);
    opacity: 0;
    transform: translateX(-8px);
    transition: all 0.2s;
}

.marketing-option-card:hover:not(.disabled) .option-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* =========================================================================
   STEAM CAPSULES PANEL
   ========================================================================= */

.marketing-capsules-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.3s ease;
}

.capsules-panel-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.capsules-panel-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--marketing-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Configuration Section */
.capsule-config-section {
    background: var(--marketing-panel);
    border: 1px solid var(--marketing-border);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.config-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

@media (max-width: 900px) {
    .config-row {
        grid-template-columns: 1fr;
    }
}

.config-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.config-block label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--marketing-text-muted);
    letter-spacing: 0.05em;
}

.optional-tag {
    font-weight: 400;
    text-transform: none;
    opacity: 0.6;
}

.config-hint {
    margin: 0;
    font-size: 0.75rem;
    color: var(--marketing-text-muted);
    opacity: 0.7;
}

.config-hint.steam-warning {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 6px;
    color: #ffc107;
    opacity: 1;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Creative Reinvention Toggle */
.creative-toggle-wrapper {
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--marketing-border);
    border-radius: 12px;
}

.creative-toggle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.toggle-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--marketing-text);
}

/* The Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--marketing-border);
    border-radius: 28px;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: var(--marketing-text-muted);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-switch input:checked+.toggle-slider {
    background: linear-gradient(135deg, var(--marketing-primary), var(--marketing-primary-hover));
    border-color: var(--marketing-primary);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(24px);
    background: white;
}

.toggle-description {
    margin: 0;
    padding: 8px;
    background: rgba(208, 187, 149, 0.1);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.toggle-description.off {
    background: rgba(255, 255, 255, 0.05);
    color: var(--marketing-text-muted);
}

/* Kit Style Section */
.kit-style-section {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 12px;
}

.kit-style-section label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--marketing-text);
    margin-bottom: 6px;
}

.kit-style-section .select-wrapper {
    position: relative;
    width: 100%;
}

.kit-style-section select {
    width: 100%;
    padding: 10px 36px 10px 12px;
    font-size: 0.9rem;
    font-family: inherit;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--marketing-border);
    border-radius: 8px;
    color: var(--marketing-text);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: all 0.2s ease;
}

.kit-style-section select:hover {
    border-color: var(--marketing-primary);
    background: rgba(0, 0, 0, 0.5);
}

.kit-style-section select:focus {
    outline: none;
    border-color: var(--marketing-primary);
    box-shadow: 0 0 0 2px rgba(208, 187, 149, 0.15);
}

.kit-style-section select option {
    background: #2a2a2a;
    color: var(--marketing-text);
    padding: 10px;
}

.kit-style-section select optgroup {
    background: #1a1a1a;
    color: var(--marketing-text-muted);
    font-weight: 700;
    font-style: normal;
}

.kit-style-section .select-arrow {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--marketing-text-muted);
    pointer-events: none;
    font-size: 20px;
}

.kit-style-section .config-hint {
    margin: 6px 0 0;
    font-size: 0.7rem;
    color: var(--marketing-text-muted);
    opacity: 0.7;
}

/* Asset Picker */
.asset-picker {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    min-height: 80px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed var(--marketing-border);
    border-radius: 12px;
}

.asset-add-btn {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    border: 2px dashed var(--marketing-border);
    background: transparent;
    color: var(--marketing-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.asset-add-btn:hover {
    border-color: var(--marketing-primary);
    color: var(--marketing-primary);
    background: rgba(208, 187, 149, 0.1);
}

.asset-add-btn span {
    font-size: 28px;
}

.selected-asset {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 2px solid var(--marketing-border);
    transition: all 0.2s;
}

.selected-asset img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.selected-asset:hover {
    border-color: var(--marketing-primary);
}

.selected-asset .remove-asset {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff4757;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s;
}

.selected-asset:hover .remove-asset {
    opacity: 1;
}

/* Style Dropdown & Input */
.capsule-config-section .select-wrapper {
    position: relative;
}

.capsule-config-section select {
    width: 100%;
    background: var(--marketing-bg);
    border: 1px solid var(--marketing-border);
    border-radius: 10px;
    padding: 12px 40px 12px 16px;
    color: var(--marketing-text);
    font-family: inherit;
    font-size: 0.9rem;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s;
}

.capsule-config-section select:focus {
    outline: none;
    border-color: var(--marketing-primary);
    box-shadow: 0 0 0 2px rgba(208, 187, 149, 0.2);
}

.capsule-config-section .select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--marketing-text-muted);
    pointer-events: none;
}

.capsule-config-section input[type="text"] {
    width: 100%;
    background: var(--marketing-bg);
    border: 1px solid var(--marketing-border);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--marketing-text);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s;
    box-sizing: border-box;
}

.capsule-config-section input[type="text"]:focus {
    outline: none;
    border-color: var(--marketing-primary);
    box-shadow: 0 0 0 2px rgba(208, 187, 149, 0.2);
}

.capsule-config-section input[type="text"]::placeholder {
    color: var(--marketing-text-muted);
    opacity: 0.6;
}

.capsule-config-section textarea {
    width: 100%;
    background: var(--marketing-bg);
    border: 1px solid var(--marketing-border);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--marketing-text);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s;
    box-sizing: border-box;
    resize: vertical;
    min-height: 60px;
}

.capsule-config-section textarea:focus {
    outline: none;
    border-color: var(--marketing-primary);
    box-shadow: 0 0 0 2px rgba(208, 187, 149, 0.2);
}

.capsule-config-section textarea::placeholder {
    color: var(--marketing-text-muted);
    opacity: 0.6;
}

/* Generate Button */
.capsule-generate-btn {
    padding: 16px 32px;
    background: var(--marketing-primary);
    border: none;
    border-radius: 12px;
    color: #1d1a15;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
    align-self: center;
}

.capsule-generate-btn:hover {
    background: var(--marketing-primary-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.capsule-generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Results Section */
.capsule-results-section {
    background: var(--marketing-panel);
    border: 1px solid var(--marketing-border);
    border-radius: 20px;
    padding: 24px;
    animation: fadeIn 0.3s ease;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.results-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--marketing-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.regenerate-all-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--marketing-border);
    border-radius: 8px;
    color: var(--marketing-text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.regenerate-all-btn:hover {
    border-color: var(--marketing-primary);
    color: var(--marketing-primary);
    background: rgba(208, 187, 149, 0.1);
}

/* Capsule Results Grid */
.capsule-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.capsule-result-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--marketing-border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.2s;
}

.capsule-result-card:hover {
    border-color: var(--marketing-primary);
}

.capsule-result-card.wide {
    grid-column: span 2;
}

@media (max-width: 700px) {
    .capsule-result-card.wide {
        grid-column: span 1;
    }
}

.capsule-preview {
    aspect-ratio: 16/9;
    background: var(--marketing-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

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

/* Vertical capsule has portrait aspect ratio */
.capsule-result-card[data-type="vertical"] .capsule-preview {
    aspect-ratio: 374/448;
}

.capsule-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--marketing-text-muted);
    opacity: 0.4;
}

.capsule-placeholder span {
    font-size: 48px;
}

.capsule-info {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.capsule-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--marketing-text);
}

.capsule-size {
    font-size: 0.75rem;
    color: var(--marketing-text-muted);
    font-family: monospace;
}

.capsule-actions {
    padding: 0 16px 12px;
    display: flex;
    gap: 8px;
}

.capsule-action-btn {
    flex: 1;
    padding: 8px;
    background: transparent;
    border: 1px solid var(--marketing-border);
    border-radius: 8px;
    color: var(--marketing-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.capsule-action-btn:hover {
    border-color: var(--marketing-primary);
    color: var(--marketing-primary);
    background: rgba(208, 187, 149, 0.1);
}

.capsule-action-btn span {
    font-size: 18px;
}

/* Loading state for capsule preview */
.capsule-preview.loading {
    position: relative;
}

.capsule-preview.loading::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid var(--marketing-border);
    border-top-color: var(--marketing-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Rotating icon for buttons */
.rotating {
    animation: spin 1s linear infinite;
}

/* Error state for placeholders */
.capsule-placeholder.error {
    color: #ff4757;
    opacity: 0.7;
}

.capsule-placeholder.error small {
    display: block;
    font-size: 0.7rem;
    margin-top: 4px;
}

/* Retry button for failed capsules */
.capsule-retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    padding: 6px 12px;
    background: rgba(255, 71, 87, 0.15);
    border: 1px solid rgba(255, 71, 87, 0.3);
    border-radius: 6px;
    color: #ff4757;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.capsule-retry-btn:hover {
    background: rgba(255, 71, 87, 0.25);
    border-color: #ff4757;
    transform: scale(1.02);
}

.capsule-retry-btn span {
    font-size: 14px;
}

/* Disabled generate button */
.capsule-generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* =========================================================================
   ASSET SELECTION MODAL
   ========================================================================= */

.asset-selection-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.asset-modal-content {
    background: var(--marketing-panel);
    border: 1px solid var(--marketing-border);
    border-radius: 20px;
    width: 100%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.asset-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--marketing-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.asset-modal-header h4 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--marketing-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.asset-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--marketing-border);
    background: transparent;
    color: var(--marketing-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.asset-modal-close:hover {
    border-color: #ff4757;
    color: #ff4757;
    background: rgba(255, 71, 87, 0.1);
}

.asset-modal-grid {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.asset-modal-item {
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--marketing-border);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.asset-modal-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.asset-modal-item:hover {
    border-color: var(--marketing-primary);
}

.asset-modal-item.selected {
    border-color: var(--marketing-primary);
    box-shadow: 0 0 0 2px rgba(208, 187, 149, 0.3);
}

.asset-modal-item.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: var(--marketing-primary);
    color: #1d1a15;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.asset-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--marketing-border);
    display: flex;
    justify-content: flex-end;
}

.asset-modal-confirm {
    padding: 12px 24px;
    background: var(--marketing-primary);
    border: none;
    border-radius: 10px;
    color: #1d1a15;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.asset-modal-confirm:hover {
    background: var(--marketing-primary-hover);
    color: white;
}

/* =========================================================================
   EDIT CAPSULE MODAL
   ========================================================================= */

.capsule-edit-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.edit-modal-content {
    background: var(--marketing-panel);
    border: 1px solid var(--marketing-border);
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
}

.edit-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--marketing-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.edit-modal-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--marketing-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.edit-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--marketing-border);
    background: transparent;
    color: var(--marketing-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.edit-modal-close:hover {
    border-color: #ff4757;
    color: #ff4757;
}

.edit-modal-body {
    padding: 24px;
}

.edit-modal-body label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--marketing-text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.edit-modal-body textarea {
    width: 100%;
    background: var(--marketing-bg);
    border: 1px solid var(--marketing-border);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--marketing-text);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    box-sizing: border-box;
}

.edit-modal-body textarea:focus {
    outline: none;
    border-color: var(--marketing-primary);
}

.edit-modal-body textarea::placeholder {
    color: var(--marketing-text-muted);
    opacity: 0.6;
}

.edit-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--marketing-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.edit-modal-cancel {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--marketing-border);
    border-radius: 8px;
    color: var(--marketing-text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.edit-modal-cancel:hover {
    border-color: var(--marketing-text);
    color: var(--marketing-text);
}

.edit-modal-regenerate {
    padding: 10px 20px;
    background: var(--marketing-primary) !important;
    border: none;
    border-radius: 8px;
    color: #1d1a15 !important;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.edit-modal-regenerate:hover {
    background: var(--marketing-primary-hover) !important;
    color: white !important;
    transform: none;
    box-shadow: none;
}

/* =========================================================================
   FULLSCREEN CAPSULE PREVIEW MODAL
   ========================================================================= */

.capsule-fullscreen-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    animation: fadeIn 0.2s ease;
}

.capsule-fullscreen-modal.active {
    display: flex;
}

.fullscreen-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10001;
}

.fullscreen-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--marketing-primary);
    color: var(--marketing-primary);
}

.fullscreen-close span {
    font-size: 28px;
}

.fullscreen-content {
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.fullscreen-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.fullscreen-info {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: white;
}

#fullscreen-capsule-name {
    font-size: 1.1rem;
    font-weight: 700;
}

#fullscreen-capsule-size {
    font-size: 0.85rem;
    color: var(--marketing-text-muted);
    font-family: monospace;
}

/* Make capsule preview clickable */
.capsule-preview {
    cursor: pointer;
}

.capsule-preview:hover img {
    opacity: 0.9;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* =========================================================================
   MARKETING ASSET KIT PANEL
   ========================================================================= */

.marketing-asset-kit-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.3s ease;
}

.asset-kit-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.asset-kit-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--marketing-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Asset Kit Configuration */
.asset-kit-config {
    background: var(--marketing-panel);
    border: 1px solid var(--marketing-border);
    border-radius: 20px;
    padding: 24px;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .asset-kit-config {
        grid-template-columns: 1fr;
    }
}

/* Key Art Picker */
.keyart-picker {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    min-height: 100px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed var(--marketing-border);
    border-radius: 12px;
}

.keyart-select-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100px;
    height: 80px;
    border-radius: 12px;
    border: 2px dashed var(--marketing-border);
    background: transparent;
    color: var(--marketing-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.keyart-select-btn:hover {
    border-color: var(--marketing-primary);
    color: var(--marketing-primary);
    background: rgba(208, 187, 149, 0.1);
}

.keyart-select-btn span:first-child {
    font-size: 28px;
}

.keyart-select-btn span:last-child {
    font-size: 0.75rem;
    font-weight: 600;
}

.selected-keyart {
    width: 100px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 2px solid var(--marketing-primary);
}

.selected-keyart img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.selected-keyart .remove-keyart {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ff4757;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s;
}

.selected-keyart:hover .remove-keyart {
    opacity: 1;
}

/* Asset Selection Row - side by side layout */
.asset-selection-row {
    display: flex;
    gap: 24px;
}

.asset-selection-row .config-block {
    flex: 1;
    min-width: 0;
}

/* Logo Picker - same styles as keyart */
.logo-picker {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    min-height: 80px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed var(--marketing-border);
    border-radius: 12px;
}

.logo-select-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 80px;
    height: 60px;
    border-radius: 12px;
    border: 2px dashed var(--marketing-border);
    background: transparent;
    color: var(--marketing-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.logo-select-btn:hover {
    border-color: var(--marketing-primary);
    color: var(--marketing-primary);
    background: rgba(208, 187, 149, 0.1);
}

.logo-select-btn span:first-child {
    font-size: 24px;
}

.logo-select-btn span:last-child {
    font-size: 0.7rem;
    font-weight: 600;
}

.selected-logo {
    width: 80px;
    height: 60px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 2px solid var(--marketing-primary);
}

.selected-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.3);
}

.selected-logo .remove-logo {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff4757;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s;
}

.selected-logo:hover .remove-logo {
    opacity: 1;
}

/* Mode hint */
.config-hint.mode-hint {
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(208, 187, 149, 0.1);
    border-radius: 8px;
    font-size: 0.8rem;
}

/* Template mode selector */
.template-mode-selector {
    display: flex;
    border-top: 1px solid var(--marketing-border);
}

.template-mode-btn {
    flex: 1;
    padding: 8px 4px;
    background: transparent;
    border: none;
    border-right: 1px solid var(--marketing-border);
    color: var(--marketing-text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.template-mode-btn:last-child {
    border-right: none;
}

.template-mode-btn:hover {
    background: rgba(208, 187, 149, 0.1);
    color: var(--marketing-text);
}

.template-mode-btn.active {
    background: rgba(208, 187, 149, 0.2);
    color: var(--marketing-primary);
}

.template-mode-btn .material-symbols-outlined {
    font-size: 16px;
}


/* Template Upload Zone */
.template-upload-block {
    flex: 1;
}

.template-upload-zone {
    min-height: 120px;
    padding: 24px;
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed var(--marketing-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.template-upload-zone:hover,
.template-upload-zone.dragover {
    border-color: var(--marketing-primary);
    background: rgba(208, 187, 149, 0.1);
}

.template-upload-zone span.material-symbols-outlined {
    font-size: 40px;
    color: var(--marketing-primary);
}

.template-upload-zone p {
    margin: 0;
    color: var(--marketing-text);
    font-weight: 600;
}

.template-upload-zone .upload-hint {
    font-size: 0.8rem;
    color: var(--marketing-text-muted);
}

/* Templates Section */
.templates-section {
    background: var(--marketing-panel);
    border: 1px solid var(--marketing-border);
    border-radius: 20px;
    padding: 24px;
}

.templates-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.templates-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--marketing-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.template-count {
    background: var(--marketing-primary);
    color: #1d1a15;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
}

.clear-templates-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--marketing-border);
    border-radius: 8px;
    color: var(--marketing-text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-templates-btn:hover {
    border-color: #ff4757;
    color: #ff4757;
    background: rgba(255, 71, 87, 0.1);
}

/* Templates Grid */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.template-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--marketing-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
}

.template-card:hover {
    border-color: var(--marketing-primary);
}

.template-preview {
    aspect-ratio: 16/10;
    background: var(--marketing-bg);
    position: relative;
    overflow: hidden;
}

.template-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.template-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
}

.template-card:hover .template-remove-btn {
    opacity: 1;
}

.template-remove-btn:hover {
    background: #ff4757;
}

.template-info {
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--marketing-border);
}

.template-dimensions {
    font-size: 0.85rem;
    color: var(--marketing-text);
    font-family: monospace;
}

.template-ratio {
    font-size: 0.75rem;
    color: var(--marketing-primary);
    background: rgba(208, 187, 149, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
}

.template-generate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    background: rgba(208, 187, 149, 0.1);
    border: none;
    border-top: 1px solid var(--marketing-border);
    color: var(--marketing-primary);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.template-generate-btn:hover:not(:disabled) {
    background: var(--marketing-primary);
    color: #1d1a15;
}

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

/* Loading overlay */
.template-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--marketing-primary);
    z-index: 10;
}

.template-loading-overlay span:first-child {
    font-size: 32px;
}

.template-loading-overlay span:last-child {
    font-size: 0.85rem;
    font-weight: 600;
}

/* Error overlay */
.template-error-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 71, 87, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #ff4757;
    z-index: 10;
}

.template-error-overlay .material-symbols-outlined {
    font-size: 32px;
}

/* Generated badge */
.template-ratio.generated-badge {
    background: rgba(46, 213, 115, 0.2);
    color: #2ed573;
}

/* Template preview result-ready (clickable) */
.template-preview.result-ready {
    cursor: pointer;
}

.template-preview.result-ready:hover img {
    opacity: 0.9;
}

/* Action buttons row for generated templates */
.template-actions {
    display: flex;
    border-top: 1px solid var(--marketing-border);
}

.template-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px;
    background: transparent;
    border: none;
    border-right: 1px solid var(--marketing-border);
    color: var(--marketing-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.template-action-btn:last-child {
    border-right: none;
}

.template-action-btn:hover {
    background: rgba(208, 187, 149, 0.1);
    color: var(--marketing-primary);
}

.template-generate-btn.retry {
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
}

.template-generate-btn.retry:hover {
    background: rgba(255, 71, 87, 0.2);
}


/* Generate All Button */
.asset-kit-generate-all-btn {
    padding: 16px 32px;
    background: var(--marketing-primary);
    border: none;
    border-radius: 12px;
    color: #1d1a15;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
    align-self: center;
}

.asset-kit-generate-all-btn:hover:not(:disabled) {
    background: var(--marketing-primary-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.asset-kit-generate-all-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Credit Cost Badge */
.credit-cost {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
}

.credit-cost .material-symbols-outlined {
    font-size: 14px;
    color: white;
}

/* Credit cost on Generate All button - more visible */
.asset-kit-generate-all-btn .credit-cost {
    background: rgba(0, 0, 0, 0.6);
    color: white;
}

/* Credit cost on template generate button - visible on hover */
.template-generate-btn .credit-cost {
    background: rgba(0, 0, 0, 0.4);
    color: white;
}

.template-generate-btn:hover:not(:disabled) .credit-cost {
    background: rgba(0, 0, 0, 0.6);
    color: white;
}

/* Asset Kit Results */
.asset-kit-results-section {
    background: var(--marketing-panel);
    border: 1px solid var(--marketing-border);
    border-radius: 20px;
    padding: 24px;
    animation: fadeIn 0.3s ease;
}

.asset-kit-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.asset-kit-result-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--marketing-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
}

.asset-kit-result-card:hover {
    border-color: var(--marketing-primary);
}

.result-preview {
    aspect-ratio: 16/10;
    background: var(--marketing-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.result-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.result-preview.loading {
    background: linear-gradient(135deg, var(--marketing-bg), var(--marketing-panel));
}

.result-preview.error {
    background: rgba(255, 71, 87, 0.1);
}

.result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--marketing-text-muted);
}

.result-placeholder .material-symbols-outlined {
    font-size: 32px;
}

.result-info {
    padding: 12px;
    display: flex;
    justify-content: center;
    border-top: 1px solid var(--marketing-border);
}

.result-dimensions {
    font-size: 0.85rem;
    color: var(--marketing-text-muted);
    font-family: monospace;
}

.result-actions {
    display: flex;
    border-top: 1px solid var(--marketing-border);
}

.result-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px;
    background: transparent;
    border: none;
    border-right: 1px solid var(--marketing-border);
    color: var(--marketing-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.result-action-btn:last-child {
    border-right: none;
}

.result-action-btn:hover {
    background: rgba(208, 187, 149, 0.1);
    color: var(--marketing-primary);
}

.result-action-btn.retry {
    color: var(--marketing-primary);
    font-weight: 600;
    font-size: 0.85rem;
}

/* Asset Kit Fullscreen Modal */
.asset-kit-fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 10000;
    padding: 60px 80px;
    box-sizing: border-box;
}

.asset-kit-fullscreen-modal.active {
    display: flex;
}

.fullscreen-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10001;
}

.fullscreen-nav-arrow:hover {
    background: rgba(208, 187, 149, 0.3);
    border-color: var(--marketing-primary);
}

.fullscreen-nav-arrow.left {
    left: 20px;
}

.fullscreen-nav-arrow.right {
    right: 20px;
}

.fullscreen-nav-arrow .material-symbols-outlined {
    font-size: 28px;
}

#fullscreen-kit-index {
    font-size: 0.9rem;
    font-weight: 600;
}

#fullscreen-kit-size {
    font-size: 0.85rem;
    color: var(--marketing-text-muted);
    font-family: monospace;
}

/* Rotating animation for loading */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.rotating {
    animation: rotate 1s linear infinite;
}

/* =========================================================================
   MARKETING ASSET KIT - SIMPLIFIED UI
   ========================================================================= */

.marketing-asset-kit-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.3s ease;
}

.asset-kit-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.asset-kit-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--marketing-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.asset-kit-config {
    background: var(--marketing-panel);
    border: 1px solid var(--marketing-border);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.asset-selection-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

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

/* Key Art and Logo Picker Styles */
.keyart-picker,
.logo-picker {
    display: flex;
    gap: 12px;
    align-items: center;
    min-height: 80px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed var(--marketing-border);
    border-radius: 12px;
}

.keyart-select-btn,
.logo-select-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px 20px;
    background: transparent;
    border: 1px solid var(--marketing-border);
    border-radius: 10px;
    color: var(--marketing-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.keyart-select-btn:hover,
.logo-select-btn:hover {
    border-color: var(--marketing-primary);
    color: var(--marketing-primary);
    background: rgba(208, 187, 149, 0.1);
}

.keyart-select-btn span,
.logo-select-btn span {
    font-size: 0.75rem;
}

.selected-keyart,
.selected-logo {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    border: 2px solid var(--marketing-primary);
}

.selected-keyart img,
.selected-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-keyart,
.remove-logo {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ff4757;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.remove-keyart:hover,
.remove-logo:hover {
    background: #e83b4c;
    transform: scale(1.1);
}

/* Template Config Row */
.template-config-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

@media (max-width: 800px) {
    .template-config-row {
        grid-template-columns: 1fr;
    }
}

/* Template Upload Zone */
.template-upload-zone {
    padding: 24px;
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed var(--marketing-border);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.template-upload-zone:hover {
    border-color: var(--marketing-primary);
    background: rgba(208, 187, 149, 0.05);
}

.template-upload-zone.dragover {
    border-color: var(--marketing-primary);
    background: rgba(208, 187, 149, 0.1);
}

.template-upload-zone span {
    font-size: 32px;
    color: var(--marketing-text-muted);
}

.template-upload-zone p {
    margin: 8px 0 0;
    font-size: 0.9rem;
    color: var(--marketing-text-muted);
}

/* Selected Template Display */
.selected-template-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(208, 187, 149, 0.1);
    border: 1px solid var(--marketing-primary);
    border-radius: 12px;
    margin-top: 12px;
}

.selected-template-display img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--marketing-border);
}

.selected-template-display span {
    flex: 1;
    font-size: 0.9rem;
    color: var(--marketing-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.remove-template-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--marketing-border);
    color: var(--marketing-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.remove-template-btn:hover {
    background: #ff4757;
    border-color: #ff4757;
    color: white;
}

.remove-template-btn span {
    font-size: 18px;
}

/* Aspect Ratio Block */
.aspect-ratio-block {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.aspect-ratio-block .select-wrapper {
    position: relative;
}

.aspect-ratio-block select {
    width: 100%;
    background: var(--marketing-bg);
    border: 1px solid var(--marketing-border);
    border-radius: 10px;
    padding: 14px 40px 14px 16px;
    color: var(--marketing-text);
    font-family: inherit;
    font-size: 0.95rem;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s;
}

.aspect-ratio-block select:focus {
    outline: none;
    border-color: var(--marketing-primary);
    box-shadow: 0 0 0 2px rgba(208, 187, 149, 0.2);
}

.aspect-ratio-block .select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--marketing-text-muted);
    pointer-events: none;
}

/* Generate Button */
.asset-kit-generate-btn {
    padding: 16px 40px;
    background: var(--marketing-primary);
    border: none;
    border-radius: 12px;
    color: #1d1a15;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
    align-self: center;
    margin-top: 8px;
}

.asset-kit-generate-btn:hover:not(:disabled) {
    background: var(--marketing-primary-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

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

.asset-kit-generate-btn .credit-cost {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
}

.asset-kit-generate-btn .credit-cost span {
    font-size: 14px;
}

/* Result Section */
.asset-kit-result-section {
    background: var(--marketing-panel);
    border: 1px solid var(--marketing-border);
    border-radius: 20px;
    padding: 24px;
    animation: fadeIn 0.3s ease;
}

.result-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.result-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--marketing-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-header h4 span {
    color: #4ade80;
}

.asset-kit-result-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--marketing-border);
    border-radius: 16px;
    overflow: hidden;
}

.result-preview {
    background: var(--marketing-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.result-preview img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.result-preview:hover {
    opacity: 0.9;
}

.result-actions {
    padding: 12px 16px;
    display: flex;
    justify-content: center;
    gap: 12px;
}

.result-action-btn {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--marketing-border);
    border-radius: 8px;
    color: var(--marketing-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.result-action-btn:hover {
    border-color: var(--marketing-primary);
    color: var(--marketing-primary);
    background: rgba(208, 187, 149, 0.1);
}

.result-action-btn span {
    font-size: 20px;
}

/* Loading state for result preview */
.result-preview.loading {
    min-height: 200px;
    position: relative;
}

.result-preview.loading::after {
    content: '';
    position: absolute;
    width: 48px;
    height: 48px;
    border: 3px solid var(--marketing-border);
    border-top-color: var(--marketing-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* =========================================================================
   KEY ART GENERATOR PANEL
   ========================================================================= */

.marketing-keyart-generator-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.3s ease;
}

.keyart-generator-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.keyart-generator-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--marketing-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Make auto mode container display properly inside Marketing Studio */
.marketing-keyart-generator-panel #auto-mode-container {
    background: var(--marketing-panel);
    border: 1px solid var(--marketing-border);
    border-radius: 20px;
    padding: 24px;
}

/* =========================================================================
   GAMEPLAY KEY MOMENTS PANEL
   ========================================================================= */

.marketing-keymoments-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.3s ease;
}

.keymoments-panel-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.keymoments-panel-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--marketing-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Configuration Section */
.keymoments-config-section {
    background: var(--marketing-panel);
    border: 1px solid var(--marketing-border);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.keymoments-config-section .select-wrapper {
    position: relative;
}

.keymoments-config-section select {
    width: 100%;
    background: var(--marketing-bg);
    border: 1px solid var(--marketing-border);
    border-radius: 10px;
    padding: 12px 40px 12px 16px;
    color: var(--marketing-text);
    font-family: inherit;
    font-size: 0.9rem;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s;
}

.keymoments-config-section select:focus {
    outline: none;
    border-color: var(--marketing-primary);
    box-shadow: 0 0 0 2px rgba(208, 187, 149, 0.2);
}

.keymoments-config-section .select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--marketing-text-muted);
    pointer-events: none;
}

/* Key Moments List */
.keymoments-list-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.keymoments-list-section label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--marketing-text-muted);
    letter-spacing: 0.05em;
}

.keymoments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 8px;
}

.keymoments-list::-webkit-scrollbar {
    width: 6px;
}

.keymoments-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.keymoments-list::-webkit-scrollbar-thumb {
    background: var(--marketing-primary);
    border-radius: 3px;
}

.keymoment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--marketing-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.keymoment-item:hover {
    border-color: var(--marketing-primary);
    background: rgba(208, 187, 149, 0.05);
}

.keymoment-item.added {
    border-color: rgba(76, 175, 80, 0.5);
    background: rgba(76, 175, 80, 0.1);
}

.keymoment-item.added:hover {
    border-color: rgba(255, 82, 82, 0.5);
    background: rgba(255, 82, 82, 0.1);
}

.keymoment-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--marketing-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.keymoment-item.added .keymoment-indicator {
    background: #4CAF50;
    border-color: #4CAF50;
    color: white;
}

.keymoment-indicator span {
    font-size: 16px;
}

.keymoment-content {
    flex: 1;
    min-width: 0;
}

.keymoment-description {
    font-size: 0.9rem;
    color: var(--marketing-text);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.keymoment-times {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--marketing-text-muted);
    margin-top: 4px;
}

.keymoment-duration {
    padding: 4px 10px;
    background: rgba(208, 187, 149, 0.1);
    border: 1px solid rgba(208, 187, 149, 0.2);
    border-radius: 6px;
    color: var(--marketing-primary);
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* Timeline Section */
.keymoments-timeline-section {
    background: var(--marketing-panel);
    border: 1px solid var(--marketing-border);
    border-radius: 20px;
    padding: 24px;
}

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

.timeline-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--marketing-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-header h4 span {
    color: var(--marketing-primary);
}

.timeline-duration {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(208, 187, 149, 0.1);
    border: 1px solid rgba(208, 187, 149, 0.2);
    border-radius: 10px;
    color: var(--marketing-primary);
    font-weight: 700;
    font-size: 1rem;
}

.timeline-duration span:first-child {
    font-size: 18px;
}

.timeline-container {
    min-height: 100px;
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed var(--marketing-border);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.timeline-container.drag-over {
    border-color: var(--marketing-primary);
    background: rgba(208, 187, 149, 0.05);
}

.timeline-empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--marketing-text-muted);
    text-align: center;
}

.timeline-empty-state span {
    font-size: 32px;
    opacity: 0.5;
}

.timeline-empty-state p {
    margin: 0;
    font-size: 0.85rem;
}

.timeline-clips {
    display: flex;
    gap: 8px;
    padding: 12px;
    min-height: 76px;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.timeline-clips::-webkit-scrollbar {
    height: 6px;
}

.timeline-clips::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.timeline-clips::-webkit-scrollbar-thumb {
    background: var(--marketing-primary);
    border-radius: 3px;
}

.timeline-clip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(208, 187, 149, 0.15), rgba(208, 187, 149, 0.05));
    border: 1px solid rgba(208, 187, 149, 0.3);
    border-radius: 10px;
    cursor: grab;
    transition: all 0.2s ease;
    flex-shrink: 0;
    max-width: 200px;
}

.timeline-clip:hover {
    border-color: var(--marketing-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.timeline-clip.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.timeline-clip-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--marketing-primary);
    color: var(--marketing-bg);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.timeline-clip-info {
    flex: 1;
    min-width: 0;
}

.timeline-clip-desc {
    font-size: 0.8rem;
    color: var(--marketing-text);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-clip-time {
    font-size: 0.7rem;
    color: var(--marketing-text-muted);
    margin: 2px 0 0;
}

.timeline-clip-remove {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 82, 82, 0.2);
    border: none;
    color: #ff5252;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.timeline-clip:hover .timeline-clip-remove {
    opacity: 1;
}

.timeline-clip-remove:hover {
    background: #ff5252;
    color: white;
}

.timeline-clip-remove span {
    font-size: 14px;
}

/* Generate Button */
.keymoments-generate-btn {
    padding: 16px 32px;
    background: var(--marketing-primary);
    border: none;
    border-radius: 12px;
    color: #1d1a15;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
    align-self: center;
}

.keymoments-generate-btn:hover:not(:disabled) {
    background: var(--marketing-primary-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.keymoments-generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.keymoments-generate-btn .credit-cost {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    font-size: 0.85rem;
}

.keymoments-generate-btn .credit-cost span {
    font-size: 14px;
}

/* Result Section */
.keymoments-result-section {
    background: var(--marketing-panel);
    border: 1px solid var(--marketing-border);
    border-radius: 20px;
    padding: 24px;
}

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

.keymoments-result-section .result-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--marketing-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.keymoments-result-section .result-header h4 span {
    color: #4CAF50;
}

.keymoments-result-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: black;
}

.keymoments-result-card video {
    width: 100%;
    max-height: 400px;
    display: block;
}

.keymoments-result-card .result-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
}

.keymoments-result-card .result-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.keymoments-result-card .result-action-btn:hover {
    background: var(--marketing-primary);
    color: var(--marketing-bg);
    transform: scale(1.1);
}

/* Loading state for generate button */
.keymoments-generate-btn.loading {
    pointer-events: none;
}

.keymoments-generate-btn.loading span:first-child {
    animation: spin 1s linear infinite;
}

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

    to {
        transform: rotate(360deg);
    }
}

/* Video Effects Section */
.keymoments-effects-section {
    background: var(--marketing-panel);
    border: 1px solid var(--marketing-border);
    border-radius: 20px;
    padding: 24px;
}

.effects-header {
    margin-bottom: 16px;
}

.effects-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--marketing-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.effects-header h4 span {
    color: var(--marketing-primary);
}

.effects-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.effect-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--marketing-border);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.effect-item.effect-applied {
    border-color: rgba(76, 175, 80, 0.3);
    background: rgba(76, 175, 80, 0.05);
}

.effect-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(208, 187, 149, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.effect-icon span {
    font-size: 20px;
    color: var(--marketing-primary);
}

.effect-applied .effect-icon {
    background: rgba(76, 175, 80, 0.15);
}

.effect-applied .effect-icon span {
    color: #4CAF50;
}

.effect-content {
    flex: 1;
    min-width: 0;
}

.effect-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--marketing-text);
    margin: 0 0 4px 0;
}

.effect-desc {
    font-size: 0.75rem;
    color: var(--marketing-text-muted);
    margin: 0;
}

.effect-badge {
    padding: 4px 10px;
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 6px;
    color: #4CAF50;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}

.effect-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.select-logo-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(208, 187, 149, 0.1);
    border: 1px solid rgba(208, 187, 149, 0.3);
    border-radius: 8px;
    color: var(--marketing-primary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.select-logo-btn:hover {
    background: rgba(208, 187, 149, 0.2);
    border-color: var(--marketing-primary);
}

.select-logo-btn span {
    font-size: 18px;
}

.endcard-logo-preview {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--marketing-primary);
}

.endcard-logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.5);
}

.remove-logo-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff5252;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.endcard-logo-preview:hover .remove-logo-btn {
    opacity: 1;
}

.remove-logo-btn span {
    font-size: 14px;
}

/* Endcard Logo Selection Modal */
#endcard-logo-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

#endcard-logo-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

#endcard-logo-modal .modal-content {
    position: relative;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    background: #2D2A32;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 10001;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
}

#endcard-logo-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--marketing-border, rgba(255, 255, 255, 0.05));
}

#endcard-logo-modal .modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--marketing-text, #ffffff);
}

#endcard-logo-modal .modal-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--marketing-border, rgba(255, 255, 255, 0.05));
    background: transparent;
    color: var(--marketing-text-muted, #a0a0a0);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#endcard-logo-modal .modal-close-btn:hover {
    border-color: var(--marketing-primary, #D0BB95);
    color: var(--marketing-primary, #D0BB95);
    background: rgba(208, 187, 149, 0.1);
}

#endcard-logo-modal .modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

#endcard-logo-modal .asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
}

#endcard-logo-modal .asset-item {
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    background: rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

#endcard-logo-modal .asset-item:hover {
    border-color: var(--marketing-primary, #D0BB95);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

#endcard-logo-modal .asset-item img {
    width: 100%;
    height: 80%;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.2);
}

#endcard-logo-modal .asset-item .asset-name {
    padding: 6px 8px;
    font-size: 0.7rem;
    color: var(--marketing-text-muted, #a0a0a0);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(0, 0, 0, 0.3);
}

#endcard-logo-modal .loading-text,
#endcard-logo-modal .error-text,
#endcard-logo-modal .empty-text {
    text-align: center;
    padding: 40px 20px;
    color: var(--marketing-text-muted, #a0a0a0);
    font-size: 0.9rem;
}

#endcard-logo-modal .error-text {
    color: #ff5252;
}

/* Audio Toggle Switch */
.audio-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    cursor: pointer;
}

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

.audio-toggle .toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 26px;
    transition: all 0.3s ease;
}

.audio-toggle .toggle-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: #666;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.audio-toggle input:checked+.toggle-slider {
    background-color: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.4);
}

.audio-toggle input:checked+.toggle-slider::before {
    transform: translateX(22px);
    background-color: #4CAF50;
}

#effect-audio.muted .effect-icon span {
    color: var(--marketing-text-muted);
}

#effect-audio:not(.muted) .effect-icon span {
    color: #4CAF50;
}

/* =========================================================================
   KEY MOMENTS STUDIO LAYOUT (NEW)
   ========================================================================= */

.keymoments-studio-container {
    display: flex;
    gap: 20px;
    height: calc(100vh - 180px);
    /* Adjust based on header height */
    min-height: 600px;
    animation: fadeIn 0.3s ease;
}

/* --- Left Panel: Sources --- */
.keymoments-source-panel {
    width: 300px;
    background: var(--marketing-panel);
    border: 1px solid var(--marketing-border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
}

.panel-section-header {
    padding: 16px;
    border-bottom: 1px solid var(--marketing-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-section-header.compact {
    padding: 12px;
}

.panel-section-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--marketing-text);
}

.panel-section-header .material-symbols-outlined {
    color: var(--marketing-primary);
}

.source-grid-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-content: start;
    /* Prevent cards from stretching to fill empty space */
}

.source-video-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--marketing-border);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    height: auto;
    /* Ensure auto height */
    min-height: min-content;
}

.source-video-card:hover {
    border-color: var(--marketing-primary);
    transform: translateY(-2px);
    background: rgba(208, 187, 149, 0.05);
}

.source-video-thumb {
    height: 100px;
    background: #000;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.source-video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.source-video-thumb .play-icon {
    position: absolute;
    color: rgba(255, 255, 255, 0.8);
    font-size: 32px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.source-video-info {
    padding: 10px;
}

.source-video-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.source-video-meta {
    font-size: 0.7rem;
    color: var(--marketing-text-muted);
}

.source-list-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.moments-header-nav {
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--marketing-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-back-small {
    background: transparent;
    border: none;
    color: var(--marketing-text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    width: fit-content;
}

.nav-back-small:hover {
    color: var(--marketing-primary);
}

.selected-source-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--marketing-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.section-hint {
    padding: 8px 12px;
    margin: 0;
    font-size: 0.7rem;
    color: var(--marketing-text-muted);
    background: rgba(255, 255, 255, 0.03);
}

.moments-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--marketing-text-muted);
    gap: 12px;
}

/* --- Right Panel: Workspace --- */
.keymoments-workspace-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    /* Prevent flex overflow */
}

/* Top Section: Preview + Effects */
.workspace-top-section {
    flex: 2;
    display: flex;
    gap: 16px;
    min-height: 300px;
}

.workspace-preview {
    flex: 1;
    background: #000;
    border-radius: 12px;
    border: 1px solid var(--marketing-border);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--marketing-text-muted);
    gap: 12px;
}

.preview-placeholder .material-symbols-outlined {
    font-size: 48px;
    opacity: 0.5;
}

.workspace-effects {
    width: 250px;
    background: var(--marketing-panel);
    border: 1px solid var(--marketing-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}

.effects-list {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.effect-control-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.effect-control-item.disabled {
    opacity: 0.7;
}

.control-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}

.control-info .material-symbols-outlined {
    font-size: 18px;
    color: var(--marketing-text-muted);
}

.effect-control-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.control-label-block {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--marketing-text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}

/* Effects Panel Dropdown */
.workspace-effects .select-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

.workspace-effects .effect-select {
    width: 100%;
    background: rgba(0, 0, 0, 0.2); /* Slightly darker than panel */
    border: 1px solid var(--marketing-border);
    border-radius: 10px;
    padding: 10px 36px 10px 12px;
    color: var(--marketing-text);
    font-family: inherit;
    font-size: 0.9rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: all 0.2s;
    box-sizing: border-box;
}

.workspace-effects .effect-select:hover {
    border-color: var(--marketing-primary);
    background: rgba(208, 187, 149, 0.05);
}

.workspace-effects .effect-select:focus {
    outline: none;
    border-color: var(--marketing-primary);
    box-shadow: 0 0 0 2px rgba(208, 187, 149, 0.2);
}

.workspace-effects .effect-select option {
    background: var(--marketing-panel);
    color: var(--marketing-text);
    padding: 10px;
}

.workspace-effects .select-wrapper .select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--marketing-text-muted);
    pointer-events: none;
    font-size: 20px;
}

.logo-selector-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.endcard-logo-preview {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--marketing-primary);
}

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

.select-logo-btn.small,
.remove-logo-btn.small {
    font-size: 0.75rem;
    padding: 6px 10px;
}

.badge-auto {
    font-size: 0.65rem;
    background: rgba(208, 187, 149, 0.1);
    color: var(--marketing-primary);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(208, 187, 149, 0.2);
}

/* Timeline Area */
.workspace-timeline {
    height: 200px;
    background: var(--marketing-panel);
    border: 1px solid var(--marketing-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.timeline-header-row {
    padding: 10px 16px;
    border-bottom: 1px solid var(--marketing-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.1);
}

.timeline-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.9rem;
}

.timeline-stats {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--marketing-primary);
    background: rgba(208, 187, 149, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.timeline-track-container {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 16px;
    background: repeating-linear-gradient(90deg,
            rgba(255, 255, 255, 0.02) 0px,
            rgba(255, 255, 255, 0.02) 1px,
            transparent 1px,
            transparent 20px);
    position: relative;
    /* Anchor for absolute empty state */
}

.timeline-track {
    display: flex;
    align-items: center;
    height: 100%;
    min-width: 100%;
    position: relative;
    gap: 8px;
    z-index: 1;
    /* Above empty state if needed, though they shouldn't overlap usually */
}

.timeline-empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--marketing-text-muted);
    font-size: 1rem;
    /* Slightly larger */
    pointer-events: none;
    border: 2px dashed var(--marketing-border);
    border-radius: 8px;
    padding: 20px 40px;
    background: rgba(0, 0, 0, 0.3);
    /* Darker bg */
    white-space: nowrap;
    z-index: 0;
}

.timeline-clip {
    height: 100px;
    min-width: 160px;
    background: #3d3a40;
    border: 1px solid var(--marketing-border);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: grab;
    transition: transform 0.2s cubic-bezier(0.2, 0, 0.2, 1), box-shadow 0.2s, background-color 0.2s, opacity 0.2s;
    user-select: none;
    flex-shrink: 0;
    text-align: center;
}

.timeline-clip:hover {
    border-color: var(--marketing-primary);
    background: #46434a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.timeline-clip:active {
    cursor: grabbing;
}

.timeline-clip.dragging {
    opacity: 0.2;
    transform: scale(0.9);
    filter: grayscale(1);
    border: 1px dashed var(--marketing-text-muted);
    background: transparent;
    box-shadow: none;
}

.timeline-clip.drag-target {
    border-color: var(--marketing-primary);
    background: rgba(208, 187, 149, 0.1);
    box-shadow: 0 0 0 2px var(--marketing-primary), 0 8px 24px rgba(0, 0, 0, 0.5);
    transform: scale(1.02);
    z-index: 10;
}

/* ... existing hover styles ... */

.timeline-clip-info {
    margin-top: 12px;
    /* Reduced margin */
    width: 100%;
}

.timeline-clip-desc {
    font-size: 0.75rem;
    line-height: 1.2;
    max-height: 2.4em;
    overflow: hidden;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.timeline-clip-time {
    font-size: 0.7rem;
    color: var(--marketing-primary);
    font-family: monospace;
}

/* Action Bar */
.workspace-action-bar {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    padding-top: 8px;
}

.keymoments-generate-btn.wide {
    width: auto;
    min-width: 200px;
}

.btn-download-result {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--marketing-border);
    color: var(--marketing-text);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-download-result:hover {
    border-color: var(--marketing-primary);
    color: var(--marketing-primary);
}

/* Custom Scrollbar for inner containers */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}