/* Pronunciation Analyzer Styles */

.pa-container {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 24px auto;
    max-width: 800px;
    width: 100%;
}

.pa-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.pa-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
}

.pa-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.pa-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.pa-btn-record {
    background-color: #ef4444;
    color: white;
}

.pa-btn-record:hover {
    background-color: #dc2626;
}

.pa-btn-record:disabled {
    background-color: #fca5a5;
    cursor: not-allowed;
}

.pa-btn-stop {
    background-color: #4b5563;
    color: white;
}

.pa-btn-stop:hover {
    background-color: #374151;
}

.pa-btn-stop:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

.pa-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #6b7280;
}

.pa-status.recording::before {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    background-color: #ef4444;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.pa-charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* Single column - stacked vertically */
    gap: 24px;
    margin-bottom: 20px;
}

/* No longer split on larger screens - always full width */

.pa-chart-card {
    background: #f9fafb;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    height: 400px;
    /* Increased height for better readability */
    position: relative;
    /* Needed for Chart.js responsive sizing */
}

.pa-chart-card canvas {
    display: block;
    max-height: 350px;
    /* Increased to match taller card */
    /* Leave room for title */
}

.pa-chart-title {
    font-size: 1rem;
    color: #374151;
    margin-bottom: 12px;
    text-align: center;
}

.pa-results {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;
}

.pa-spinner {
    display: none;
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Loading State Placeholder */
.pa-loading-container {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    margin: 20px 0;
    animation: fadeIn 0.4s ease-out;
}

.pa-loading-text {
    font-weight: 600;
    color: #4b5563;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

.hidden {
    display: none !important;
}

/* Enhanced Word Data Display */
.pa-word-info {
    transition: opacity 0.3s ease;
}

.pa-input-section {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
}

.pa-word-input-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 400px;
}

#pa-word-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 2px solid #e5e7eb;
    font-size: 1.1rem;
    color: #1f2937;
    transition: all 0.2s;
    text-align: center;
    font-weight: 500;
}

#pa-word-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

/* Word Form (Part of Speech) Selector Buttons */
#pa-word-forms {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 12px;
}

.pa-word-form-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 20px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(4px);
}

.pa-word-form-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.pa-word-form-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Specific Colors by Part of Speech */
.pa-pos-noun {
    background: #eff6ff;
    color: #1e40af;
    border-color: #dbeafe;
}

.pa-pos-noun.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.pa-pos-verb {
    background: #f0fdf4;
    color: #166534;
    border-color: #dcfce7;
}

.pa-pos-verb.active {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border-color: #16a34a;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.pa-pos-adj {
    background: #fffbeb;
    color: #92400e;
    border-color: #fef3c7;
}

.pa-pos-adj.active {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-color: #d97706;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.pa-pos-adv {
    background: #faf5ff;
    color: #6b21a8;
    border-color: #f3e8ff;
}

.pa-pos-adv.active {
    background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
    color: white;
    border-color: #9333ea;
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.3);
}

.pa-pos-default {
    background: #f9fafb;
    color: #4b5563;
    border-color: #f3f4f6;
}

.pa-pos-default.active {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    border-color: #4b5563;
    box-shadow: 0 4px 12px rgba(75, 85, 99, 0.3);
}

.pa-merged-info-box {
    background: #f0f9ff;
    border-radius: 12px;
    border: 1px solid #bae6fd;
    padding: 20px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
}

/* When merged, remove individual backgrounds and borders */
.pa-merged-info-box .pa-word-info,
.pa-merged-info-box .pa-reference-audio {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

.pa-word-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.pa-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

.pa-info-label {
    color: #0369a1;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.pa-ipa-text {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #0c4a6e;
    font-weight: 500;
}

#pa-pattern-display {
    color: #0c4a6e;
    font-weight: 500;
}

.pa-btn-primary {
    background-color: #3b82f6;
    color: white;
}

.pa-btn-primary:hover {
    background-color: #2563eb;
}

/* Search button */
.pa-search-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 10px 16px;
    font-size: 0.9rem;
    white-space: nowrap;
}

.pa-search-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* Native Audio Player */
.pa-reference-audio {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background: #ecfdf5;
    border: 1px solid #86efac;
    border-radius: 10px;
    flex-wrap: wrap;
}

.pa-audio-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #166534;
    font-weight: 500;
}

.pa-audio-icon {
    font-size: 1.2rem;
}

.pa-reference-audio audio {
    height: 36px;
    border-radius: 18px;
    flex-grow: 1;
    min-width: 200px;
}

/* Comparison Result Styles */
.pa-comparison-result {
    padding: 8px;
}

/* Score Grid */
.pa-score-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.pa-score-item {
    text-align: center;
    padding: 12px;
    background: #f1f5f9;
    border-radius: 8px;
}

.pa-score-value {
    font-weight: 600;
    font-size: 1.1rem;
}

.pa-score-label {
    font-size: 0.8rem;
    color: #6b7280;
}

/* Success/Error Alerts */
.pa-alert-success {
    background: #dcfce7;
    padding: 12px;
    border-radius: 8px;
    color: #166534;
    margin-bottom: 12px;
}

.pa-alert-error {
    background: #fee2e2;
    padding: 12px;
    border-radius: 8px;
    color: #991b1b;
    margin-bottom: 12px;
}

.pa-alert-warning {
    background: #fef3c7;
    padding: 12px;
    border-radius: 8px;
    color: #92400e;
    margin-bottom: 12px;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .pa-reference-audio {
        flex-direction: column;
        align-items: stretch;
    }

    .pa-reference-audio audio {
        width: 100%;
    }

    .pa-score-grid {
        grid-template-columns: 1fr;
    }
}

/* Feedback Section Styles */
.pa-feedback-section {
    margin-top: 24px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.pa-feedback-header {
    background: #f8fafc;
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.pa-feedback-header h3 {
    margin: 0 0 12px 0;
    font-size: 1.1rem;
    color: #334155;
}

.pa-syllable-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pa-syl-tab {
    padding: 8px 16px;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #64748b;
    transition: all 0.2s;
    font-weight: 500;
}

.pa-syl-tab:hover {
    background: #f1f5f9;
    color: #334155;
}

.pa-syl-tab.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.pa-feedback-content {
    padding: 20px;
}

.pa-feedback-card {
    animation: fadeIn 0.3s ease-in-out;
}

.pa-feedback-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 12px;
    border-radius: 8px;
    background: #f8fafc;
    margin-bottom: 12px;
    border: 1px solid #e2e8f0;
}

.pa-feedback-icon {
    font-size: 1.2rem;
    padding-top: 2px;
}

.pa-feedback-detail {
    flex-grow: 1;
}

.pa-feedback-title {
    font-weight: 600;
    color: #334155;
    margin-bottom: 4px;
    display: block;
}

.pa-feedback-text {
    color: #475569;
    font-size: 0.95rem;
    margin: 0;
}

.pa-feedback-text.good {
    color: #166534;
}

.pa-feedback-text.warn {
    color: #b45309;
}

.pa-play-syl-btn {
    background: #ecfdf5;
    border: 1px solid #86efac;
    color: #166534;
    padding: 6px 12px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    transition: all 0.2s;
}

.pa-play-syl-btn:hover {
    background: #dcfce7;
}

.pa-highlight-syl {
    font-weight: 700;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pa-pitch-info {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px dashed #cbd5e1;
    display: inline-block;
}

.pa-info-icon {
    font-style: normal;
    margin-right: 4px;
}