/* 
 * AI PDF Summarizer - Style
 * Theme: Clean, Professional, Trustworthy (Blue/Grey)
 */

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

:root {
    --primary: #2563EB;
    /* Royal Blue */
    --primary-dark: #1E40AF;
    --bg: #F8FAFC;
    /* Slate 50 */
    --surface: #FFFFFF;
    --text: #334155;
    /* Slate 700 */
    --heading: #1E293B;
    /* Slate 800 */
    --border: #E2E8F0;
}

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

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--heading);
    display: flex;
    align-items: center;
    gap: 8px;
}

.api-status-badge {
    font-size: 0.85rem;
    padding: 4px 12px;
    border-radius: 20px;
    background: #F1F5F9;
    color: #64748B;
    cursor: pointer;
    transition: all 0.2s;
}

.api-status-badge.active {
    background: #DCFCE7;
    color: #166534;
}

.main-container {
    flex: 1;
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 24px;
    gap: 24px;
    height: calc(100vh - 70px);
}

/* Left: Upload Section */
.upload-section {
    flex: 1;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s;
}

.upload-zone {
    width: 100%;
    height: 100%;
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    background: #F8FAFC;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: #EFF6FF;
}

.upload-icon {
    font-size: 3rem;
    color: #94A3B8;
    margin-bottom: 16px;
}

.upload-btn {
    margin-top: 16px;
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* Right: Result Section */
.result-section {
    flex: 1.2;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.result-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #FAFAFA;
}

.result-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    font-size: 1rem;
}

/* Markdown Styles */
.result-content h1 {
    font-size: 1.8rem;
    margin-bottom: 16px;
    color: var(--heading);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
}

.result-content h2 {
    font-size: 1.4rem;
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--heading);
}

.result-content ul {
    padding-left: 20px;
    margin-bottom: 16px;
}

.result-content li {
    margin-bottom: 8px;
}

.result-content p {
    margin-bottom: 16px;
    color: var(--text);
}

.result-content code {
    background: #F1F5F9;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: #0F172A;
}

.result-content hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 32px 0;
}

/* Loading State */
.loading-overlay {
    background: rgba(255, 255, 255, 0.9);
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid #E2E8F0;
    border-bottom-color: var(--primary);
    border-radius: 50%;
    animation: rotation 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#statusMessage {
    font-weight: 500;
    color: var(--text);
}

/* Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-box {
    background: white;
    padding: 24px;
    border-radius: 12px;
    width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.input-full {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin: 12px 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        height: auto;
    }

    .upload-section {
        min-height: 250px;
    }

    .result-section {
        min-height: 500px;
    }
}