.presentation-maker-container {
    display: flex;
    width: 100%;
    height: 100%;
    background: var(--bg-main);
    box-sizing: border-box;
}

.pm-left-panel {
    width: 25%;
    min-width: 350px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
}

.pm-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pm-title-row h2 {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.pm-title-row p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pm-model-selectors {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pm-form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pm-form-group label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.pm-select {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.pm-select:focus {
    border-color: var(--primary-color);
}

.pm-chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pm-welcome-message {
    background: var(--bg-surface-hover);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.pm-welcome-message h3 {
    margin: 0 0 10px 0;
    color: var(--primary-color);
}

.pm-welcome-message p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.pm-message {
    display: flex;
    gap: 12px;
    animation: fadeIn 0.3s ease-out;
}

.pm-message.pm-message-user {
    flex-direction: row-reverse;
}

.pm-msg-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-surface-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    border: 1px solid var(--border-color);
}

.pm-message-ai .pm-msg-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-hover));
    color: white;
    border: none;
}

.pm-msg-content {
    background: var(--bg-surface-hover);
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 80%;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.pm-message-user .pm-msg-content {
    background: var(--primary-color);
    color: white;
}

.pm-message-error .pm-msg-content {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Typing indicator */
.pm-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.pm-typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: pmTyping 1.4s infinite ease-in-out both;
}

.pm-typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.pm-typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes pmTyping {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.pm-input-area {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-surface);
}

.pm-input-wrapper {
    display: flex;
    gap: 10px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px;
    transition: border-color 0.2s;
}

.pm-input-wrapper:focus-within {
    border-color: var(--primary-color);
}

.pm-input-wrapper textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    height: 48px;
    padding: 14px 8px;
    outline: none;
}

.pm-icon-btn {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: none;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.pm-icon-btn:hover {
    opacity: 0.9;
}

.pm-right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-main);
    overflow: hidden;
}

.pm-preview-header {
    height: 60px;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface);
}

.pm-preview-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.pm-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.pm-btn-primary {
    background: var(--primary-color);
    color: white;
}

.pm-btn-primary:hover:not(:disabled) {
    opacity: 0.9;
}

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

.pm-preview-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.pm-empty-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: var(--text-muted);
    gap: 15px;
}

/* Slide Preview Renderer */
.pm-slide-preview {
    width: 100%;
    max-width: 860px;
    aspect-ratio: 16 / 9;
    height: auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.12), 0 0 1px rgba(0,0,0,0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
}

.pm-slide-preview:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 30px 80px rgba(0,0,0,0.18);
}

.pm-slide-number {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 12px;
    color: #888;
    font-family: sans-serif;
    z-index: 10;
}

.pm-slide-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

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

.pm-slide-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.6)); /* subtle gradient overlay */
    z-index: 2;
}

.pm-slide-preview.has-bg .pm-slide-content {
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    margin: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pm-slide-preview.has-bg .pm-slide-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0));
    pointer-events: none;
    border-radius: inherit;
}

.pm-slide-preview.has-bg .pm-slide-number {
    color: rgba(255,255,255,0.7);
    bottom: 30px;
    right: 30px;
}

.pm-slide-preview.has-bg .title-layout h2,
.pm-slide-preview.has-bg .content-layout h3 {
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.pm-slide-preview.has-bg .title-layout .subtitle {
    color: #eee;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

.pm-slide-preview.has-bg .content-layout .bullets {
    color: white;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

.pm-slide-content {
    padding: 40px 50px;
    flex: 1;
    display: flex;
    flex-direction: column;
    color: #333;
    font-family: 'Inter', sans-serif;
    z-index: 5;
    position: relative;
}

/* Title Layout */
.pm-slide-title-type .title-layout {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.title-layout h2 {
    font-size: 48px;
    margin: 0 0 20px 0;
    color: #111;
    line-height: 1.2;
}

.title-layout .subtitle {
    font-size: 24px;
    margin: 0;
    color: #666;
}

/* Content Layout */
.content-layout h3 {
    font-size: 36px;
    margin: 0 0 25px 0;
    font-weight: 800;
    color: #111;
    letter-spacing: -0.5px;
}

.pm-slide-preview:not(.has-bg) .content-layout h3::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    margin-top: 15px;
    border-radius: 2px;
}

.content-layout .bullets {
    margin: 0;
    padding-left: 25px;
    font-size: 22px;
    line-height: 1.6;
    color: #333;
}

.content-layout .bullets li {
    margin-bottom: 15px;
}
