/* Base styles from V2 - Essential for V3 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.screen {
    min-height: 100vh;
}

.loading-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: white;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

/* Button Styles */
.btn-primary {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-outline {
    background: transparent;
    color: #007cba;
    border: 2px solid #007cba;
    padding: 10px 22px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background: #007cba;
    color: white;
}

/* Container Styles */
.notes-container,
.clients-container,
.analytics-container,
.ai-assistant-container {
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.tab-content {
    display: none;
}

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

/* Voice Input Styles */
.voice-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.voice-btn {
    padding: 10px 15px;
    border: 2px solid #007cba;
    background: white;
    color: #007cba;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.voice-btn:hover {
    background: #007cba;
    color: white;
}

.voice-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.voice-transcript {
    min-height: 150px;
    padding: 15px;
    border: 2px dashed #ddd;
    border-radius: 6px;
    background: #fafafa;
    font-family: inherit;
    line-height: 1.5;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100%;
    box-sizing: border-box;
}

.recording-status {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 6px;
    font-weight: 500;
    text-align: center;
}

.recording-status.recording {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    position: relative;
    z-index: 10;
    clear: both;
    width: 100%;
    box-sizing: border-box;
}

/* Template button active states */
.template-btn.active {
    background-color: #4CAF50 !important;
    color: white !important;
    border-color: #45a049 !important;
}

.template-btn.premium-template.active {
    background-color: #FF6B35 !important;
    color: white !important;
    border-color: #e55a2b !important;
}

/* Recent Notes */
.recent-notes {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.recent-notes h3 {
    margin-bottom: 20px;
    color: #333;
}

.notes-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .notes-container,
    .clients-container,
    .analytics-container,
    .ai-assistant-container {
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .voice-controls {
        flex-direction: column;
    }
}

/* Workflow Selection Styles */
.workflow-section {
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

.workflow-section h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #495057;
    font-weight: 600;
}

.workflow-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.workflow-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.workflow-card:hover {
    border-color: #007cba;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,124,186,0.2);
}

.workflow-card.premium-required:not(.premium-unlocked) {
    opacity: 0.7;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
}

.workflow-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.workflow-card h3 {
    margin: 0 0 12px 0;
    color: #343a40;
    font-size: 18px;
    font-weight: 600;
}

.workflow-card p {
    margin: 0 0 16px 0;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.4;
}

.premium-badge, .free-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.premium-badge {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #856404;
    border: 1px solid #ffc107;
}

.free-badge {
    background: linear-gradient(135deg, #28a745 0%, #34ce57 100%);
    color: white;
    border: 1px solid #28a745;
}

/* Responsive Design */
@media (max-width: 768px) {
    .workflow-options {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .workflow-card {
        padding: 20px;
    }
    
    .workflow-icon {
        font-size: 40px;
        margin-bottom: 12px;
    }
}
/* Workflow Navigation */
.workflow-navigation {
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.workflow-navigation .btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.workflow-navigation .btn-secondary:hover {
    background: #5a6268;
}
/* Gravity Forms Workflow Interface */
.gf-workflow-header {
    background: linear-gradient(135deg, #007cba 0%, #0056b3 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.gf-workflow-header h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
}

.gf-workflow-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

.gf-form-selection {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.gf-form-selection label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.gf-form-selection select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
}

.gf-form-container {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.gf-field-group {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    background: #fafafa;
}

.gf-field-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.gf-field-group .field-id {
    font-size: 12px;
    color: #6c757d;
    font-weight: normal;
}

.gf-field-input {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.gf-field-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.gf-field-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s ease;
}

.record-field-btn {
    background: #dc3545;
    color: white;
}

.record-field-btn:hover {
    background: #c82333;
}

.record-field-btn.recording {
    background: #28a745;
    animation: pulse 1.5s infinite;
}

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

.gf-workflow-actions {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.gf-workflow-actions button {
    margin: 0 10px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gf-workflow-actions .btn-primary {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.gf-workflow-actions .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.gf-workflow-actions .btn-secondary {
    background: #6c757d;
    color: white;
}

.gf-workflow-actions .btn-secondary:hover {
    background: #5a6268;
}

/* ===== UX IMPROVEMENTS ===== */

/* Client Selection Unified */
.client-selection-unified {
    display: flex;
    gap: 10px;
    align-items: center;
}

.client-dropdown-unified {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.new-client-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.new-client-btn:hover {
    background: #218838;
}

.new-client-form {
    margin-top: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #dee2e6;
}

.client-name-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
}

/* Template Option */
.template-option {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #dee2e6;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
}

.template-checkbox {
    margin-right: 8px;
}

/* Input Method Suggestion */
.input-suggestion {
    margin-top: 10px;
    padding: 8px 12px;
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    border-radius: 4px;
}

.suggestion-text {
    font-size: 13px;
    color: #1976d2;
    font-style: italic;
}

/* Voice Actions */
.voice-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.voice-actions .btn-secondary,
.voice-actions .btn-primary {
    margin-right: 10px;
    margin-bottom: 5px;
}

/* Multi-field Template */
.multi-field-template {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
}

.template-field {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 5px;
}

.field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.field-label {
    font-weight: bold;
    color: #495057;
}

.field-actions {
    display: flex;
    gap: 8px;
}

.field-record-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.field-record-btn:hover {
    background: #c82333;
}

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

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

.field-textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    resize: vertical;
    font-family: inherit;
}

.template-save-actions {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #dee2e6;
    text-align: center;
}

.save-all-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

.save-all-btn:hover {
    background: #0056b3;
}
.show-all-btn {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.show-all-btn:hover {
    background: #138496;
}

.show-all-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}
/* Checkbox Alignment Fix */
.template-checkbox {
    width: 16px !important;
    height: 16px !important;
    margin-right: 8px !important;
    vertical-align: middle;
}

.checkmark {
    margin-left: 0 !important;
}

/* AI Assist Actions */
.ai-assist-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.ai-assist-actions .btn-secondary,
.ai-assist-actions .btn-primary {
    margin-right: 10px;
    margin-bottom: 5px;
}
