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

:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --secondary-color: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --error-color: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo svg {
    width: 32px;
    height: 32px;
}

.language-selector select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.language-selector select:hover {
    border-color: var(--primary-color);
}

.language-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.main {
    padding: 2rem 0 4rem;
    min-height: calc(100vh - 140px);
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

.hero h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero p {
    font-size: 1.125rem;
    opacity: 0.95;
}

.app-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.input-section h3,
.output-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.input-controls {
    margin-bottom: 1rem;
}

.delimiter-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--secondary-color);
    border-radius: 6px;
}

.delimiter-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 14px;
}

.delimiter-group input[type="radio"] {
    cursor: pointer;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 0.5rem;
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.data-input {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    resize: vertical;
    transition: border-color 0.2s;
}

.data-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.sample-buttons {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-large {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

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

.style-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.style-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.style-group label {
    font-size: 14px;
    font-weight: 500;
    min-width: 120px;
}

.style-group select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.style-group select:hover {
    border-color: var(--primary-color);
}

.style-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.preview-card {
    margin-top: 1rem;
}

.table-preview {
    overflow-x: auto;
    padding: 1rem;
    background: var(--secondary-color);
    border-radius: 6px;
    min-height: 200px;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem;
}

.export-buttons {
    display: flex;
    gap: 0.5rem;
}

.code-output {
    margin-top: 1rem;
}

.code-tabs {
    display: flex;
    gap: 2px;
    background: var(--secondary-color);
    padding: 2px;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.tab-button {
    flex: 1;
    padding: 8px 16px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.tab-button.active {
    background: white;
    box-shadow: var(--shadow-sm);
}

.tab-button:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.5;
}

.tab-content code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.footer {
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 12px 20px;
    background: var(--success-color);
    color: white;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    transform: translateX(400px);
    transition: transform 0.3s;
    z-index: 1000;
}

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

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

@media (max-width: 968px) {
    .app-grid {
        grid-template-columns: 1fr;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
}

@media (max-width: 640px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero h2 {
        font-size: 1.5rem;
    }
    
    .delimiter-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .style-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .style-group label {
        min-width: auto;
    }
    
    .export-buttons {
        flex-direction: column;
    }
    
    .toast {
        right: 1rem;
        left: 1rem;
        transform: translateY(100px);
    }
    
    .toast.show {
        transform: translateY(0);
    }
}