/* components.css — Reusable UI components */

/* Buttons */
.btn {
    padding: 14px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
}

.btn-primary {
    background: #171717;
    color: #fff;
    box-shadow: none;
}
.btn-primary:hover { background: #232323; }
.btn-secondary { background: #fff; color: #1a1a1a; border: 1px solid rgba(23, 23, 23, 0.1); }
.btn-secondary:hover { background: #f7f7f5; }
.btn-small { padding: 8px 16px; font-size: 0.8rem; }
.btn-large { padding: 16px 32px; font-size: 1rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-row {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.text-link-btn {
    border: none;
    background: transparent;
    color: #4b5563;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 6px 4px;
}

.text-link-btn:hover {
    color: #171717;
}

/* Script selector dropdown */
.script-selector {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid rgba(23, 23, 23, 0.1);
    border-radius: 10px;
    font-size: 0.85rem;
    background: #fff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.script-selector:focus {
    outline: none;
    border-color: #1a1a1a;
}

.script-selector:hover {
    border-color: rgba(23, 23, 23, 0.18);
}

/* Toggle groups */
.toggle-group {
    background: #ecebe7;
    border-radius: 10px;
    padding: 4px;
    display: flex;
}

.toggle-option {
    flex: 1;
    padding: 10px 8px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 550;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.15s;
    color: #66645e;
}

.toggle-option.active {
    background: #fff;
    color: #1a1a1a;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.toggle-option.coming-soon {
    color: #9a9a90;
    cursor: default;
    pointer-events: none;
}

.mode-description {
    font-size: 0.8rem;
    color: #5e5b55;
    margin-top: 10px;
    line-height: 1.5;
}

/* Voice options */
.voice-options {
    display: flex;
    gap: 10px;
}

.voice-option {
    flex: 1;
    padding: 12px 10px;
    border: 1px solid rgba(23, 23, 23, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: #fff;
}

.voice-option:hover { border-color: rgba(23, 23, 23, 0.18); }
.voice-option.selected { border-color: #1a1a1a; background: #f5f5f5; }

.voice-icon { font-size: 1.25rem; }
.voice-label { font-size: 0.8rem; font-weight: 500; }

/* Toggle switches */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 0;
}

.toggle-label {
    font-size: 0.85rem;
    color: #2f2f2c;
}

.toggle-switch {
    width: 44px;
    height: 24px;
    background: #ddd;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
}

.toggle-switch.active { background: #1a1a1a; }

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}

.toggle-switch.active::after { transform: translateX(20px); }

/* Character selection */
.character-select-container {
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.script-badge {
    display: inline-block;
    background: #f5f5f5;
    border: 1px solid #eee;
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 16px;
}

.script-name-display {
    font-weight: 600;
    color: #1a1a1a;
}

.character-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 32px 0;
}

.character-option {
    padding: 16px 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
}

.character-option:hover { border-color: #ccc; background: #fafafa; }
.character-option.selected { border-color: #1a1a1a; background: #f5f5f5; }

.character-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.character-option.selected .character-checkbox { border-color: #1a1a1a; background: #1a1a1a; }
.character-option.selected .character-checkbox::after {
    content: '';
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
}

.character-name { font-weight: 500; }
.character-lines { color: #999; font-size: 0.8rem; }

/* Record button */
.record-btn {
    min-width: 160px;
}

.record-btn.recording {
    background: #dc2626;
    animation: pulse-record 1s infinite;
}

/* Record controls */
.record-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 6px;
}

.record-select {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
}

.record-character-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #e5e5e5;
    border-radius: 20px;
    font-size: 0.85rem;
}

.record-character-chip .remove-char {
    cursor: pointer;
    opacity: 0.6;
}

.record-character-chip .remove-char:hover {
    opacity: 1;
}

/* Mobile responsive */
@media (max-width: 479px) {
    .btn {
        padding: 16px 24px;
        min-height: 44px;
    }

    .toggle-switch {
        width: 48px;
        height: 28px;
    }

    .toggle-switch::after {
        width: 24px;
        height: 24px;
    }

    .toggle-switch.active::after {
        transform: translateX(20px);
    }

    .character-option {
        padding: 18px 16px;
    }
}

.mic-permission-warning {
    font-size: 0.75rem;
    color: #dc2626;
    margin-top: 4px;
    line-height: 1.4;
}
