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

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --background: #ffffff;
    --surface: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --error: #ef4444;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 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);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* ヘッダー */
header {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.language-selector {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background-color: var(--background);
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

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

/* メインコンテンツ */
main {
    flex: 1;
    padding: 2rem 0;
}

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

.hero h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* フォーマッターセクション */
.formatter-section {
    background-color: var(--surface);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 3rem;
}

.formatter-controls {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.control-group select {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background-color: var(--background);
    font-size: 0.875rem;
    cursor: pointer;
}

/* エディター */
.editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.editor-wrapper {
    display: flex;
    flex-direction: column;
}

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

.editor-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.sql-editor {
    width: 100%;
    min-height: 400px;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    resize: vertical;
    background-color: var(--background);
    transition: border-color 0.2s;
}

.sql-editor:focus {
    outline: none;
    border-color: var(--primary-color);
}

.sql-editor[readonly] {
    background-color: var(--surface);
}

/* ボタン */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.btn-primary,
.btn-secondary,
.btn-outline {
    padding: 0.625rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

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

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

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

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

/* 機能セクション */
.features {
    margin-bottom: 3rem;
}

.features h3 {
    font-size: 1.875rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background-color: var(--surface);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.feature-card h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.feature-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* フッター */
footer {
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: auto;
}

footer p {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* トースト */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 6px;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(1rem);
    transition: all 0.3s;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

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

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

/* レスポンシブ */
@media (max-width: 768px) {
    .hero h2 {
        font-size: 2rem;
    }
    
    .editor-container {
        grid-template-columns: 1fr;
    }
    
    .sql-editor {
        min-height: 300px;
    }
    
    .formatter-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .control-group {
        width: 100%;
        justify-content: space-between;
    }
    
    .action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-primary,
    .btn-outline {
        width: 100%;
    }
    
    .toast {
        right: 1rem;
        left: 1rem;
        bottom: 1rem;
    }
}