* {
    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, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

main {
    display: grid;
    gap: 20px;
}

.control-panel {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn svg {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e53e3e;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #c53030;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.language-selector label {
    font-weight: 600;
}

.language-selector select {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
}

.subtitle-display {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

.subtitle-display.position-top {
    align-items: flex-start;
}

.subtitle-display.position-center {
    align-items: center;
}

.subtitle-display.position-bottom {
    align-items: flex-end;
}

.subtitle-display[data-theme="inverse"] {
    background: rgba(255, 255, 255, 0.9);
    color: black;
}

.subtitle-display[data-theme="yellow"] {
    background: rgba(0, 0, 0, 0.8);
    color: #ffd700;
}

.subtitle-display[data-theme="green"] {
    background: rgba(0, 0, 0, 0.8);
    color: #00ff00;
}

.subtitle-text {
    font-size: 32px;
    line-height: 1.5;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
}

.subtitle-text.listening {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

.history-panel {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.history-panel h2 {
    margin-bottom: 20px;
    color: #667eea;
}

.history-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
}

.history-item {
    padding: 10px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 15px;
}

.history-item:last-child {
    border-bottom: none;
}

.history-time {
    color: #718096;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.history-text {
    color: #2d3748;
}

.settings-panel {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.settings-panel h3 {
    margin-bottom: 20px;
    color: #667eea;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.setting-item label {
    font-weight: 600;
    min-width: 120px;
}

.setting-item input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    outline: none;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
}

.setting-item input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.setting-item select {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
}

.setting-item span {
    font-size: 0.9rem;
    color: #718096;
    min-width: 50px;
}

.info-panel {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.info-panel h3 {
    margin-bottom: 15px;
    color: #667eea;
}

.info-panel ol,
.info-panel ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

.info-panel li {
    margin-bottom: 8px;
    line-height: 1.6;
}

footer {
    text-align: center;
    color: white;
    margin-top: 40px;
    padding: 20px;
}

footer a {
    color: white;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

footer a:hover {
    border-bottom-color: white;
}

/* スクロールバーのスタイリング */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .control-panel {
        padding: 20px;
        justify-content: center;
    }
    
    .language-selector {
        margin-left: 0;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }
    
    .subtitle-display {
        padding: 20px;
        min-height: 150px;
    }
    
    .subtitle-text {
        font-size: 24px;
    }
    
    .setting-item {
        flex-wrap: wrap;
    }
    
    .setting-item label {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .history-controls {
        flex-wrap: wrap;
    }
    
    .btn-small {
        flex: 1;
    }
}