/* ===========================
   Global Styles
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

/* ===========================
   Main Container
   =========================== */
.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   Header
   =========================== */
header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

h1 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
}

/* ===========================
   Section Labels
   =========================== */
.section-label {
    display: block;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
    font-size: 1em;
}

/* ===========================
   Editor Section
   =========================== */
.editor-section {
    margin-bottom: 30px;
}

.editor-container {
    position: relative;
    width: 100%;
}

#input-text {
    width: 100%;
    min-height: 200px;
    max-height: 400px;
    padding: 15px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    border: 2px solid #ddd;
    border-radius: 8px;
    resize: vertical;
    transition: border-color 0.3s;
    background: #fafafa;
    line-height: 1.6;
    overflow-y: auto;
    word-wrap: break-word;
    white-space: pre-wrap;
}

#input-text:focus {
    outline: none;
    border-color: #555;
    background: white;
}

#input-text::placeholder {
    color: #999;
}

/* Suggestion Overlay (floating hint) */
.suggestion-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    pointer-events: none;
    z-index: 10;
    animation: slideInRight 0.2s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.editor-hint {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-left: 4px solid #555;
    font-size: 0.9em;
    color: #555;
}

kbd {
    background: #333;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

/* IME Toggle Button */
.ime-toggle {
    padding: 8px 16px;
    background: #f8f9fa;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.ime-toggle:hover {
    background: #e9ecef;
    border-color: #555;
}

.ime-toggle.enabled {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.ime-toggle.disabled {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

/* ===========================
   Suggestion Display Section
   =========================== */
.suggestion-section {
    margin-bottom: 30px;
}

.suggestion-display {
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    min-height: 60px;
    max-height: 200px;
    color: #495057;
    line-height: 1.6;
    overflow-y: auto;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.suggestion-display em {
    color: #999;
}

.suggestion-display.has-suggestion {
    background: linear-gradient(135deg, #f8fff9 0%, #ffffff 100%);
    border-color: #4caf50;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.1);
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   Controls Section
   =========================== */
.controls-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.controls-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3em;
}

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

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-weight: 600;
    color: #555;
    font-size: 0.95em;
}

.control-group label span {
    color: #555;
    font-weight: 700;
}

.control-group input[type="range"],
.control-group input[type="number"] {
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.control-group input[type="range"] {
    padding: 0;
}

.control-group input:focus {
    outline: none;
    border-color: #555;
}

.control-group small {
    color: #777;
    font-size: 0.85em;
}

/* ===========================
   Status Bar
   =========================== */
.status-bar {
    padding: 15px 20px;
    border-radius: 8px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.status-icon {
    font-size: 1.2em;
}

.status-bar.ready {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.status-bar.ready .status-icon {
    color: #28a745;
}

.status-bar.loading {
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffeaa7;
}

.status-bar.loading .status-icon {
    color: #ff9800;
    animation: pulse 1s infinite;
}

.status-bar.error {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

.status-bar.error .status-icon {
    color: #dc3545;
}

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

/* ===========================
   Footer
   =========================== */
footer {
    text-align: center;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
    color: #999;
    font-size: 0.9em;
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 2em;
    }

    .controls-grid {
        grid-template-columns: 1fr;
    }
}

