/**
 * Jobsworth Voice Assistant Styles
 * 
 * Styles for the SDK-based voice search interface.
 * Custom microphone button, transcript, and job results.
 * 
 * @package Jobsworth\VoiceAssistant
 * @version 3.0.0
 */

/* =====================================================================
   TABBED SEARCH INTERFACE
   ===================================================================== */

.sb-search-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    border-bottom: 2px solid #e5e7eb;
}

.sb-search-tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #757575;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sb-search-tab:hover {
    color: #ffffff;
    background: #1c5eb5;
    border-radius: 12px 12px 0 0;
}

.sb-search-tab.active {
    color: #4388ff;
    border-bottom-color: #4388ff;
    background: transparent;
}

.sb-search-tab svg {
    width: 18px;
    height: 18px;
}

/* Tab content panels */
.sb-search-tab-content {
    display: none;
    padding: 20px 0;
}

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

/* =====================================================================
   VOICE SEARCH PANEL
   ===================================================================== */

.sb-voice-search-panel {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border-radius: 12px;
    padding: 24px;
}

.sb-voice-search-intro {
    text-align: center;
    margin-bottom: 20px;
}

.sb-voice-search-intro h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.sb-voice-search-intro p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

/* =====================================================================
   VOICE INTERFACE (SDK-based)
   ===================================================================== */

.jobsworth-voice-interface {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Microphone Container */
.jobsworth-mic-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* Microphone Button */
.jobsworth-mic-button {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #4388ff 0%, #1c5eb5 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(67, 136, 255, 0.4);
}

.jobsworth-mic-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(67, 136, 255, 0.5);
}

.jobsworth-mic-button:active {
    transform: scale(0.98);
}

.jobsworth-mic-button.connecting {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
    animation: pulse-connecting 1.5s ease-in-out infinite;
}

.jobsworth-mic-button.active {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.jobsworth-mic-button.active .jobsworth-mic-pulse {
    animation: pulse-ring 1.5s ease-out infinite;
}

/* Pulse ring effect */
.jobsworth-mic-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid rgba(239, 68, 68, 0.6);
    opacity: 0;
    pointer-events: none;
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

@keyframes pulse-connecting {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Icons */
.jobsworth-mic-icon,
.jobsworth-stop-icon {
    width: 32px;
    height: 32px;
}

/* Status Text */
.jobsworth-mic-status {
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    text-align: center;
    min-height: 20px;
    transition: color 0.2s ease;
}

.jobsworth-mic-status.error {
    color: #dc2626;
}

/* =====================================================================
   AUDIO VISUALIZER
   ===================================================================== */

.jobsworth-visualizer {
    width: 100%;
    max-width: 200px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jobsworth-visualizer-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    height: 100%;
}

.jobsworth-visualizer-bars span {
    width: 6px;
    height: 20%;
    background: linear-gradient(to top, #4f46e5, #7c3aed);
    border-radius: 3px;
    transition: height 0.1s ease;
}

.jobsworth-mic-button.active ~ .jobsworth-visualizer .jobsworth-visualizer-bars span {
    animation: visualizer-bar 0.5s ease-in-out infinite alternate;
}

.jobsworth-visualizer-bars span:nth-child(1) { animation-delay: 0s; }
.jobsworth-visualizer-bars span:nth-child(2) { animation-delay: 0.1s; }
.jobsworth-visualizer-bars span:nth-child(3) { animation-delay: 0.2s; }
.jobsworth-visualizer-bars span:nth-child(4) { animation-delay: 0.3s; }
.jobsworth-visualizer-bars span:nth-child(5) { animation-delay: 0.4s; }

@keyframes visualizer-bar {
    0% {
        height: 20%;
    }
    100% {
        height: 100%;
    }
}

/* =====================================================================
   TRANSCRIPT
   ===================================================================== */

.jobsworth-transcript {
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.jobsworth-transcript-inner {
    padding: 16px;
}

.jobsworth-transcript-message {
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.jobsworth-transcript-message:last-child {
    margin-bottom: 0;
}

.jobsworth-transcript-user {
    background: #ede9fe;
    margin-left: 20px;
}

.jobsworth-transcript-agent {
    background: #f3f4f6;
    margin-right: 20px;
}

.jobsworth-transcript-role {
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.jobsworth-transcript-user .jobsworth-transcript-role {
    color: #7c3aed;
}

.jobsworth-transcript-agent .jobsworth-transcript-role {
    color: #4b5563;
}

.jobsworth-transcript-text {
    color: #374151;
}

/* =====================================================================
   VOICE SEARCH RESULTS HEADER
   ===================================================================== */

.jobsworth-voice-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border: 1px solid #c4b5fd;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.jobsworth-voice-results-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.jobsworth-voice-icon {
    font-size: 24px;
}

.jobsworth-voice-label {
    font-weight: 600;
    color: #5b21b6;
    font-size: 16px;
}

.jobsworth-voice-count {
    background: #8b5cf6;
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
}

.jobsworth-clear-voice-results {
    background: white;
    border: 1px solid #c4b5fd;
    color: #5b21b6;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.jobsworth-clear-voice-results:hover {
    background: #5b21b6;
    color: white;
    border-color: #5b21b6;
}

/* =====================================================================
   VOICE SEARCH JOB CARDS
   ===================================================================== */

.nh-job-card-item.jobsworth-voice-job {
    border-left: 4px solid #8b5cf6;
}

.nh-job-card-item.jobsworth-voice-job:hover {
    border-left-color: #5b21b6;
}

.nh-job-card-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nh-job-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.nh-job-title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #111827;
    flex: 1;
}

.nh-job-salary {
    font-size: 15px;
    font-weight: 600;
    color: #10b981;
    white-space: nowrap;
}

.nh-job-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 14px;
    color: #6b7280;
}

.nh-job-company {
    font-weight: 500;
    color: #4687ff;
}

.nh-job-location {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nh-job-type {
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.nh-job-type-remote {
    background: #d1fae5;
    color: #065f46;
}

.nh-job-type-hybrid {
    background: #fef3c7;
    color: #92400e;
}

.nh-job-type-onsite,
.nh-job-type-on-site {
    background: #e0e7ff;
    color: #3730a3;
}

.nh-job-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.nh-job-skill-tag {
    background: #f3f4f6;
    color: #374151;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.nh-job-description {
    font-size: 13px;
    line-height: 1.5;
    color: #6b7280;
}

/* No results message */
.jobsworth-no-results {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border: 1px dashed #e5e7eb;
    border-radius: 8px;
}

.jobsworth-no-results p {
    margin: 0 0 8px 0;
    color: #6b7280;
    font-size: 14px;
}

.jobsworth-no-results p:last-child {
    margin-bottom: 0;
}

/* Admin notice */
.jobsworth-voice-notice {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.jobsworth-voice-notice p {
    margin: 0;
    color: #92400e;
    font-size: 14px;
}

/* =====================================================================
   RESPONSIVE STYLES
   ===================================================================== */

@media (max-width: 768px) {
    .sb-search-tabs {
        flex-wrap: wrap;
    }
    
    .sb-search-tab {
        flex: 1;
        justify-content: center;
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .sb-voice-search-panel {
        padding: 16px;
    }
    
    .jobsworth-mic-button {
        width: 70px;
        height: 70px;
    }
    
    .jobsworth-mic-icon,
    .jobsworth-stop-icon {
        width: 28px;
        height: 28px;
    }
    
    .jobsworth-transcript {
        max-height: 150px;
    }
    
    .jobsworth-voice-results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .jobsworth-voice-results-info {
        flex-wrap: wrap;
    }
    
    .jobsworth-clear-voice-results {
        width: 100%;
        text-align: center;
    }
    
    .nh-job-header {
        flex-direction: column;
        gap: 8px;
    }
    
    .nh-job-salary {
        order: -1;
    }
    
    .nh-job-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .sb-search-tab {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .sb-search-tab svg {
        width: 16px;
        height: 16px;
    }
    
    .jobsworth-mic-button {
        width: 64px;
        height: 64px;
    }
}

/* =====================================================================
   ACCESSIBILITY
   ===================================================================== */

.sb-search-tab:focus,
.jobsworth-mic-button:focus,
.jobsworth-clear-voice-results:focus {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

/* Reduce motion for users with preference */
@media (prefers-reduced-motion: reduce) {
    .sb-search-tab,
    .jobsworth-mic-button,
    .jobsworth-clear-voice-results,
    .nh-job-card-item,
    .jobsworth-visualizer-bars span {
        transition: none;
        animation: none;
    }
    
    .jobsworth-mic-button.active .jobsworth-mic-pulse {
        animation: none;
    }
}

/* =====================================================================
   SCROLLBAR STYLING
   ===================================================================== */

.jobsworth-transcript::-webkit-scrollbar {
    width: 6px;
}

.jobsworth-transcript::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

.jobsworth-transcript::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.jobsworth-transcript::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
