@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #6366f1;
    --success: #10b981;
    --success-hover: #059669;
    
    --bg-base: #f8fafc;
    --panel-bg: #ffffff;
    --panel-border: #e2e8f0;
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --shadow-hover: 0 20px 25px -5px rgb(0 0 0 / 0.05), 0 8px 10px -6px rgb(0 0 0 / 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--bg-base);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Header */
header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--panel-border);
    animation: fadeInDown 0.6s ease-out;
}

@media (min-width: 640px) {
    header {
        padding-bottom: 2rem;
        margin-bottom: 2rem;
    }
}

.logo {
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 0.75rem;
    border-radius: 1rem;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo svg {
    stroke: white;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

/* Main Layout */
main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

@media (min-width: 960px) {
    main {
        grid-template-columns: 360px 1fr;
        align-items: start;
    }
}

/* Panels */
.panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 1.25rem;
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.panel:hover {
    box-shadow: var(--shadow-lg);
}

.panel h2 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input, select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 0.75rem;
    font-size: 1rem;
    color: var(--text-main);
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02) inset;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

input::placeholder {
    color: #94a3b8;
}

option {
    background: white;
    color: var(--text-main);
}

/* Buttons */
button {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.2);
    margin-top: 0.5rem;
}

button:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(79, 70, 229, 0.3);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #cbd5e1;
    box-shadow: none;
}

.panel-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 1.25rem;
}

@media (min-width: 640px) {
    .panel-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.panel-header h2 {
    margin-bottom: 0;
}

#downloadBtn {
    width: auto;
    margin-top: 0;
    padding: 0.6rem 1.25rem;
    font-size: 0.95rem;
    background: var(--success);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

#downloadBtn:hover:not(:disabled) {
    background: var(--success-hover);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.3);
}

.hidden {
    display: none !important;
}

/* States & Loading */
.error {
    margin-top: 1.25rem;
    padding: 1rem;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease;
}

.empty-state, #loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: var(--text-muted);
    text-align: center;
    background: #f1f5f9;
    border-radius: 1rem;
    border: 2px dashed var(--panel-border);
}

.empty-state svg {
    opacity: 0.5;
    margin-bottom: 1.25rem;
    width: 56px;
    height: 56px;
    color: var(--primary);
}

.spinner {
    border: 3px solid rgba(79, 70, 229, 0.15);
    border-left-color: var(--primary);
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Slide Cards List */
.plan-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Custom Scrollbar */
.plan-list::-webkit-scrollbar {
    width: 6px;
}
.plan-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}
.plan-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
.plan-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Individual Slide Card */
.slide-card {
    background: white;
    border: 1px solid var(--panel-border);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    animation: slideInRight 0.4s ease backwards;
}

.slide-card:hover {
    border-color: #c7d2fe;
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

/* Staggered animations */
.slide-card:nth-child(1) { animation-delay: 0.05s; }
.slide-card:nth-child(2) { animation-delay: 0.1s; }
.slide-card:nth-child(3) { animation-delay: 0.15s; }
.slide-card:nth-child(4) { animation-delay: 0.2s; }
.slide-card:nth-child(n+5) { animation-delay: 0.25s; }

.slide-meta {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: #eef2ff;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 2rem;
    margin-bottom: 1rem;
}

.slide-card h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    line-height: 1.3;
}

.slide-card p.subtitle {
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Card Content: Bullets, Body, Table */
.slide-card ul {
    padding-left: 1.25rem;
    margin-bottom: 1.25rem;
    color: #334155;
}

.slide-card ul li {
    margin-bottom: 0.5rem;
}

.slide-body {
    color: #334155;
    margin-bottom: 1.25rem;
    font-size: 1rem;
    line-height: 1.7;
}

.slide-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 1.25rem;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid var(--panel-border);
}

.slide-table th, .slide-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--panel-border);
}

.slide-table tr:last-child td {
    border-bottom: none;
}

.slide-table th {
    background: #f8fafc;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9rem;
}

.slide-table td {
    color: #475569;
    font-size: 0.95rem;
}

/* Accessories */
.visual-suggestion {
    margin-top: 1.25rem;
    padding: 0.875rem 1rem;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    color: #059669;
    display: flex;
    align-items: center;
}

.speaker-notes {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px dashed var(--panel-border);
    font-size: 0.95rem;
    color: #64748b;
    font-style: italic;
    background: url('data:image/svg+xml;utf8,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%2394a3b8" stroke-width="2" xmlns="http://www.w3.org/2000/svg"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>') no-repeat top 1.25rem left;
    padding-left: 2.25rem;
}

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

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

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

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