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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 120vh;
    margin-bottom: 150px;
    color: #333;
    overflow-x: hidden;
}

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

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

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.widget-form, .widget-lookup, .created-widgets {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.widget-form h2, .widget-lookup h2, .created-widgets h2 {
    margin-bottom: 20px;
    color: #4a5568;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
    word-wrap: break-word;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
    max-width: 100%;
}

.form-group select {
    height: 50px;
    text-align: center;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    width: 100%;
}

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

.btn-secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.lookup-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.lookup-form input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
}

.widget-result {
    background: #f7fafc;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    display: none;
}

.widget-result.show {
    display: block;
}

.widget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.widget-card {
    background: #f7fafc;
    border-radius: 8px;
    padding: 20px;
    border: 2px solid #e2e8f0;
    transition: transform 0.3s ease;
}

.widget-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.widget-card h3 {
    color: #4a5568;
    margin-bottom: 10px;
}

.widget-card p {
    color: #718096;
    margin-bottom: 15px;
}

.widget-id {
    font-family: 'Courier New', monospace;
    background: #edf2f7;
    padding: 8px;
    border-radius: 4px;
    font-size: 14px;
    word-break: break-all;
}

.success-message {
    background-color: #efe;
    border: 1px solid #8c8;
    color: #363;
    padding: 15px;
    margin: 15px 0;
    border-radius: 8px;
}

/* Error Messages */
.error-message {
    background-color: #fee;
    border: 1px solid #f88;
    color: #c33;
    padding: 15px;
    margin: 15px 0;
    border-radius: 8px;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

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

.info-message {
    background: #bee3f8;
    color: #2c5aa0;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #3182ce;
}

/* Dashboard styles */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.dashboard-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
}

.dashboard-card h2 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.dashboard-card p {
    color: #718096;
    margin-bottom: 20px;
}

.feature-list {
    list-style: none;
    margin-bottom: 25px;
}

.feature-list li {
    padding: 5px 0;
    color: #718096;
    position: relative;
    padding-left: 20px;
}

.feature-list li:before {
    content: "✓";
    color: #38a169;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Navigation styles */
.breadcrumb {
    margin-bottom: 20px;
    color: white;
}

.breadcrumb a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
}

.breadcrumb a:hover {
    opacity: 1;
}

/* Tab styles */
.tabs {
    display: flex;
    margin-bottom: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: #f7fafc;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.tab-button:hover {
    background: #edf2f7;
}

.tab-button.active {
    background: #667eea;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Form layout improvements */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Agent and widget card actions */
.agent-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.agent-actions button {
    padding: 8px 12px;
    font-size: 14px;
}

/* Responsive design for agent actions on small screens */
@media (max-width: 768px) {
    .agent-actions {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: 15px;
        width: 100%;
    }

    .agent-actions button {
        width: 100%;
        padding: 12px 16px;
        font-size: 14px;
        margin: 0;
        text-align: center;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    .agent-actions {
        gap: 6px;
    }

    .agent-actions button {
        padding: 10px 14px;
        font-size: 13px;
    }
}

.delete-btn {
    background-color: #dc3545 !important;
    color: white !important;
}

.copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 6px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
}

.copy-btn:hover {
    background-color: #e2e8f0;
    color: #475569;
    transform: scale(1.05);
}

.copy-btn i {
    pointer-events: none;
}

/* Avatar upload styles */
.avatar-upload {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.avatar-upload select,
.avatar-upload input[type="file"] {
    flex: 1;
    min-width: 200px;
}

.lookup-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.lookup-form select {
    flex: 1;
    min-width: 200px;
}
}

.delete-btn:hover {
    background-color: #c82333 !important;
}

/* Knowledge Base Mode Styles */
.kb-mode {
    display: none;
}

.kb-mode.active {
    display: block;
}

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

.kb-mode input[type="file"] {
    padding: 10px;
    border: 2px dashed #667eea;
    border-radius: 8px;
    background: #f8fafc;
    width: 100%;
    cursor: pointer;
}

.kb-mode input[type="file"]:hover {
    border-color: #5a67d8;
    background: #edf2f7;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: none;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Agent Link Modal Specific Styles */
.link-option {
    padding: 15px;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    background: #fafafa;
}

.link-option h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.link-option p {
    margin: 0 0 15px 0;
    color: #666;
}

.link-display {
    display: flex;
    align-items: center;
    gap: 10px;
}

.link-display input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    background: white;
}

.link-display button {
    flex-shrink: 0;
    white-space: nowrap;
}

.modal-content.large-modal {
    max-width: 900px;
    width: 95%;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
}

.edit-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.edit-tab-button {
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #666;
    min-width: 90px;
    text-align: center;
}

.edit-tab-button:hover {
    background: #e9ecef;
    color: #333;
}

.edit-tab-button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.edit-tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
    width: 100%;
    overflow-x: hidden;
    word-wrap: break-word;
}

.edit-tab-content.active {
    display: block;
}

.edit-tab-content h3 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    word-wrap: break-word;
}

.edit-tab-content h4 {
    color: #555;
    margin: 20px 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    word-wrap: break-word;
}

/* JSON textarea styling */
.form-group textarea[placeholder*="JSON"], 
.form-group textarea[name*="_json"],
.form-group textarea[name*="json"] {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    resize: vertical;
    min-height: 100px;
}

.form-group textarea[placeholder*="JSON"]:focus,
.form-group textarea[name*="_json"]:focus,
.form-group textarea[name*="json"]:focus {
    background: #fff;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* Color input styling */
.form-group input[type="color"] {
    width: 50px;
    height: 35px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
}

/* Enhanced checkbox and range styling */
.form-group input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
}

.form-group input[type="range"] {
    width: 100%;
    margin: 10px 0;
}

.form-group input[type="range"] + span {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

/* Modal enhancements for large form */
.modal-content.large-modal {
    max-width: 95vw;
    width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 2% auto;
    box-sizing: border-box;
}

.modal-content.large-modal h2 {
    position: sticky;
    top: 0;
    background: white;
    z-index: 1000;
    margin: 0 0 20px 0;
    padding: 20px 0 10px 0;
    border-bottom: 2px solid #f0f0f0;
}

.modal-content.large-modal * {
    box-sizing: border-box;
}

/* Form layout improvements */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
    min-width: 200px;
    box-sizing: border-box;
}

/* Small text styling */
.form-group small {
    display: block;
    color: #666;
    font-size: 11px;
    margin-top: 4px;
    line-height: 1.3;
}

/* Section dividers */
.edit-tab-content > .form-group:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.edit-tab-content > .form-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Advanced field styling */
.form-group input[readonly] {
    background: #f8f9fa;
    color: #666;
}

.form-group select optgroup {
    font-weight: bold;
    color: #333;
}

.form-group select option {
    font-weight: normal;
    color: #666;
}

/* Animation for tab content */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Modal actions sticky footer */
.modal-actions {
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 1px solid #eee;
    padding: 15px 0;
    margin-top: 30px;
    z-index: 1000;
}

/* Responsive design for comprehensive form */
@media (max-width: 1024px) {
    .modal-content.large-modal {
        width: 95vw;
        margin: 1% auto;
        padding: 15px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-row .form-group {
        min-width: auto;
        width: 100%;
    }

    .edit-tabs {
        flex-direction: column;
        overflow-x: auto;
        white-space: nowrap;
    }

    .edit-tab-button {
        min-width: auto;
        text-align: left;
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    .modal-content.large-modal {
        max-height: 95vh;
        margin: 1% 2%;
        width: calc(100% - 4%);
        padding: 10px;
    }

    .edit-tabs {
        flex-wrap: wrap;
    }

    .edit-tab-button {
        font-size: 11px;
        padding: 6px 8px;
        min-width: 80px;
    }
}

.contact-selection {
    margin-top: 20px;
}

.contact-option {
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
}

.contact-option h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.quick-contacts {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px 0;
}

.contact-btn {
    background: #e8f5e8;
    border: 1px solid #4caf50;
    color: #2e7d2e;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.3s;
}

.contact-btn:hover {
    background: #d4edda;
}

.airtable-contact {
    margin: 5px 0;
}

.airtable-contact button {
    font-size: 12px;
    padding: 5px 10px;
}

.modal-header {
    padding: 20px 30px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: #333;
}

.modal-body {
    padding: 30px;
}

/* Embed Code Section Styling */
.embed-code-section {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
    margin: 30px 0 !important;
    padding: 25px !important;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
    border-radius: 16px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
}

.embed-code-section h3 {
    color: #1e293b;
    margin-bottom: 12px;
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.embed-code-section p {
    color: #475569;
    margin-bottom: 25px;
    font-size: 1.1rem;
    font-weight: 500;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.embed-code-header {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 20px !important;
    margin-bottom: 15px !important;
    padding: 0 10px !important;
    width: 100% !important;
}

.embed-code-header h4 {
    color: #1e293b !important;
    font-size: 1.2rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.embed-code-container {
    position: relative;
    margin-bottom: 20px;
    width: 100%;
    outline: none;
}

.embed-code {
    width: 100%;
    min-height: 180px;
    padding: 25px;
    border: 2px solid #cbd5e0;
    border-radius: 16px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    color: #f1f5f9;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Source Code Pro', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    box-shadow: 
        0 10px 30px rgba(15, 23, 42, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: auto;
    white-space: pre;
}

.embed-code:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 
        0 0 0 3px rgba(102, 126, 234, 0.1),
        0 15px 35px rgba(15, 23, 42, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

.embed-code::selection {
    background: rgba(102, 126, 234, 0.3);
}

.embed-code::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.embed-code::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.embed-code::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.embed-code::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.copy-embed-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 3px 12px rgba(5, 150, 105, 0.3),
```text
        0 1px 3px rgba(5, 150, 105, 0.2);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.copy-embed-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.copy-embed-btn:hover::before {
    left: 100%;
}

.copy-embed-btn:hover {
    background: linear-gradient(135deg, #047857 0%, #059669 50%, #10b981 100%);
    transform: translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(5, 150, 105, 0.4),
        0 4px 8px rgba(5, 150, 105, 0.3);
}

.copy-embed-btn:active {
    transform: translateY(-1px);
    box-shadow: 
        0 4px 15px rgba(5, 150, 105, 0.4),
        0 2px 4px rgba(5, 150, 105, 0.3);
}

.copy-embed-btn i {
    font-size: 16px;
    transition: transform 0.2s ease;
}

.copy-embed-btn:hover i {
    transform: scale(1.1);
}

.embed-instructions {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 1px solid #93c5fd;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: left;
}

.embed-instructions h4 {
    color: #1e40af;
    margin-bottom: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.embed-instructions ul {
    margin: 0;
    padding-left: 20px;
    color: #1e40af;
}

.embed-instructions li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.embed-instructions code {
    background: rgba(30, 64, 175, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

@keyframes textColorChange {
  0%, 100% { color: #FFFFFF; text-shadow: 0 0 10px magenta; }  /* Red */
  25% { color: #00FF00; text-shadow: 0 0 10px #00FF00; } /* Green */
  50% { color: #0000FF; text-shadow: 0 0 10px #0000FF; } /* Blue */
  75% { color: #ffd900; text-shadow: 0 0 10px #FFD700; } /* Gold */
}

footer {   
position: relative;   
bottom: 10px;   
left: 50%;   
transform: translateX(-50%);   
text-align: center;   
width: 100%; 
    margin-top: 100px;
}  

footer p {   
font-size: 14px;   
color: white;
animation: textColorChange 3s ease-in-out infinite;
 }

/* Speech Generation Styles */
.speech-form, .speech-result, .speech-examples {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.speech-result {
    border: 2px solid #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.audio-player {
    text-align: center;
}

.audio-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.example-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.example-btn {
    padding: 10px 20px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.example-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

/* Audio player styling */
audio {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Range input value styling */
.form-group input[type="range"] + span {
    background: #10b981;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    min-width: 35px;
    text-align: center;
    display: inline-block;
    margin-left: 10px;
}

/* Avatar Settings Styling */
.avatar-settings-section {
    margin: 15px 0;
    padding: 15px;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    background: #f9f9f9;
}

/* File Upload Zone */
.file-upload-zone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.file-upload-zone:hover {
    border-color: #667eea;
    background: #f0f3ff;
}

.file-upload-zone.dragover {
    border-color: #667eea;
    background: #e8f0ff;
    transform: scale(1.02);
}

.upload-content {
    pointer-events: none;
}

.upload-content i {
    font-size: 48px;
    color: #667eea;
    margin-bottom: 10px;
    display: block;
}

.upload-content p {
    margin: 10px 0 5px 0;
    font-weight: 600;
    color: #333;
}

.upload-content small {
    color: #666;
    font-size: 12px;
}

/* Image Preview */
.image-preview {
    position: relative;
    display: inline-block;
    margin-top: 15px;
}

.image-preview img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 8px;
    border: 2px solid #e1e1e1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.remove-image {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.remove-image:hover {
    background: #ff3742;
    transform: scale(1.1);
}

/* Color input spacing in avatar section */
.avatar-settings-section .form-row .form-group input[type="color"] {
    width: 60px;
    height: 40px;
}

/* Voice Cloning Styles */
.recording-controls {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.recording-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007cba;
}

.status-indicator {
    font-weight: 600;
    color: #333;
}

.status-indicator.recording {
    color: #dc3545;
    animation: pulse 1.5s infinite;
}

.status-indicator.processing {
    color: #007cba;
    animation: pulse 1s infinite;
}

.status-indicator.stopped {
    color: #28a745;
}

.timer {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    color: #007cba;
}

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

.recording-tips {
    background: #e8f4fd;
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.recording-tips h3 {
    margin-top: 0;
    color: #0c5460;
}

.recording-tips ul {
    margin: 10px 0 0 20px;
}

.recording-tips li {
    margin: 5px 0;
    color: #0c5460;
}

.recordings-list, .files-list {
    border: 1px solid #ddd;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.recording-item, .file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    background: #fff;
}

.recording-item:last-child, .file-item:last-child {
    border-bottom: none;
}

.recording-item:hover, .file-item:hover {
    background: #f8f9fa;
}

.recording-info, .file-info {
    flex: 1;
}

.recording-info h4, .file-info h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: #333;
}

.recording-actions, .file-actions {
    display: flex;
    gap: 8px;
}

.recording-actions button, .file-actions button {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 4px;
}

.sources-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.source-count h4, .quality-indicator h4 {
    margin-top: 0;
    color: #495057;
}

.quality-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.quality-fill {
    height: 100%;
    background: linear-gradient(90deg, #dc3545 0%, #ffc107 50%, #28a745 100%);
    transition: width 0.3s ease;
}

.clone-progress {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e9ecef;
    border-radius: 15px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007cba, #28a745);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 15px;
}

.progress-text {
    text-align: center;
    font-weight: 600;
    color: #495057;
}

.voice-clones-list {
    display: grid;
    gap: 20px;
}

.voice-clone-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.voice-clone-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.voice-info {
    margin-bottom: 15px;
}

.voice-info h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.voice-info p {
    margin: 5px 0;
    color: #666;
}

.voice-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.voice-actions button {
    padding: 8px 16px;
    font-size: 14px;
}

.clone-settings {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.clone-settings h3 {
    margin-top: 0;
    color: #495057;
}

.estimated-time {
    margin: 20px 0;
}

.no-clones {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.debug-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.debug-section {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.debug-section h3 {
    color: #856404;
    margin-top: 0;
}

.debug-voice {
    border-left: 4px solid #ffc107;
}

.debug-voice .voice-info p {
    font-size: 12px;
    margin: 3px 0;
}

.file-upload-zone {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload-zone:hover {
    border-color: #007cba;
    background: #e8f4fd;
}

.file-upload-zone.dragover {
    border-color: #28a745;
    background: #d4edda;
}

.upload-content i {
    font-size: 48px;
    color: #6c757d;
    margin-bottom: 15px;
}

/* Responsive adjustments for voice cloning */
@media (max-width: 768px) {
    .recording-controls {
        flex-direction: column;
    }

    .recording-controls button {
        width: 100%;
    }

    .recording-status {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .sources-summary {
        grid-template-columns: 1fr;
    }

    .recording-actions, .file-actions, .voice-actions {
        flex-direction: column;
    }

    .recording-actions button, .file-actions button, .voice-actions button {
        width: 100%;
    }
}

.quick-actions {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
gap: 10px;

}

/* Device Selection Styles */
.device-selection {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e1e5e9;
}

.device-select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 14px;
}

.device-refresh, .device-test {
    margin-left: 10px;
    padding: 8px 12px;
    font-size: 12px;
    min-width: auto;
}

.form-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.form-group > div {
    display: flex;
    width: 100%;
    align-items: center;
}

/* Voice Cloning Styles */
.tab-buttons {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #e1e5e9;
}