:root {
    --primary-blue: #2563eb;
    --primary-blue-hover: #1d4ed8;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --bg-main: #fafafa;
    --white: #ffffff;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --radius-xl: 12px;
    --radius-2xl: 16px;
    --radius-3xl: 24px;
    --radius-4xl: 32px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--slate-800);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
}

.app-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* Header Styles */
.main-header {
    height: 64px;
    background: var(--white);
    border-bottom: 1px solid var(--slate-200);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    z-index: 50;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

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

.logo-container {
    width: 40px;
    height: 40px;
    background: var(--white);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--slate-100);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

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

.brand-name {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -0.05em;
    color: var(--slate-900);
}

.brand-name .highlight {
    color: var(--primary-blue);
}

.brand-name .badge {
    font-size: 10px;
    background: #eff6ff;
    color: var(--primary-blue);
    padding: 2px 8px;
    border-radius: 99px;
    font-weight: 700;
    margin-left: 8px;
    vertical-align: middle;
}

.brand-url {
    font-size: 10px;
    color: var(--slate-400);
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.status-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ecfdf5;
    color: var(--emerald-600);
    padding: 6px 14px;
    border-radius: 99px;
    border: 1px solid #d1fae5;
    font-size: 10px;
    font-weight: 700;
}

/* Main Workspace Layout */
.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Panels Common */
.panel-left, .panel-center, .panel-right {
    height: 100%;
    overflow-y: auto;
}

/* Scrollbar */
.scrollbar-custom::-webkit-scrollbar {
    width: 6px;
}
.scrollbar-custom::-webkit-scrollbar-track {
    background: transparent;
}
.scrollbar-custom::-webkit-scrollbar-thumb {
    background: var(--slate-200);
    border-radius: 10px;
}
.scrollbar-custom::-webkit-scrollbar-thumb:hover {
    background: var(--slate-400);
}

/* Left Panel */
.panel-left {
    width: 360px;
    border-right: 1px solid var(--slate-200);
    background: var(--white);
    padding: 32px;
    flex-shrink: 0;
}

.panel-section {
    margin-bottom: 40px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.section-title h2 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--slate-200);
    border-radius: var(--radius-3xl);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafafa;
    position: relative;
    overflow: hidden;
}

.upload-zone:hover {
    border-color: rgba(37, 99, 235, 0.5);
    background: rgba(37, 99, 235, 0.03);
}

.upload-icon-wrapper {
    width: 56px;
    height: 56px;
    background: #eff6ff;
    color: var(--primary-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: transform 0.2s;
}

.upload-zone:hover .upload-icon-wrapper {
    transform: scale(1.1);
}

.file-name {
    font-size: 14px;
    font-weight: 900;
    color: var(--slate-700);
    margin-bottom: 4px;
    max-width: 240px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    font-size: 12px;
    color: var(--slate-400);
}

.ready-badge {
    position: absolute;
    bottom: 16px;
    background: var(--primary-blue);
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 99px;
    animation: fadeIn 0.3s;
}

.section-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--slate-400);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.2em;
    margin-bottom: 24px;
    font-style: italic;
}

/* Tone Selector (Swiss Style) */
.tone-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.tone-option {
    padding: 16px;
    border-radius: var(--radius-2xl);
    border: 2px solid var(--slate-100);
    background: var(--white);
    cursor: pointer;
    transition: all 0.2s;
}

.tone-option:hover {
    border-color: var(--slate-200);
}

.tone-option.active {
    border-radius: 12px;
    border: 2px solid #000000;
    box-shadow: 4px 4px 0px 0px #000000;
    transform: translate(-2px, -2px);
}

.option-icon {
    margin-bottom: 8px;
}

.option-label {
    display: block;
    font-size: 12px;
    font-weight: 900;
    color: var(--slate-800);
}

.option-desc {
    font-size: 10px;
    font-weight: 700;
    color: var(--slate-400);
}

.icon-professional { color: var(--primary-blue); }
.icon-casual { color: #f59e0b; }

.generate-btn {
    width: 100%;
    background: var(--slate-900);
    color: var(--white);
    border: none;
    border-radius: var(--radius-2xl);
    padding: 20px;
    font-weight: 900;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.2);
}

.generate-btn:hover {
    background: #000000;
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.25);
}

.generate-btn:active {
    transform: scale(0.98);
}

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

/* Center Panel */
.panel-center {
    flex: 1;
    background: #fafafa;
    padding: 48px;
    display: flex;
    flex-direction: column;
}

.center-view {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.welcome-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.welcome-icon {
    width: 80px;
    height: 80px;
    background: var(--white);
    border-radius: var(--radius-3xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--slate-200);
    border: 1px solid var(--slate-100);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05);
    margin-bottom: 32px;
}

.welcome-icon i {
    width: 32px;
    height: 32px;
}

.welcome-title {
    font-size: 24px;
    font-weight: 900;
    color: var(--slate-900);
    margin-bottom: 16px;
    letter-spacing: -0.025em;
}

.welcome-desc {
    font-size: 14px;
    color: var(--slate-500);
    line-height: 1.6;
    margin-bottom: 32px;
}

.feature-pills {
    display: flex;
    gap: 16px;
    margin-bottom: 48px;
}

.feature-pill {
    background: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: 99px;
    padding: 8px 16px;
    font-size: 10px;
    font-weight: 700;
    color: var(--slate-500);
    display: flex;
    align-items: center;
    gap: 8px;
}

.feature-pill i {
    width: 12px;
    height: 12px;
    color: var(--emerald-500);
}

.cta-banner {
    width: 100%;
    background: var(--slate-900);
    border-radius: var(--radius-3xl);
    padding: 32px;
    color: var(--white);
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--slate-800);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.cta-banner:hover {
    background: #000000;
}

.cta-banner::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: var(--primary-blue);
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.1;
}

.cta-subtitle {
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.2em;
    color: var(--primary-blue);
    margin-bottom: 8px;
}

.cta-title {
    font-size: 18px;
    font-weight: 900;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.cta-desc {
    font-size: 11px;
    color: var(--slate-400);
    font-weight: 500;
}

.cta-button {
    background: var(--primary-blue);
    color: var(--white);
    border: none;
    border-radius: 12px;
    padding: 10px 20px;
    font-size: 11px;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    z-index: 10;
}

.cta-button:hover {
    background: var(--primary-blue-hover);
    transform: translateX(4px);
}

/* Loading View */
.loading-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.spinner-wrapper {
    position: relative;
    width: 128px;
    height: 128px;
    margin-bottom: 48px;
}

.spinner {
    width: 100%;
    height: 100%;
    border: 4px solid var(--slate-100);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-zap {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    color: var(--primary-blue);
    animation: pulse 1.5s ease-in-out infinite;
}

.loading-title {
    font-size: 24px;
    font-weight: 900;
    color: var(--slate-900);
    margin-bottom: 8px;
}

.loading-desc {
    font-size: 14px;
    color: var(--slate-400);
    font-weight: 700;
    margin-bottom: 48px;
}

.progress-container {
    width: 100%;
    max-width: 400px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    font-weight: 900;
    color: var(--slate-400);
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.progress-track {
    height: 12px;
    background: var(--slate-100);
    border-radius: 99px;
    border: 1px solid var(--slate-200);
    padding: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary-blue);
    border-radius: 99px;
    width: 0%;
    transition: width 0.3s ease;
}

.loading-active .progress-bar {
    width: 100%;
    animation: progressAnimate 2s ease-in-out infinite;
}

/* Results View */
.results-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    border-bottom: 1px solid var(--slate-200);
    padding-bottom: 24px;
    margin-bottom: 40px;
}

.results-title {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: -0.05em;
    color: var(--slate-900);
}

.success-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--emerald-600);
    font-size: 14px;
    font-weight: 900;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-3xl);
    padding: 32px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
    transition: all 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05);
}

.stat-card.blue {
    background: var(--primary-blue);
    border: none;
    box-shadow: 0 20px 30px -5px rgba(37, 99, 235, 0.2);
}

.stat-card.blue .stat-label, 
.stat-card.blue .stat-value {
    color: var(--white);
}

.stat-card.green {
    background: var(--emerald-500);
    border: none;
    box-shadow: 0 20px 30px -5px rgba(16, 185, 129, 0.2);
}

.stat-card.green .stat-label, 
.stat-card.green .stat-value {
    color: var(--white);
}

.stat-label {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.2em;
    color: var(--slate-400);
    margin-bottom: 16px;
}

.stat-value {
    font-size: 32px;
    font-weight: 900;
    color: var(--slate-900);
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 64px;
}

.slide-card {
    background: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-3xl);
    padding: 32px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
}

.slide-preview {
    aspect-ratio: 16/9;
    background: var(--slate-50);
    border-radius: 12px;
    border: 1px solid var(--slate-200);
    overflow: hidden;
    position: relative;
}

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

.pdf-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--slate-400);
    font-weight: 700;
    font-size: 12px;
    background: #f1f5f9;
}

.slide-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.slide-header h4 {
    font-size: 14px;
    font-weight: 900;
}

.char-count {
    font-size: 11px;
    font-weight: 700;
    color: var(--slate-400);
    background: var(--slate-50);
    padding: 2px 8px;
    border-radius: 99px;
}

.script-text {
    font-size: 16px;
    line-height: 1.8;
    color: var(--slate-800);
    background: #fafafa;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--slate-200);
    outline: none;
    transition: all 0.2s;
}

.script-text:focus {
    background: var(--white);
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 2px #eff6ff;
}

.action-footer {
    border-top: 1px solid var(--slate-200);
    padding-top: 64px;
    text-align: center;
}

.footer-cta-card {
    background: var(--white);
    border: 1px solid var(--slate-100);
    border-radius: var(--radius-4xl);
    padding: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    margin-bottom: 40px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.08);
}

.footer-title {
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 8px;
}

.footer-desc {
    font-size: 14px;
    color: var(--slate-500);
}

.export-btn {
    background: var(--slate-900);
    color: var(--white);
    border: none;
    border-radius: 16px;
    padding: 20px 40px;
    font-weight: 900;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.export-btn:hover {
    background: var(--primary-blue);
    transform: translateY(-2px);
}

.reset-link {
    background: none;
    border: none;
    color: var(--slate-400);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    padding-bottom: 2px;
    border-bottom: 2px solid var(--slate-200);
    transition: all 0.2s;
}

.reset-link:hover {
    color: var(--slate-800);
    border-color: var(--slate-800);
}

/* Right Panel */
.panel-right {
    width: 340px;
    border-left: 1px solid var(--slate-200);
    background: var(--slate-50);
    padding: 32px;
    flex-shrink: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content.collapsed-right .panel-right {
    width: 0;
    padding: 0;
    border-left: none;
    opacity: 0;
    pointer-events: none;
    margin-right: -20px;
}

.insight-item {
    margin-bottom: 32px;
}

.insight-title {
    font-size: 12px;
    font-weight: 900;
    color: var(--slate-800);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.dot.blue { background: var(--primary-blue); }

.insight-text {
    font-size: 11px;
    color: var(--slate-500);
    line-height: 1.6;
    font-weight: 700;
}

.insight-card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.small-card {
    background: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: 16px;
    padding: 16px;
}

.card-tag {
    display: inline-block;
    font-size: 9px;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.card-tag.pro { background: #eff6ff; color: var(--primary-blue); }
.card-tag.casual { background: #fffbeb; color: #b45309; }

.card-text {
    font-size: 11px;
    color: var(--slate-600);
    line-height: 1.5;
    font-weight: 500;
}

/* Icons Colors */
.icon-blue { color: var(--primary-blue); }
.icon-tiny { width: 14px; height: 14px; }
.icon-small { width: 12px; height: 12px; }

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes progressAnimate {
    0% { width: 0%; }
    50% { width: 100%; }
    100% { width: 0%; }
}

.export-btn.large {
    width: 100%;
    justify-content: center;
    padding: 24px;
    font-size: 18px;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.2);
}

.cta-button-clear {
    background: none;
    border: 2px solid var(--slate-800);
    color: var(--slate-800);
    border-radius: 12px;
    padding: 10px 20px;
    font-size: 11px;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.cta-button-clear:hover {
    background: var(--slate-900);
    color: var(--white);
}

.export-action {
    display: flex;
    justify-content: center;
}

@media (max-width: 1200px) {
    .panel-right { display: none; }
}
