@charset "UTF-8";

/* **************************************************************************
   Sangsang Patents - Modern AI Patent Generator UI
   Theme: Deep Dark Glassmorphism, Futuristic Cyber-Glow
   ************************************************************************** */

/* --- CSS Variables --- */
:root {
    /* Colors */
    --bg-base: #F9FAFB;
    --glass-bg: #FFFFFF;
    --glass-border: #E5E7EB;
    --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    
    --accent-cyan: #D4AF37;   /* Gold */
    --accent-purple: #B8860B; /* Dark Gold */
    --accent-blue: #F3E5AB;   /* Champagne Gold */
    --status-green: #10B981;
    --error-red: #EF4444;
    
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --text-dark: #111827;
    
    /* Typography */
    --font-primary: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    
    /* Animation & Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Reset & Base Styles --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.6;
    letter-spacing: -0.015em;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #F3F4F6;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* --- Ambient Background Effects (Hidden for Simple Theme) --- */
.ambient-bg {
    display: none;
}

/* --- Main Layout Wrapper --- */
.app-wrapper {
    max-width: 1600px;
    margin: 0 auto;
    padding: 32px 48px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    min-height: 100vh;
}

/* --- Header Styles --- */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    position: relative;
    z-index: 1000;
}

.app-footer {
    text-align: center;
    padding: 24px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
    margin-top: 16px;
    border-top: 1px solid var(--glass-border);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border-radius: 12px;
    box-shadow: none;
}

.logo-icon svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-main);
}

.logo-text span {
    color: var(--accent-purple);
    font-weight: 800;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    background: #F9FAFB;
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
}

.status-dot {
    width: 10px;
    height: 10px;
    background-color: var(--status-green);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--status-green);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* --- Main Content Layout (Grid) --- */
.main-content {
    display: grid;
    grid-template-columns: 4.5fr 7.5fr;
    gap: 32px;
    align-items: stretch;
    flex-grow: 1;
}

/* --- Glass Panel Base --- */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 40px;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
}

/* --- Input Section (Left Panel) --- */
.input-section {
    gap: 28px;
}

.panel-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}

.panel-header p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

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

.form-group label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
}

.form-group textarea {
    width: 100%;
    background: #FFFFFF;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    color: var(--text-main);
    font-family: var(--font-primary);
    font-size: 1rem;
    resize: vertical;
    min-height: 160px;
    transition: var(--transition-fast);
}

.form-group textarea::placeholder {
    color: #9CA3AF;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-cyan);
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.15);
}

/* File Upload Drop Zone */
.file-upload-wrapper {
    background: #FAFAFA;
    border: 2px dashed #D1D5DB;
    border-radius: 16px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.file-upload-wrapper:hover, .file-upload-wrapper.dragover {
    background: #FDFBF7;
    border-color: var(--accent-cyan);
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--accent-cyan);
    opacity: 0.8;
    transition: var(--transition-fast);
}

.file-upload-wrapper:hover .upload-icon {
    transform: translateY(-4px);
    opacity: 1;
}

.upload-text {
    font-size: 1.05rem;
    color: var(--text-main);
}

.upload-text strong {
    color: var(--accent-cyan);
    font-weight: 600;
}

.upload-subtext {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.file-list {
    list-style: none;
    width: 100%;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Primary Button */
.primary-btn {
    margin-top: auto;
    width: 100%;
    padding: 20px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-purple) 100%);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.primary-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: var(--transition-smooth);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.4);
}

.primary-btn:hover::before {
    left: 100%;
    transition: 0.6s;
}

.primary-btn:active {
    transform: translateY(0);
}

.btn-icon {
    width: 24px;
    height: 24px;
}

/* --- Output Section (Right Panel) --- */
.output-section {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow: hidden;
}

/* Utility Hidden Class */
.hidden {
    display: none !important;
}

/* Empty State */
.empty-state {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 16px;
    opacity: 0.6;
    animation: fadeIn var(--transition-smooth);
}

.empty-state svg {
    width: 80px;
    height: 80px;
    color: var(--text-muted);
    stroke-width: 1;
    margin-bottom: 8px;
    animation: float-slight 4s ease-in-out infinite;
}

@keyframes float-slight {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-main);
}

.empty-state p {
    color: var(--text-muted);
    max-width: 300px;
    line-height: 1.6;
}

/* Progress Container */
.progress-container {
    background: #FAFAFA;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 32px;
    animation: slideDown var(--transition-smooth);
}

.progress-track {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 2;
}

.step-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 2px solid var(--glass-border);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.step.active .step-icon {
    background: var(--accent-cyan);
    border-color: var(--accent-purple);
    color: #fff;
    box-shadow: none;
}

.step.completed .step-icon {
    background: var(--status-green);
    border-color: var(--status-green);
    color: #fff;
}

.step-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
    transition: var(--transition-fast);
}

.step.active .step-label {
    color: var(--text-main);
    font-weight: 600;
}

.step-line {
    flex-grow: 1;
    height: 2px;
    background: var(--glass-border);
    margin: 0 16px;
    transform: translateY(-16px);
    position: relative;
    z-index: 1;
}

/* Progress line fill animation style hook */
.step-line.active {
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
    box-shadow: none;
}

.progress-status-text {
    text-align: center;
    font-size: 1rem;
    color: var(--accent-purple);
    background: #FDFBF7;
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
}

/* Result Container */
.result-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 12px;
    animation: fadeIn var(--transition-smooth);
}

.result-block {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.result-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
}

.result-title svg {
    width: 24px;
    height: 24px;
    color: var(--accent-cyan);
}

.content-box {
    background: #FAFAFA;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    color: var(--text-main);
    font-size: 1rem;
    line-height: 1.7;
}

#download-pdf-btn:hover {
    background: #E5E7EB !important;
    border-color: #9CA3AF !important;
    color: #111827 !important;
}

/* Markdown specific styles inside .markdown-viewer */
.markdown-viewer h1, .markdown-viewer h2, .markdown-viewer h3,
.markdown-viewer h4, .markdown-viewer h5, .markdown-viewer h6 {
    color: var(--text-dark);
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    font-weight: 700;
}

.markdown-viewer h1 { font-size: 1.75em; }
.markdown-viewer h2 { font-size: 1.5em; border-bottom: 1px solid var(--glass-border); padding-bottom: 0.3em; }
.markdown-viewer h3 { font-size: 1.25em; color: var(--accent-purple); }

.markdown-viewer p {
    margin-bottom: 1.2em;
    color: var(--text-main);
}

.markdown-viewer ul, .markdown-viewer ol {
    margin-bottom: 1.2em;
    padding-left: 1.5em;
}

.markdown-viewer li {
    margin-bottom: 0.5em;
    color: var(--text-main);
}

.markdown-viewer strong {
    color: var(--accent-cyan);
    font-weight: 600;
}

/* --- Modal Styles for Main Page --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    display: flex; justify-content: center; align-items: center;
    z-index: 9999; opacity: 1; transition: opacity var(--transition-smooth); padding: 24px;
}
.modal-overlay.hidden { display: none !important; opacity: 0; }
.modal-container {
    background: var(--glass-bg); width: 100%; max-height: 90vh;
    border-radius: 32px; border: 1px solid var(--glass-border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
    display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden;
    animation: scaleUp var(--transition-smooth);
}
.modal-header {
    padding: 24px 32px; border-bottom: 1px solid var(--glass-border);
    display: flex; justify-content: space-between; align-items: center; background: #FAFAFA;
}
.modal-header h3 { font-size: 1.4rem; font-weight: 700; color: var(--text-main); display: flex; align-items: center; gap: 12px; }
.modal-header h3 svg { color: var(--accent-cyan); }
.close-btn {
    background: #FFFFFF; border: 1px solid var(--glass-border);
    width: 44px; height: 44px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    color: var(--text-muted); cursor: pointer; transition: var(--transition-fast);
}
.close-btn:hover { background: #F3F4F6; color: var(--error-red); transform: rotate(90deg); }
.modal-body { padding: 40px; overflow-y: auto; flex-grow: 1; background: #FFFFFF; }
@keyframes scaleUp { from { transform: scale(0.95) translateY(20px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }

#settings-btn:hover { color: var(--accent-cyan) !important; transform: rotate(45deg); }

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

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

/* --- Responsive Layout --- */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 5fr 7fr;
    }
}

@media (max-width: 992px) {
    .app-wrapper {
        padding: 24px;
    }

    .main-content {
        grid-template-columns: 1fr;
    }

    .glass-panel {
        padding: 32px 24px;
    }

    .output-section {
        min-height: 600px;
    }

    .shape-1, .shape-2, .shape-3 {
        width: 80vw;
        height: 80vw;
    }
}

@media (max-width: 600px) {
    .app-wrapper {
        padding: 16px;
    }
    
    .app-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        border-radius: 16px;
        padding: 16px;
    }

    .panel-header h2 {
        font-size: 1.5rem;
    }

    .progress-track {
        flex-direction: column;
        gap: 16px;
    }
    
    .step-line {
        width: 2px;
        height: 32px;
        margin: 0;
        transform: translateY(0);
    }

    .modal-container {
        max-height: 95vh;
        border-radius: 20px;
    }

    .modal-header {
        padding: 16px;
    }

    .modal-body {
        padding: 20px 16px;
    }

    .form-group textarea {
        min-height: 120px;
    }

    .header-status {
        flex-direction: column;
        width: 100%;
        padding: 12px;
        gap: 12px;
    }
}
```