/* --- GLOBAL VARIABLES (ROOT) --- */
:root {
    --primary: #5b3cf5;
    --primary-hover: #4a2fd0;
    --primary-light: #eef2ff;
    --bg-body: #f8fafc;
    --bg-sidebar: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --card-radius: 12px;
    --btn-radius: 8px;
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
}

#app-wrapper {
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
}

#app-wrapper * {
    box-sizing: border-box;
}

/* --- LOGIN OVERLAY --- */
#login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(248, 250, 252, 0.95);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

#login-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.login-card {
    background: white;
    width: 100%;
    max-width: 420px;
    padding: 40px;
    border-radius: var(--card-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    text-align: center;
    position: relative;
}

.login-card h2 {
    margin-top: 0;
    color: var(--text-main);
    font-size: 1.5rem;
    font-weight: 700;
}

.login-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 30px;
}

.login-input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--btn-radius);
    font-size: 1rem;
    color: var(--text-main);
    outline: none;
    transition: all 0.2s;
    font-family: var(--font-main);
}

.login-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-login {
    width: 100%;
    background-color: var(--primary);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: var(--btn-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-link {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 20px;
    text-decoration: none;
    transition: color 0.2s;
}

.btn-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.error-msg {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 0.9rem;
    margin-bottom: 20px;
    padding: 12px;
    border-radius: var(--btn-radius);
    display: none;
    text-align: left;
}

.success-msg {
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    font-size: 0.9rem;
    margin-bottom: 20px;
    padding: 12px;
    border-radius: var(--btn-radius);
    display: none;
    text-align: left;
}

/* SIDEBAR */
.sidebar {
    width: 260px;
    min-width: 260px;
    background-color: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    border-right: 1px solid var(--border-color);
    height: 100%;
    z-index: 10;
}

.logo-area {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 32px;
    padding-left: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    margin-bottom: 4px;
    border-radius: var(--btn-radius);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: all 0.2s;
}

.nav-item:hover {
    background-color: var(--bg-body);
    color: var(--primary);
}

.nav-item.active {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(91, 60, 245, 0.3);
}

.nav-item i {
    font-size: 1.2rem;
}

/* CREDIT DISPLAY */
.credit-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 10px 14px;
    border-radius: var(--btn-radius);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    border: 1px solid #c7d2fe;
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 32px 40px;
}

.header-area {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
}

.page-title h1 {
    font-size: 1.5rem;
    margin: 0 0 6px 0;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.title-icon {
    color: var(--primary);
    font-size: 1.3rem;
}

.page-title p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.tool-container {
    display: none;
    animation: fadeIn 0.4s ease;
    width: 100%;
}

.tool-container.visible {
    display: block;
}

/* APP CARDS */
.input-card {
    background: white;
    border-radius: var(--card-radius);
    border: 1px solid var(--border-color);
    padding: 30px;
    width: 100%;
    box-shadow: var(--shadow-card);
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-main);
}

input,
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--btn-radius);
    font-size: 0.95rem;
    outline: none;
    font-family: inherit;
    transition: border 0.2s;
    background: #fff;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

textarea {
    resize: vertical;
}

/* --- SPLIT LAYOUT (LEFT: INPUT, RIGHT: SETTINGS) --- */
.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: stretch;
}

.left-panel {
    display: flex;
    flex-direction: column;
}

.full-height-input {
    flex-grow: 1;
    min-height: 400px;
    height: 100%;
}

.right-panel {
    display: flex;
    flex-direction: column;
}

.settings-top-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Preview Image Styling */
.preview-wrapper {
    margin-top: 15px;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #f1f5f9;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    aspect-ratio: 16 / 9;
    position: relative;
}

.preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
}

.preview-label {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

@media (max-width: 1000px) {

    .split-layout {
        grid-template-columns: 1fr;
    }

    .full-height-input {
        min-height: 200px;
    }
}

/* APP BUTTONS */
.btn-generate {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--btn-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-generate:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-generate:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background-color: #fff;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: var(--btn-radius);
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: #f3f4f6;
    border-color: #cbd5e1;
}

.btn-danger-outline {
    background-color: #fff;
    border: 1px solid #fecaca;
    color: #ef4444;
    padding: 10px 20px;
    border-radius: var(--btn-radius);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.btn-danger-outline:hover {
    background-color: #fee2e2;
    border-color: #ef4444;
    color: #b91c1c;
}

.result-area {
    margin-top: 20px;
    padding-bottom: 100px;
    display: none;
    animation: fadeIn 0.5s ease;
}

.loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff60;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.big-loader {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px auto;
}

.loader-dark {
    width: 14px;
    height: 14px;
    border: 2px solid #cbd5e1;
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

/* SOCIAL GRID STYLES */
.social-toggle-bar {
    display: none;
    text-align: center;
    margin-bottom: 30px;
    padding: 10px;
    background: #f1f5f9;
    border-radius: var(--btn-radius);
    border: 1px dashed #cbd5e1;
}

.btn-toggle {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}

/* --- THEME STYLING (Ideas) --- */
.theme-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.theme-section-header:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.theme-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.section-content {
    display: none;
    padding-top: 10px;
    padding-bottom: 30px;
    animation: fadeIn 0.3s ease;
}

.theme-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-card);
    transition: transform 0.2s;
}

.theme-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
}

.theme-card h4 {
    margin-top: 0;
    color: var(--text-main);
    font-size: 1.1rem;
}

.theme-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 15px;
}

.theme-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-core {
    background: #e0e7ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
}

.badge-broad {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.yt-link-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.yt-btn {
    text-decoration: none;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.yt-btn:hover {
    background: #fff;
    border-color: #ff0000;
    color: #ff0000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Used Videos & Inputs */
.used-videos-section {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px dashed var(--border-color);
}

.used-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 8px;
    display: block;
}

.used-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.used-video-row {
    display: flex;
    align-items: center;
    position: relative;
    margin-bottom: 6px;
}

.used-item-link {
    font-size: 0.8rem;
    background: #ecfdf5;
    color: #065f46;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #d1fae5;
    transition: all 0.2s;
    flex: 1;
    overflow: hidden;
    padding-right: 25px;
}

.used-item-link:hover {
    background: #d1fae5;
}

.video-thumb {
    width: 40px;
    height: auto;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    flex-shrink: 0;
}

.btn-delete-video {
    background: rgba(255, 255, 255, 0.5);
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 5;
}

.btn-delete-video:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.btn-add-video {
    width: 100%;
    background: none;
    border: 1px dashed #cbd5e1;
    color: var(--text-muted);
    border-radius: 6px;
    padding: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 5px;
}

.btn-add-video:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.video-input-wrapper {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

.video-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.8rem;
    outline: none;
}

.video-input:focus {
    border-color: var(--primary);
}

.btn-save-video {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0 12px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-cancel-video {
    background: #fff;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 6px;
    padding: 0 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

/* Delete Section */
.delete-section {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    padding-bottom: 40px;
}

.btn-delete-all {
    background: #fff;
    border: 1px solid #fecaca;
    color: #ef4444;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-delete-all:hover {
    background: #fee2e2;
    border-color: #ef4444;
    color: #b91c1c;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.1);
}

/* WIZARD & SELECTION CARDS */
.wizard-step {
    display: none;
    animation: fadeIn 0.4s ease;
}

.selection-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.selection-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.selection-card i {
    font-size: 1.8rem;
    color: var(--primary);
}

/* BRAND VOICE CARDS */
.voice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .voice-grid {
        grid-template-columns: 1fr;
    }
}

.voice-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    position: relative;
}

.voice-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.voice-card.selected {
    border: 2px solid var(--primary);
    background: var(--primary-light);
}

.voice-card.selected::after {
    content: "\e99e";
    font-family: 'boxicons';
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--primary);
    font-size: 1.2rem;
}

.voice-header {
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--primary);
}

.voice-preview {
    font-size: 0.85rem;
    background: #f1f5f9;
    padding: 10px;
    border-radius: 6px;
    color: var(--text-main);
    font-style: italic;
    margin-bottom: 10px;
    line-height: 1.4;
    border-left: 3px solid #cbd5e1;
}

.voice-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* CHECKLIST ANIMATION (Step 7 & Social Gen) */
.progress-list {
    list-style: none;
    padding: 0;
    margin: 20px auto;
    max-width: 350px;
    text-align: left;
}

.progress-list li {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    transition: color 0.3s;
}

.progress-list li.active {
    color: var(--text-main);
    font-weight: 500;
}

.progress-list li.done {
    color: var(--success);
}

.status-icon {
    width: 24px;
    text-align: center;
}

/* --- VISUAL POST PREVIEW STYLES --- */
.post-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.post-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-header h3 {
    margin: 0;
    font-size: 0.95rem;
    color: #475569;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-body {
    padding: 25px;
    color: #334155;
    line-height: 1.7;
    font-size: 1rem;
}

.post-body ul,
.post-body ol {
    padding-left: 20px;
    margin-bottom: 1.5em;
}

/* STRATEGY CARD */
.strategy-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 40px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.strategy-icon {
    background: var(--primary-light);
    color: var(--primary);
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.strategy-content h3 {
    margin: 0 0 8px 0;
    color: var(--text-main);
    font-size: 1.05rem;
}

.strategy-content p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.6;
}

/* PHONE MOCKUP */
.social-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 25px;
    margin-bottom: 40px;
}

@media (max-width: 1200px) {
    .social-grid {
        grid-template-columns: 1fr;
    }
}

.phone-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.phone-header {
    width: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    height: 32px;
}

.phone-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.phone-header .icon-btn {
    position: absolute;
    right: 0;
}

.phone-mockup {
    width: 100%;
    max-width: 360px;
    height: 600px;
    background: #fff;
    border: 12px solid #2d3748;
    border-radius: 36px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.15);
}

.phone-status-bar {
    height: 24px;
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    font-size: 10px;
    color: #94a3b8;
    font-weight: 600;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
}

.phone-content {
    height: 100%;
    overflow-y: auto;
    padding: 40px 20px 20px 20px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #1e293b;
    scrollbar-width: thin;
    background: #fff;
}

.phone-content p {
    margin-bottom: 1.2em;
}

.phone-content hr {
    border: 0;
    border-top: 1px solid #cbd5e1;
    margin: 20px 0;
}

.phone-content ul,
.phone-content ol {
    padding-left: 20px;
    margin-bottom: 1.2em;
}

/* PROMPT BOXES */
.prompt-container {
    margin-top: 40px;
    margin-bottom: 40px;
}

.prompt-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

@media (max-width: 1000px) {
    .prompt-grid {
        grid-template-columns: 1fr;
    }
}

.prompt-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.prompt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #e2e8f0;
    background: #e2e8f0;
}

.prompt-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

.prompt-content {
    padding: 15px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
    color: #475569;
    line-height: 1.6;
    background: #fff;
    flex-grow: 1;
}

/* ICONS */
.icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: #e2e8f0;
    color: var(--primary);
}

.icon-btn.copied {
    color: var(--success);
}

.icon-btn i {
    font-size: 1.4rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {

    #app-wrapper {
        flex-direction: column;
        height: auto;
        position: relative;
    }

    .sidebar {
        width: 100%;
        min-width: 0;
        height: auto;
    }

    .main-content {
        padding: 20px;
        overflow: visible;
    }
}

@
/* ===== UNIVERSAL LOADING SCREEN STYLES ===== */

#universal-loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#universal-loading-overlay.active {
    display: flex;
}

.loading-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.loading-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    pointer-events: none;
}

.loading-card {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 48px 56px;
    width: 100%;
    max-width: 880px;
    min-height: 420px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    pointer-events: auto;
}

/* Kompakte Card ohne Steps */
.loading-card.compact {
    max-width: 480px;
    min-height: 360px;
}

.loading-card-content {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: 100%;
    gap: 48px;
}

.loading-card.compact .loading-card-content {
    justify-content: center;
}

.loading-left-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 340px;
}

.loading-card.compact .loading-left-section {
    min-width: auto;
    align-items: center;
    text-align: center;
}

.loading-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.loading-card.compact .loading-header {
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.loading-icon-container {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #F9F5FF;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.loading-icon-container.overtime {
    background: #FEF2F2;
}

.loading-icon-container svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.5;
    fill: none;
    transition: stroke 0.3s ease;
}

.loading-header-text {
    flex: 1;
}

.loading-card.compact .loading-header-text {
    text-align: center;
}

.loading-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 4px 0;
    letter-spacing: -0.01em;
}

.loading-subtitle {
    font-size: 14px;
    color: #9CA3AF;
    margin: 0;
    font-weight: 400;
}

.loading-progress-section {
    display: flex;
    align-items: center;
    gap: 40px;
    flex: 1;
    justify-content: center;
    padding: 20px 0;
}

.loading-card.compact .loading-progress-section {
    flex-direction: column;
    gap: 24px;
}

.loading-progress-ring-container {
    position: relative;
    width: 140px;
    height: 140px;
}

.loading-progress-ring {
    transform: rotate(-90deg);
}

.loading-progress-bg {
    fill: none;
    stroke: #F3F4F6;
    stroke-width: 4;
}

.loading-progress-fill {
    fill: none;
    stroke: #7C3AED;
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke 0.3s ease;
}

.loading-progress-fill.overtime {
    stroke: #DC2626;
}

.loading-progress-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-progress-percentage {
    font-size: 32px;
    font-weight: 600;
    color: #111827;
    line-height: 1;
    transition: color 0.3s ease;
}

.loading-progress-percentage.overtime {
    color: #DC2626;
}

.loading-time-display {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.loading-card.compact .loading-time-display {
    flex-direction: row;
    gap: 32px;
}

.loading-time-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.loading-card.compact .loading-time-block {
    align-items: center;
}

.loading-time-value {
    font-size: 24px;
    font-weight: 500;
    color: #111827;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    transition: color 0.3s ease;
}

.loading-time-value.overtime {
    color: #DC2626;
}

.loading-time-label {
    font-size: 12px;
    color: #9CA3AF;
    margin-top: 4px;
    font-weight: 400;
}

.loading-info-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #F9F5FF;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.loading-info-banner.overtime {
    background: #FEF2F2;
    border-color: #FECACA;
}

.loading-info-banner-icon {
    flex-shrink: 0;
    display: flex;
}

.loading-info-banner-icon svg {
    width: 16px;
    height: 16px;
    stroke-width: 1.5;
    fill: none;
    transition: stroke 0.3s ease;
}

.loading-info-banner-text {
    font-size: 13px;
    color: #6B7280;
    font-weight: 400;
    transition: all 0.3s ease;
}

.loading-info-banner.overtime .loading-info-banner-text {
    color: #DC2626;
    font-weight: 500;
}

.loading-vertical-divider {
    width: 1px;
    background: #F0F0F0;
    align-self: stretch;
}

.loading-right-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 300px;
}

.loading-steps-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.loading-steps-title {
    font-size: 13px;
    font-weight: 500;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.loading-steps-count {
    font-size: 13px;
    color: #7C3AED;
    font-weight: 500;
    transition: color 0.3s ease;
}

.loading-steps-count.overtime {
    color: #DC2626;
}

.loading-steps-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    justify-content: center;
}

.loading-step-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    transition: opacity 0.3s ease;
}

.loading-step-item.pending {
    opacity: 0.4;
}

.loading-step-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F3F4F6;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.loading-step-indicator.completed {
    background: #10B981;
}

.loading-step-indicator.active {
    background: #7C3AED;
}

.loading-step-indicator.active.overtime {
    background: #DC2626;
}

.loading-step-indicator svg {
    width: 12px;
    height: 12px;
    stroke: white;
    stroke-width: 2.5;
    fill: none;
}

.loading-step-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-step-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #D1D5DB;
}

.loading-step-label {
    font-size: 14px;
    color: #6B7280;
    transition: all 0.3s ease;
    line-height: 1.4;
}

.loading-step-item.completed .loading-step-label {
    color: #10B981;
}

.loading-step-item.active .loading-step-label {
    color: #111827;
    font-weight: 500;
}

/* Hide elements */
.hidden {
    display: none !important;
}

/* Override styles for styles which are used in html but not defined in css (from User Request 2) */
.voice-preview-content {
    display: -webkit-box;
    -webkit-line-clamp: 10;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 220px;
    position: relative;
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.5;
    mask-image: linear-gradient(180deg, #000 60%, transparent);
    -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent);
}

.dashboard-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.info-box-neutral {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
    grid-column: 1 / -1;
}

.phone-content p {
    margin-bottom: 10px;
}

/* No explicit .phone-content white-space: normal needed as it is default */
.btn-locked {
    opacity: 0.4 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
    filter: grayscale(100%) !important;
}

/* Additional Button Styles for Story Wizard */
.btn-recording {
    background-color: #ef4444 !important;
    color: white !important;
    animation: pulse-red 1.5s infinite;
    border-color: #ef4444 !important;
}

.btn-transcribing {
    background-color: #e2e8f0 !important;
    color: #64748b !important;
    cursor: not-allowed;
}

.story-progress-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 30px;
}

.story-progress-segment {
    flex: 1;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    transition: background 0.3s;
}

.story-progress-segment.active {
    background: var(--primary);
}

.limit-badge {
    font-size: 0.75rem;
    background: #f1f5f9;
    color: #64748b;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 10px;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* ===== UNIVERSAL LOADING SCREEN STYLES ===== */

#universal-loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#universal-loading-overlay.active {
    display: flex !important;
}

.loading-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.loading-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    pointer-events: none;
}

.loading-card {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 48px 56px;
    width: 100%;
    max-width: 880px;
    min-height: 420px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    pointer-events: auto;
}

/* Kompakte Card ohne Steps */
.loading-card.compact {
    max-width: 480px;
    min-height: 360px;
}

.loading-card-content {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: 100%;
    gap: 48px;
}

.loading-card.compact .loading-card-content {
    justify-content: center;
}

.loading-left-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 340px;
}

.loading-card.compact .loading-left-section {
    min-width: auto;
    align-items: center;
    text-align: center;
}

.loading-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.loading-card.compact .loading-header {
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.loading-icon-container {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #F9F5FF;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.loading-icon-container.overtime {
    background: #FEF2F2;
}

.loading-icon-container svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.5;
    fill: none;
    transition: stroke 0.3s ease;
}

.loading-header-text {
    flex: 1;
}

.loading-card.compact .loading-header-text {
    text-align: center;
}

.loading-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 4px 0;
    letter-spacing: -0.01em;
}

.loading-subtitle {
    font-size: 14px;
    color: #9CA3AF;
    margin: 0;
    font-weight: 400;
}

.loading-progress-section {
    display: flex;
    align-items: center;
    gap: 40px;
    flex: 1;
    justify-content: center;
    padding: 20px 0;
}

.loading-card.compact .loading-progress-section {
    flex-direction: column;
    gap: 24px;
}

.loading-progress-ring-container {
    position: relative;
    width: 140px;
    height: 140px;
}

.loading-progress-ring {
    transform: rotate(-90deg);
}

.loading-progress-bg {
    fill: none;
    stroke: #F3F4F6;
    stroke-width: 4;
}

.loading-progress-fill {
    fill: none;
    stroke: #7C3AED;
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke 0.3s ease;
}

.loading-progress-fill.overtime {
    stroke: #DC2626;
}

.loading-progress-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-progress-percentage {
    font-size: 32px;
    font-weight: 600;
    color: #111827;
    line-height: 1;
    transition: color 0.3s ease;
}

.loading-progress-percentage.overtime {
    color: #DC2626;
}

.loading-time-display {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.loading-card.compact .loading-time-display {
    flex-direction: row;
    gap: 32px;
}

.loading-time-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.loading-card.compact .loading-time-block {
    align-items: center;
}

.loading-time-value {
    font-size: 24px;
    font-weight: 500;
    color: #111827;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    transition: color 0.3s ease;
}

.loading-time-value.overtime {
    color: #DC2626;
}

.loading-time-label {
    font-size: 12px;
    color: #9CA3AF;
    margin-top: 4px;
    font-weight: 400;
}

.loading-info-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #F9F5FF;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.loading-info-banner.overtime {
    background: #FEF2F2;
    border-color: #FECACA;
}

.loading-info-banner-icon {
    flex-shrink: 0;
    display: flex;
}

.loading-info-banner-icon svg {
    width: 16px;
    height: 16px;
    stroke-width: 1.5;
    fill: none;
    transition: stroke 0.3s ease;
}

.loading-info-banner-text {
    font-size: 13px;
    color: #6B7280;
    font-weight: 400;
    transition: all 0.3s ease;
}

.loading-info-banner.overtime .loading-info-banner-text {
    color: #DC2626;
    font-weight: 500;
}

.loading-vertical-divider {
    width: 1px;
    background: #F0F0F0;
    align-self: stretch;
}

.loading-right-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 300px;
}

.loading-steps-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.loading-steps-title {
    font-size: 13px;
    font-weight: 500;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.loading-steps-count {
    font-size: 13px;
    color: #7C3AED;
    font-weight: 500;
    transition: color 0.3s ease;
}

.loading-steps-count.overtime {
    color: #DC2626;
}

.loading-steps-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    justify-content: center;
}

.loading-step-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    transition: opacity 0.3s ease;
}

.loading-step-item.pending {
    opacity: 0.4;
}

.loading-step-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F3F4F6;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.loading-step-indicator.completed {
    background: #10B981;
}

.loading-step-indicator.active {
    background: #7C3AED;
}

.loading-step-indicator.active.overtime {
    background: #DC2626;
}

.loading-step-indicator svg {
    width: 12px;
    height: 12px;
    stroke: white;
    stroke-width: 2.5;
    fill: none;
}

.loading-step-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-step-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #D1D5DB;
}

.loading-step-label {
    font-size: 14px;
    color: #6B7280;
    transition: all 0.3s ease;
    line-height: 1.4;
}

.loading-step-item.completed .loading-step-label {
    color: #10B981;
}

.loading-step-item.active .loading-step-label {
    color: #111827;
    font-weight: 500;
}

/* Hide elements */
.hidden {
    display: none !important;
}

/* ===== ANIMATION ===== */

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ===== RESPONSIVE ===== */

@media (max-width: 900px) {
    .loading-card {
        padding: 32px;
        min-height: auto;
    }

    .loading-card-content {
        flex-direction: column;
        gap: 32px;
    }

    .loading-left-section,
    .loading-right-section {
        min-width: auto;
    }

    .loading-vertical-divider {
        width: 100%;
        height: 1px;
    }

    .loading-progress-section {
        flex-direction: column;
        gap: 24px;
    }

    .loading-time-display {
        flex-direction: row;
        gap: 32px;
    }

    .loading-time-block {
        align-items: center;
    }
}

@