/* Document Converter Styles */
:root {
    --primary-color: #266969;
    --primary-light: #4a9a9a;
    --accent-color: #0078d7;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --error-color: #dc3545;
    --text-color: #333;
    --text-muted: #666;
    --border-color: #ddd;
    --bg-light: #f8f9fa;
    --surface: #ffffff;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --radius: 8px;
}

/* Ensure proper layout for this page */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.converter-main {
    flex: 1;
    padding: 2rem 0 4rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Conversion Info Section */
.conversion-info {
    text-align: center;
    margin-bottom: 3rem;
}

.conversion-badges {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.conversion-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface);
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary-color);
}

.badge-icon {
    font-size: 1.2rem;
}

/* Upload Section */
.upload-section {
    margin-bottom: 3rem;
}

.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    background: var(--surface);
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: var(--bg-light);
}

.upload-area.drag-over {
    border-color: var(--accent-color);
    background: rgba(0, 120, 215, 0.05);
    transform: scale(1.02);
}

.upload-content {
    max-width: 400px;
    margin: 0 auto;
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    color: var(--primary-color);
}

.upload-icon svg {
    width: 100%;
    height: 100%;
}

.upload-area h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
    font-size: 1.5rem;
}

.upload-area p {
    margin: 0.5rem 0;
    color: var(--text-muted);
}

.supported-formats {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 8px 0 4px;
    font-weight: 500;
}

.upload-limits {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 4px 0 16px;
}

.browse-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: var(--radius);
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.browse-btn:hover {
    background: var(--primary-light);
}

/* Conversion Section */
.conversion-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.conversion-container {
    max-width: 1000px;
    margin: 0 auto;
}

.file-preview {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-light);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.preview-header h3 {
    margin: 0;
    color: var(--text-color);
}

.file-info {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    align-items: center;
}

.file-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
}

.file-details {
    display: grid;
    gap: 0.25rem;
}

.file-name {
    font-weight: 500;
    color: var(--text-color);
    font-size: 1.1rem;
}

.file-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Conversion Options */
.conversion-options h3 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
}

.format-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.format-option {
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.format-option:hover {
    border-color: var(--primary-color);
    background: var(--bg-light);
}

.format-option.selected {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.format-option .format-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.format-option .format-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.format-option .format-desc {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Settings Panel */
.settings-panel {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.settings-panel h4 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
}

.setting-group {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.setting-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
    font-size: 0.9rem;
}

.setting-group input[type="range"] {
    flex: 1;
    max-width: 200px;
}

.setting-group select {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--surface);
}

/* Convert Actions */
.convert-actions {
    text-align: center;
}

/* Buttons */
.primary-btn,
.secondary-btn,
.tertiary-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

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

.primary-btn:hover:not(:disabled) {
    background: var(--primary-light);
}

.primary-btn:disabled {
    background: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
}

.secondary-btn {
    background: var(--surface);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

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

.tertiary-btn {
    background: var(--bg-light);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.tertiary-btn:hover {
    background: var(--border-color);
    color: var(--text-color);
}

.primary-btn svg,
.secondary-btn svg,
.tertiary-btn svg {
    width: 18px;
    height: 18px;
}

/* Processing Section */
.processing-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.processing-container h3 {
    margin: 0 0 2rem 0;
    color: var(--text-color);
}

.progress-container {
    max-width: 400px;
    margin: 0 auto 2rem;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.conversion-details {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

/* Results Section */
.results-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 4rem;
    box-shadow: var(--shadow);
}

.results-header {
    text-align: center;
    margin-bottom: 2rem;
}

.results-header h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
}

.conversion-summary {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.result-preview {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.download-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Loading and Toast styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
    padding: 2rem;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 300px;
}

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

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

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
    min-width: 300px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--error-color);
}

.toast.warning {
    border-left-color: var(--warning-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .conversion-badges {
        flex-direction: column;
        align-items: center;
    }
    
    .format-grid {
        grid-template-columns: 1fr;
    }
    
    .preview-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .file-info {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 0.5rem;
    }
    
    .download-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .progress-text {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .conversion-section,
    .processing-section,
    .results-section {
        padding: 1rem;
    }
    
    .converter-main {
        padding-bottom: 6rem;
    }
    
    .conversion-badges {
        gap: 0.5rem;
    }
    
    .conversion-badge {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .toast {
        min-width: 250px;
    }
}
