@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@300;400;500;600;700&display=swap');

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

:root {
    --primary-color: #1a1a1a;
    --secondary-color: #2d2d2d;
    --accent-color: #4a9eff;
    --accent-hover: #357abd;
    --success-color: #2ecc71;
    --success-hover: #27ae60;
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2d2d2d;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --border-color: #404040;
    --border-light: #333333;
    --shadow-light: rgba(0, 0, 0, 0.3);
    --shadow-medium: rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Meiryo', 'Yu Gothic', sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow-light);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-align: center;
    padding: 35px;
}

header h1 {
    font-size: 2.2em;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1em;
    color: var(--text-secondary);
    opacity: 0.9;
}

h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.4em;
    font-weight: 600;
    position: relative;
    padding-bottom: 8px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 2px;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 500px;
}

.input-section, .output-section {
    padding: 35px;
    position: relative;
}

.input-section {
    background: var(--bg-tertiary);
    border-right: 1px solid var(--border-light);
}

.output-section {
    background: var(--bg-secondary);
}

textarea {
    width: 100%;
    min-height: 300px;
    padding: 20px;
    background: #2d2d2d;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.7;
    resize: vertical;
    font-family: inherit;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

textarea::placeholder {
    color: #666666;
}

textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.2);
    background: #333333;
}

.char-count {
    margin-top: 15px;
    text-align: right;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    font-family: 'Courier New', 'Monaco', 'Consolas', monospace;
    background: #1a1a1a;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    display: inline-block;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.char-count span:first-child {
    color: #888888;
    margin-right: 8px;
}

.char-count span:last-child {
    color: #4a9eff;
    font-weight: 700;
    font-size: 16px;
    text-shadow: 0 0 8px rgba(74, 158, 255, 0.5);
    letter-spacing: 1px;
}

.button-section {
    padding: 40px;
    text-align: center;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-light);
}

.format-btn {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
    min-width: 200px;
    height: 56px;
    margin-bottom: 20px;
}

.format-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 158, 255, 0.4);
}

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

.output-container {
    background: #2d2d2d;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    min-height: 300px;
    margin-bottom: 20px;
}

.output-text {
    white-space: pre-wrap;
    line-height: 1.7;
    font-size: 15px;
    color: var(--text-primary);
}

.output-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.output-info span:first-child {
    font-family: 'Courier New', 'Monaco', 'Consolas', monospace;
    background: #1a1a1a;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.output-info span:first-child span:first-child {
    color: #888888;
    margin-right: 8px;
}

.output-info span:first-child span:last-child {
    color: #4a9eff;
    font-weight: 700;
    font-size: 16px;
    text-shadow: 0 0 8px rgba(74, 158, 255, 0.5);
    letter-spacing: 1px;
}

.button-group {
    display: flex;
    gap: 20px;
}

.action-btn {
    border: none;
    padding: 16px 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: inherit;
    min-width: 200px;
    height: 56px;
}

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

.copy-btn:hover {
    background: var(--success-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.download-btn {
    background: #d4a574;
    color: white;
}

.download-btn:hover {
    background: #b8945f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.3);
}

.reset-btn {
    background: #e74c3c;
    color: white;
}

.reset-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

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

.instructions {
    padding: 35px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-light);
}

.instructions h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.3em;
    font-weight: 600;
}

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

.instructions li {
    padding: 10px 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 25px;
    transition: color 0.3s ease;
}

.instructions li:hover {
    color: var(--text-primary);
}

.instructions li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
    font-size: 16px;
}

/* レスポンシブデザイン */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .input-section {
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }
}

@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    header h1 {
        font-size: 1.8em;
        padding: 25px;
    }
    
    .main-content {
        min-height: auto;
    }
    
    .input-section, .output-section, .button-section, .instructions {
        padding: 25px;
    }
    
    textarea, .output-container {
        min-height: 250px;
    }
    
    .format-btn {
        padding: 14px 30px;
        font-size: 16px;
        min-width: 180px;
    }
    
    .button-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .action-btn {
        min-width: 100%;
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0a0a0a;
        --bg-secondary: #1a1a1a;
        --bg-tertiary: #2d2d2d;
        --text-primary: #e0e0e0;
        --text-secondary: #a0a0a0;
        --border-color: #404040;
        --border-light: #333333;
    }
}
