/* Real-time Voice Translator Mobile - Complete CSS */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f5f5f7;
    color: #333;
    padding: 20px;
    touch-action: manipulation;
}

.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.app-header {
    text-align: center;
    margin-bottom: 20px;
}

.app-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a73e8;
    margin-bottom: 5px;
}

.app-subtitle {
    font-size: 14px;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

.control-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    width: 100%;
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    min-height: 50px;
    flex-wrap: wrap;
}

.language-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 50px;
    background-color: #1a73e8;
    color: white;
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    border: none;
    outline: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.language-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
}

.language-button.japanese {
    background-color: #e74c3c;
}

.language-button.english {
    background-color: #2ecc71;
}

.language-button.stop {
    background-color: #dc3545;
    display: none;
}

.language-button.reset {
    background-color: #f39c12;
}

.language-button.stop.visible {
    display: flex;
}

.language-button:active:not(:disabled) {
    transform: scale(0.96);
}

.language-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recording .stop-button {
    animation: pulse-button 1.5s infinite;
}

@keyframes pulse-button {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

.status {
    font-size: 16px;
    padding: 6px 14px;
    background-color: #e8f0fe;
    border-radius: 20px;
    color: #1a73e8;
    font-weight: 500;
    display: inline-block;
}

.status.recording {
    background-color: #ffebee;
    color: #dc3545;
}

.status.idle {
    background-color: #e8f0fe;
    color: #1a73e8;
}

.status.processing {
    background-color: #fff8e1;
    color: #ff9800;
}

.status.error {
    background-color: #ffebee;
    color: #dc3545;
}

.font-size-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.font-size-button {
    background-color: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.font-size-button:hover {
    background-color: #e0e0e0;
}

.font-size-button:active {
    transform: scale(0.95);
}

.result-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
    flex: 1;
}

.result-box {
    background-color: white;
    border-radius: 12px;
    padding: 25px;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-height: 150px;
    border-left: 4px solid #1a73e8;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex: 1;
    position: relative;
    margin-bottom: 5px;
}

.result-title {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-content {
    font-size: 24px;
    line-height: 1.6;
    white-space: pre-wrap;
    flex: 1;
}

.result-content.size-small {
    font-size: 20px;
}

.result-content.size-medium {
    font-size: 24px;
}

.result-content.size-large {
    font-size: 28px;
}

.result-content.size-xlarge {
    font-size: 32px;
}

.language-indicator {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 12px;
    background-color: #e8f0fe;
    color: #1a73e8;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(26, 115, 232, 0.3);
    border-radius: 50%;
    border-top-color: #1a73e8;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.translating-indicator {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: #fff8e1;
    color: #ff9800;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    display: none;
}

.translating-indicator.visible {
    display: inline-block;
}

.app-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: #666;
}

.settings-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: transparent;
    border: none;
    color: #1a73e8;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.settings-button:hover {
    background-color: rgba(26, 115, 232, 0.1);
}

.error-message {
    color: #dc3545;
    font-style: italic;
    margin-top: 5px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(0);
    animation: modal-in 0.3s ease-out;
}

@keyframes modal-in {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a73e8;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.modal-title svg {
    width: 24px;
    height: 24px;
    margin-right: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #DADCE0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: #1a73e8;
    outline: none;
}

.form-help {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

.button-row {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.reset-keys {
    margin-top: 15px;
    font-size: 13px;
    color: #666;
    text-align: center;
    cursor: pointer;
    text-decoration: underline;
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 10px;
    }
    
    .app-title {
        font-size: 24px;
    }
    
    .app-subtitle {
        font-size: 13px;
    }
    
    .button-group {
        flex-direction: column;
        gap: 12px;
        width: 100%;
        max-width: 280px;
    }
    
    .language-button {
        width: 100%;
        justify-content: center;
        padding: 12px 24px;
    }
    
    .result-container {
        gap: 15px;
    }
    
    .result-box {
        padding: 15px;
        min-height: 120px;
    }
    
    .result-content {
        font-size: 20px;
    }
    
    .result-content.size-small {
        font-size: 16px;
    }

    .result-content.size-medium {
        font-size: 20px;
    }

    .result-content.size-large {
        font-size: 24px;
    }

    .result-content.size-xlarge {
        font-size: 28px;
    }
    
    .modal-content {
        padding: 20px;
        width: 95%;
    }
}

@media (max-width: 480px) {
    .app-title {
        font-size: 22px;
    }
    
    .settings-button {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
    }
    
    .font-size-controls {
        gap: 8px;
    }
    
    .font-size-button {
        width: 32px;
        height: 32px;
    }
}