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

body {
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, 'Courier New', monospace;
    background: #0d1117;
    color: #c9d1d9;
    line-height: 1.6;
    min-height: 100vh;
}

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

header {
    text-align: center;
    padding: 60px 20px 40px;
    border-bottom: 1px solid #30363d;
}

header h1 {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #58a6ff 0%, #3fb950 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

header p {
    font-size: 1.1em;
    color: #8b949e;
    font-weight: 400;
}

/* Instructions */
.instructions {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    margin: 20px 40px;
    overflow: hidden;
}

.instructions-header {
    padding: 16px 20px;
    background: #0d1117;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #58a6ff;
    border-bottom: 1px solid #30363d;
    transition: background 0.2s;
}

.instructions-header:hover {
    background: #161b22;
}

.instructions-content {
    padding: 20px;
}

.instructions-content ol {
    margin: 0 0 20px 0;
    padding-left: 20px;
    color: #8b949e;
}

.instructions-content li {
    margin-bottom: 12px;
    line-height: 1.6;
}

.instructions-content strong {
    color: #c9d1d9;
}

.tips {
    background: #1c2128;
    border-left: 3px solid #58a6ff;
    padding: 15px;
    border-radius: 4px;
    margin-top: 15px;
}

.tips strong {
    color: #58a6ff;
}

.tips ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.tips li {
    margin-bottom: 8px;
    color: #8b949e;
}

/* Upload Section */
.upload-section {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 40px;
    margin: 20px 40px;
}

.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #58a6ff;
    font-size: 0.95em;
    letter-spacing: 0.5px;
}

input[type="text"],
select {
    width: 100%;
    padding: 12px 16px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95em;
    transition: all 0.2s;
}

input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: #58a6ff;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

input[type="text"]::placeholder {
    color: #484f58;
}

input[type="file"] {
    display: none;
}

.file-upload-label {
    display: block;
    padding: 40px 20px;
    background: #0d1117;
    border: 2px dashed #30363d;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    color: #8b949e;
}

.file-upload-label:hover {
    border-color: #58a6ff;
    background: #161b22;
}

.file-name {
    display: block;
    margin-top: 12px;
    color: #3fb950;
    font-weight: 600;
    font-size: 0.9em;
}

.dialect-select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2358a6ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

.help-text {
    display: block;
    margin-top: 6px;
    font-size: 0.85em;
    color: #484f58;
}

/* Buttons */
.btn-primary {
    background: #238636;
    color: #ffffff;
    padding: 14px 32px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.5px;
    box-shadow: 0 0 0 0 rgba(35, 134, 54, 0);
}

.btn-primary:hover {
    background: #2ea043;
    box-shadow: 0 0 0 3px rgba(35, 134, 54, 0.3);
}

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

.btn-secondary {
    background: #21262d;
    color: #c9d1d9;
    padding: 12px 24px;
    border: 1px solid #30363d;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'JetBrains Mono', monospace;
}

.btn-secondary:hover {
    background: #30363d;
    border-color: #484f58;
}

.btn-copy {
    background: #21262d;
    color: #58a6ff;
    padding: 8px 16px;
    border: 1px solid #30363d;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'JetBrains Mono', monospace;
}

.btn-copy:hover {
    background: #30363d;
    border-color: #58a6ff;
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px 40px;
}

.loading p {
    margin: 0 0 8px 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #58a6ff;
}

.loading small {
    display: block;
    color: #8b949e;
    font-size: 0.9em;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid #30363d;
    border-top-color: #58a6ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Preview Section */
.preview-section {
    padding: 40px;
    background: #0d1117;
}

.preview-section h2 {
    color: #c9d1d9;
    margin-bottom: 10px;
    font-size: 1.8em;
}

.preview-subtitle {
    color: #8b949e;
    margin-bottom: 30px;
}

/* Validation Results */
.validation-results {
    margin-bottom: 30px;
}

.validation-container {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    overflow: hidden;
}

.validation-summary {
    padding: 20px;
    border-bottom: 1px solid #30363d;
}

.validation-summary h3 {
    margin: 0 0 8px 0;
    font-size: 1.3em;
    color: #c9d1d9;
}

.validation-summary p {
    margin: 0;
    color: #8b949e;
    font-weight: 500;
}

.validation-success {
    background: #0d1b1b;
    border-left: 4px solid #3fb950;
}

.validation-warning {
    background: #1b1910;
    border-left: 4px solid #d29922;
}

.validation-error {
    background: #1b1010;
    border-left: 4px solid #f85149;
}

.validation-section {
    padding: 20px;
    border-bottom: 1px solid #30363d;
}

.validation-section:last-child {
    border-bottom: none;
}

.validation-section h4 {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    color: #c9d1d9;
}

.validation-error h4 {
    color: #f85149;
}

.validation-warning h4 {
    color: #d29922;
}

.validation-success h4 {
    color: #3fb950;
}

.validation-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.validation-list li {
    padding: 12px;
    margin-bottom: 8px;
    background: #0d1117;
    border-radius: 6px;
    border-left: 3px solid #30363d;
    font-size: 0.9em;
}

.validation-error .validation-list li {
    background: #1b1010;
    border-left-color: #f85149;
}

.validation-warning .validation-list li {
    background: #1b1910;
    border-left-color: #d29922;
}

.validation-success .validation-list li {
    background: #0d1b1b;
    border-left-color: #3fb950;
}

.validation-message {
    font-weight: 600;
    color: #c9d1d9;
    margin-bottom: 4px;
}

.validation-details {
    font-size: 0.9em;
    color: #8b949e;
}

/* Column Preview */
.column-preview {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    overflow-x: auto;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.preview-table th {
    background: #21262d;
    color: #58a6ff;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #30363d;
    position: sticky;
    top: 0;
}

.preview-table td {
    padding: 12px;
    border-bottom: 1px solid #30363d;
}

.preview-table tr:hover {
    background: #0d1117;
}

.preview-table small {
    color: #8b949e;
}

.type-badge {
    display: inline-block;
    background: #0d1b1b;
    color: #3fb950;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85em;
    border: 1px solid #238636;
}

.type-select {
    width: 100%;
    padding: 8px 12px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    font-size: 0.9em;
    cursor: pointer;
    transition: border-color 0.2s;
}

.type-select:hover {
    border-color: #58a6ff;
}

.type-select:focus {
    outline: none;
    border-color: #58a6ff;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

.sample-data {
    color: #8b949e;
    font-size: 0.85em;
    max-width: 300px;
}

.preview-info {
    margin-top: 15px;
    color: #8b949e;
    font-weight: 600;
}

.preview-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Results Section */
.results {
    padding: 40px;
    background: #0d1117;
}

.stats {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.stats span {
    background: #161b22;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: 600;
    color: #58a6ff;
    border: 1px solid #30363d;
    font-size: 0.9em;
}

.sql-section {
    margin-bottom: 30px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    overflow: hidden;
}

.sql-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #0d1117;
    border-bottom: 1px solid #30363d;
}

.sql-header h3 {
    margin: 0;
    font-size: 1.1em;
    color: #58a6ff;
    font-weight: 600;
}

.sql-code {
    background: #0d1117;
    padding: 20px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
    line-height: 1.6;
    color: #c9d1d9;
    max-height: 400px;
    overflow-y: auto;
}

.sql-code::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.sql-code::-webkit-scrollbar-track {
    background: #161b22;
}

.sql-code::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 5px;
}

.sql-code::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

.actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Error */
.error {
    margin: 20px 40px;
    padding: 20px;
    background: #1b1010;
    color: #f85149;
    border-left: 4px solid #f85149;
    border-radius: 8px;
    font-weight: 500;
    line-height: 1.6;
    white-space: pre-line;
    border: 1px solid #30363d;
}

/* Footer */
.footer {
    background: #0d1117;
    color: #8b949e;
    margin-top: 60px;
    padding: 40px 20px 20px 20px;
    border-top: 1px solid #30363d;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 40px;
    flex-wrap: wrap;
}

.footer-section {
    flex: 1;
    min-width: 200px;
}

.footer-section p {
    margin: 8px 0;
    font-size: 0.9em;
}

.footer-brand {
    font-size: 1.1em;
    font-weight: 700;
    color: #c9d1d9;
    margin-bottom: 4px;
}

.footer-tagline {
    font-size: 0.85em;
    color: #484f58;
    font-style: italic;
}

.footer-section strong {
    color: #c9d1d9;
    font-size: 1em;
}

.footer-section a {
    color: #58a6ff;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: #79c0ff;
    text-decoration: underline;
}

.footer-bottom {
    max-width: 1200px;
    margin: 30px auto 0 auto;
    padding-top: 20px;
    border-top: 1px solid #21262d;
    text-align: center;
}

.footer-bottom p {
    color: #484f58;
    font-size: 0.85em;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }
    
    .upload-section, .results, .preview-section {
        padding: 20px;
    }
    
    .actions, .preview-actions {
        flex-direction: column;
    }
    
    .btn-secondary, .btn-primary {
        width: 100%;
    }
    
    .instructions {
        margin: 20px 20px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .stats {
        flex-direction: column;
    }
}
