* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #f1f1f1;
    min-height: 100vh;
    padding: 2rem 1rem;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.database-icon {
    width: 2.5rem;
    height: 2.5rem;
    color: #60a5fa;
}

h1 {
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
}

.subtitle {
    color: #9ca3af;
    font-size: 1rem;
}

/* Main Container */
.main-container {
    background: rgba(31, 41, 55, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    padding: 2rem;
    border: 1px solid rgba(75, 85, 99, 0.5);
}

/* Step Sections */
.step-section {
    margin-bottom: 2rem;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.step-number {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: bold;
}

.step-number.success {
    background: #10b981;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Grid Layout */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Form Elements */
label {
    display: block;
    font-size: 0.875rem;
    color: #d1d5db;
    margin-bottom: 0.5rem;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #374151;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    color: #f1f1f1;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}

input[type="text"]:focus,
input[type="number"]:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #2563eb;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #059669;
}

.btn-secondary {
    background: #4b5563;
    color: white;
}

.btn-secondary:hover {
    background: #374151;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.full-width {
    width: 100%;
}

.icon {
    width: 1.25rem;
    height: 1.25rem;
}

/* Flex Layout */
.flex-row {
    display: flex;
    gap: 0.75rem;
}

.flex-1 {
    flex: 1;
}

.gap-3 {
    gap: 0.75rem;
}

/* Sub Sections */
.sub-section {
    background: rgba(55, 65, 81, 0.5);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.hint {
    font-size: 0.875rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

/* Error Messages */
.error-message {
    color: #f87171;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.input-error {
    border-color: #ef4444 !important;
}

/* Rows List */
.rows-list {
    max-height: 12rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.row-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #4b5563;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.row-content {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-remove {
    background: none;
    border: none;
    color: #f87171;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.btn-remove:hover {
    color: #ef4444;
}

.btn-remove svg {
    width: 1rem;
    height: 1rem;
}

/* SQL Output */
.sql-output {
    background: #111827;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    position: relative;
}

#sqlOutput {
    color: #34d399;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
    overflow-x: auto;
    white-space: pre;
}

.btn-copy {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #374151;
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    transition: background 0.2s;
}

.btn-copy:hover {
    background: #4b5563;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 1.5rem;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1f2937;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Responsive */
@media (max-width: 640px) {
    h1 {
        font-size: 2rem;
    }

    .main-container {
        padding: 1.5rem;
    }

    body {
        padding: 1rem 0.5rem;
    }
}