/* Spracheingabe Widget Styles */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.widget-container {
    width: 100%;
    max-width: 100%;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

/* Header */
.widget-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: #1a1a1a;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

.header-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Body */
.widget-body {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.transcription-textarea {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: #333333;
    background: #fafafa;
    resize: vertical;
    transition: border-color 0.2s, background-color 0.2s;
}

.transcription-textarea:focus {
    outline: none;
    border-color: #1a1a1a;
    background: #ffffff;
}

.transcription-textarea::placeholder {
    color: #999999;
}

/* Status Bar */
.status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
    font-size: 12px;
    color: #666666;
    min-height: 20px;
}

.status-text {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-text.recording {
    color: #e53935;
    font-weight: 500;
}

.status-text.processing {
    color: #1976d2;
}

.status-text.error {
    color: #e53935;
}

.status-text.success {
    color: #43a047;
}

.recording-timer {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

/* Recording indicator dot */
.recording-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #e53935;
    border-radius: 50%;
    animation: pulse 1s ease-in-out infinite;
}

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

/* Footer */
.widget-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #f5f5f5;
    border-top: 1px solid #e5e5e5;
}

/* Buttons */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-label {
    white-space: nowrap;
}

/* Record Button */
.btn-record {
    flex: 1;
    background: #1a1a1a;
    color: #ffffff;
}

.btn-record:hover {
    background: #333333;
}

.btn-record:active {
    transform: scale(0.98);
}

.btn-record.recording {
    background: #e53935;
    animation: record-pulse 1.5s ease-in-out infinite;
}

@keyframes record-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(229, 57, 53, 0);
    }
}

.btn-record:disabled {
    background: #cccccc;
    cursor: not-allowed;
    animation: none;
}

/* Clear Button */
.btn-clear {
    padding: 10px;
    background: #ffffff;
    color: #666666;
    border: 1px solid #e0e0e0;
}

.btn-clear:hover {
    background: #f0f0f0;
    color: #333333;
}

/* Enhance Button */
.btn-enhance {
    background: #ffffff;
    color: #7c4dff;
    border: 1px solid #d4c4ff;
}

.btn-enhance:hover {
    background: #f3efff;
    border-color: #7c4dff;
}

.btn-enhance:disabled {
    background: #f5f5f5;
    color: #999999;
    border-color: #e0e0e0;
    cursor: not-allowed;
}

.btn-enhance.enhancing {
    background: #f3efff;
    border-color: #7c4dff;
    color: #7c4dff;
    position: relative;
}

.btn-enhance.enhancing .btn-label {
    visibility: hidden;
}

.btn-enhance.enhancing::after {
    content: 'Läuft...';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
}

.btn-enhance.enhancing .btn-icon {
    animation: spin 1s linear infinite;
}

/* Copy Button */
.btn-copy {
    background: #ffffff;
    color: #333333;
    border: 1px solid #e0e0e0;
}

.btn-copy:hover {
    background: #f0f0f0;
}

.btn-copy.copied {
    background: #43a047;
    color: #ffffff;
    border-color: #43a047;
}

/* Toast */
.toast {
    position: absolute;
    top: 60px;
    right: 12px;
    padding: 10px 16px;
    background: #333333;
    color: #ffffff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1000;
    max-width: 180px;
    text-align: center;
}

.toast.show {
    opacity: 1;
}

.toast.success {
    background: #43a047;
}

.toast.error {
    background: #e53935;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 400px) {
    .widget-container {
        max-width: 100%;
        border-radius: 0;
    }

    .btn-label {
        display: none;
    }

    .btn {
        padding: 10px 12px;
    }

    .btn-record {
        padding: 10px 20px;
    }

    .btn-record .btn-label {
        display: inline;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Kann bei Bedarf aktiviert werden */
}
