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

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --accent-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e9f2 50%, #f0f4f8 100%);
    min-height: 100vh;
    padding-bottom: 0;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Navigation - Modern Glass Effect */
.top-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 18px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    font-size: 22px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 10px 20px;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 14px;
}

.nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.nav-link.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.nav-user {
    position: relative;
}

.nav-user .user-button {
    padding: 10px 20px;
    background: var(--secondary-gradient);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
}

.nav-user .user-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    min-width: 220px;
    display: none;
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown.show {
    display: block;
    animation: fadeInScale 0.2s ease-out;
}

.dropdown-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.dropdown-header p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.dropdown-item {
    width: 100%;
    padding: 14px 16px;
    background: none;
    border: none;
    text-align: left;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 500;
}

.dropdown-item:hover {
    background: var(--bg-tertiary);
}

/* Welcome Section - Modern Hero */
.welcome-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 40px 40px;
}

.welcome-content {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.welcome-badge {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    animation: fadeInUp 0.6s ease-out;
}

.welcome-title {
    font-size: 56px;
    font-weight: 800;
    margin-bottom: 24px;
    line-height: 1.1;
    color: var(--text-primary);
    letter-spacing: -1.5px;
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-subtitle {
    font-size: 20px;
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

/* Container - Modern Card */
.container {
    max-width: 1400px;
    margin: 0 auto 40px;
    background: var(--bg-primary);
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(229, 231, 235, 0.5);
    padding: 40px;
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--bg-tertiary);
}

.header-left {
    flex: 1;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.section-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Source Tabs */
.source-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.tab-btn {
    flex: 1;
    min-width: 120px;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    border-color: #667eea;
    background: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.tab-btn.active {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-lg);
}

.tab-icon {
    font-size: 24px;
}

.tab-label {
    font-size: 14px;
    font-weight: 600;
}

/* Input Section */
.input-section {
    margin-bottom: 40px;
}

.input-panel {
    display: none;
}

.input-panel.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.input-panel label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.input-panel textarea {
    width: 100%;
    min-height: 280px;
    padding: 20px;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
}

.input-panel textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.input-panel textarea::placeholder {
    color: var(--text-muted);
}

.char-count {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* URL Input */
.url-input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.url-input-group input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s;
}

.url-input-group input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.btn-fetch {
    padding: 14px 28px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow-md);
}

.btn-fetch:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-fetch:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.url-preview {
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

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

.preview-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-clear {
    padding: 8px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-clear:hover {
    background: var(--bg-tertiary);
}

.preview-content {
    max-height: 300px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* File Upload */
.file-upload-area {
    padding: 60px 40px;
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    text-align: center;
    background: var(--bg-secondary);
    transition: all 0.3s;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.upload-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upload-formats {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.btn-browse {
    padding: 12px 24px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow-md);
}

.btn-browse:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.file-preview {
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.file-icon {
    font-size: 32px;
}

.file-details h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.file-details p {
    font-size: 13px;
    color: var(--text-muted);
}

.btn-remove {
    margin-left: auto;
    padding: 8px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-remove:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* Options Section */
.options-section {
    margin-bottom: 40px;
}

.option-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.option-card {
    padding: 24px 20px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.option-card:hover {
    border-color: #667eea;
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.option-card.active {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.option-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.option-card h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.option-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Action Section */
.action-section {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.btn-primary {
    padding: 16px 40px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    display: none;
}

/* Output Section */
.output-section {
    margin-top: 40px;
    padding: 32px;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    animation: fadeIn 0.3s ease-out;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.output-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.output-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    padding: 10px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    border-color: #667eea;
    transform: translateY(-1px);
}

.loading-indicator {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.loading-indicator.show {
    display: flex;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

.loading-indicator p {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
}

.output-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
}

.output-content h1,
.output-content h2,
.output-content h3 {
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-weight: 700;
}

.output-content h1 {
    font-size: 24px;
}

.output-content h2 {
    font-size: 20px;
}

.output-content h3 {
    font-size: 18px;
}

.output-content ul,
.output-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.output-content li {
    margin: 8px 0;
}

.output-content p {
    margin: 12px 0;
}

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

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 32px;
    }
    
    .welcome-title {
        font-size: 48px;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 16px 24px;
    }
    
    .nav-links {
        gap: 4px;
    }
    
    .nav-link {
        padding: 8px 12px;
        font-size: 13px;
    }

    .welcome-section {
        padding: 40px 24px 30px;
    }
    
    .welcome-title {
        font-size: 36px;
    }
    
    .welcome-subtitle {
        font-size: 17px;
    }

    .container {
        padding: 24px;
        border-radius: 20px;
    }

    .section-header {
        flex-direction: column;
        gap: 12px;
    }

    .section-title {
        font-size: 24px;
    }

    .source-tabs {
        flex-direction: column;
    }

    .tab-btn {
        width: 100%;
    }

    .url-input-group {
        flex-direction: column;
    }

    .option-cards {
        grid-template-columns: 1fr;
    }

    .output-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .output-actions {
        width: 100%;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .welcome-title {
        font-size: 28px;
    }
}
