:root {
    --primary-color: #0052CC;
    --primary-hover: #0747A6;
    --secondary-color: #6B778C;
    --success-color: #00875A;
    --background: #FFFFFF;
    --surface: #F4F5F7;
    --surface-hover: #EBECF0;
    --text-primary: #172B4D;
    --text-secondary: #6B778C;
    --border: #DFE1E6;
    --border-focused: #4C9AFF;
    --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);
    --radius: 8px;
    --radius-sm: 4px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: linear-gradient(180deg, #F7F8FA 0%, #FFFFFF 100%);
    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 24px;
    width: 100%;
}

/* ナビゲーションヘッダー */
.nav-header {
    background: var(--background);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

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

.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    background: linear-gradient(135deg, #0052CC 0%, #0747A6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.lang-selector select {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--background);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236B778C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.lang-selector select:hover {
    border-color: var(--border-focused);
}

.lang-selector select:focus {
    outline: none;
    border-color: var(--border-focused);
    box-shadow: 0 0 0 3px rgba(76, 154, 255, 0.2);
}

/* ヒーローセクション */
.hero {
    text-align: center;
    padding: 48px 0 32px;
}

.hero h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #172B4D 0%, #42526E 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

/* メインカード */
.converter-card {
    background: var(--background);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 32px;
    margin-bottom: 48px;
}

/* 入力セクション */
.input-section {
    margin-bottom: 32px;
}

.input-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#inputText {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    font-family: 'Fira Code', 'Courier New', monospace;
    resize: vertical;
    transition: all 0.2s;
    background: var(--surface);
}

#inputText:focus {
    outline: none;
    border-color: var(--border-focused);
    background: var(--background);
    box-shadow: 0 0 0 3px rgba(76, 154, 255, 0.2);
}

.input-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

/* ボタン */
.btn-secondary {
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--background);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--surface);
    border-color: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* 結果セクション */
.results-section h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.result-item {
    background: var(--surface);
    padding: 16px;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.result-item:hover {
    background: var(--surface-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

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

.result-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.copy-btn {
    padding: 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background: var(--background);
    color: var(--primary-color);
    transform: scale(1.1);
}

.copy-btn:active {
    transform: scale(0.95);
}

.result-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 14px;
    background: var(--background);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.result-input:focus {
    outline: none;
    border-color: var(--border-focused);
    box-shadow: 0 0 0 3px rgba(76, 154, 255, 0.2);
}

/* 情報セクション */
.info-section {
    background: var(--background);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 48px;
    box-shadow: var(--shadow-sm);
}

.info-section h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    margin-top: 32px;
    color: var(--text-primary);
}

.info-section h3:first-child {
    margin-top: 0;
}

.usage-list {
    list-style: none;
    padding-left: 0;
}

.usage-list li {
    padding: 12px 0 12px 36px;
    position: relative;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--surface);
}

.usage-list li:last-child {
    border-bottom: none;
}

.usage-list li::before {
    content: counter(list-counter);
    counter-increment: list-counter;
    position: absolute;
    left: 0;
    top: 12px;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.usage-list {
    counter-reset: list-counter;
}

.formats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.format-item {
    padding: 20px;
    background: var(--surface);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary-color);
}

.format-item h4 {
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.format-item p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* フッター */
.footer {
    margin-top: auto;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 24px 0;
    text-align: center;
}

.footer p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* トースト通知 */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--success-color);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    font-weight: 500;
    z-index: 1000;
}

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

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .hero h2 {
        font-size: 28px;
    }
    
    .hero p {
        font-size: 16px;
    }
    
    .converter-card {
        padding: 24px;
    }
    
    .result-grid {
        grid-template-columns: 1fr;
    }
    
    .formats-grid {
        grid-template-columns: 1fr;
    }
    
    .input-actions {
        flex-direction: column;
    }
    
    .btn-secondary {
        width: 100%;
    }
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.converter-card,
.info-section {
    animation: fadeIn 0.5s ease;
}

/* スクロールバーのカスタマイズ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}