/* Canine Vocalization Semantics Demo - Styles */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0064B1;
    --secondary-color: #004880;
    --accent-color: #F58025;
    --success-color: #51cf66;
    --warning-color: #ffd43b;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-color: #1a1a1a;
    --text-light: #666666;
    --border-color: #e0e6ed;
    --shadow: 0 4px 12px rgba(0, 100, 177, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 100, 177, 0.15);
    --shadow-xl: 0 12px 32px rgba(0, 100, 177, 0.2);
    --gradient-primary: linear-gradient(135deg, #0064B1 0%, #004880 100%);
    --gradient-accent: linear-gradient(135deg, #F58025 0%, #d96d1f 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8eef5 100%);
    color: var(--text-color);
    line-height: 1.6;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(0, 100, 177, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(245, 128, 37, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

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

/* Navigation */
.navbar {
    background: var(--gradient-primary);
    box-shadow: var(--shadow-lg);
    padding: 0.75rem 0;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.navbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-accent);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    font-size: 1.6rem;
    color: white;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.nav-links a {
    margin-left: 1.5rem;
    text-decoration: none;
    color: white;
    font-weight: 600;
    transition: all 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    position: relative;
}

.nav-links a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-links a:hover::before {
    width: 80%;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 1rem 0;
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 1.25rem;
}

.hero-section h2 {
    font-size: 2rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Cards */
.upload-card,
.semantics-card,
.visualization-card,
.feedback-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(0, 100, 177, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-card::before,
.visualization-card::before,
.feedback-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.upload-card:hover,
.visualization-card:hover,
.feedback-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.upload-card h3,
.visualization-card h3,
.feedback-card h3 {
    margin-bottom: 0.75rem;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.2rem;
}

.semantics-card h3{
    background: var(--gradient-primary);
    color: white;
    border: none;
    box-shadow: var(--shadow-xl);
}

/* Upload Area */
.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: 16px;
    padding: 3.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #f8fbff 0%, #f0f7ff 100%);
    position: relative;
}

.upload-area::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 3px;
    background: var(--gradient-primary);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: transparent;
    background: linear-gradient(135deg, #e8f4ff 0%, #d9edff 100%);
    transform: scale(1.01);
    box-shadow: 0 8px 24px rgba(0, 100, 177, 0.15);
}

.upload-area:hover::before,
.upload-area.drag-over::before {
    opacity: 1;
}

.upload-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.upload-placeholder p {
    color: var(--text-light);
    font-size: 1.1rem;
}

.info-text {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.warning-text {
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

/* File Info */
.file-info {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.file-info p {
    margin: 0.5rem 0;
}

/* Truncation Controls */
.truncation-control {
    margin: 1.5rem 0;
}

.slider-container {
    margin: 1rem 0;
}

.slider-container label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.slider-container input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.slider-container input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
}

/* Buttons */
.btn {
    padding: 0.85rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 100, 177, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 100, 177, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    background: var(--gradient-accent);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 128, 37, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(245, 128, 37, 0.4);
}

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

.modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg);
}

.modal-content h3 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

/* Pipeline Steps */
.pipeline-steps {
    margin: 2rem 0;
}

.step {
    display: flex;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: var(--bg-color);
    border-radius: 8px;
    transition: all 0.3s;
}

.step.active {
    background: #e7f3ff;
    border-left: 4px solid var(--primary-color);
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-weight: 600;
}

.step.active .step-number {
    background: var(--primary-color);
    color: white;
}

.step-label {
    flex: 1;
    font-weight: 500;
}

.step-status {
    font-size: 1.2rem;
    transition: transform 0.3s;
}

/* Rotating hourglass animation */
@keyframes rotate-hourglass {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.step-status.rotating {
    display: inline-block;
    animation: rotate-hourglass 2s linear infinite;
}

.step-status.completed {
    color: var(--success-color);
    transform: scale(1.2);
}

.step-status.waiting {
    opacity: 0.5;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s;
    width: 0%;
}

.processing-text {
    text-align: center;
    color: var(--text-light);
    margin-top: 1rem;
}

/* Info Section */
.info-section {
    margin-top: 2rem;
    text-align: center;
}

.info-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.step-card {
    background: var(--card-bg);
    padding: 1.25rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 100, 177, 0.1);
    position: relative;
    overflow: hidden;
}

.step-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-accent);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.step-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(0, 100, 177, 0.2);
}

.step-card:hover::before {
    transform: scaleX(1);
}

.step-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.step-card h4 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

/* Results Page */
.results-container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Result Sections */
.result-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 0;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(0, 100, 177, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.result-section:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-2px);
}

.section-header {
    background: var(--gradient-primary);
    color: white;
    padding: 0.85rem 1.5rem;
    border-bottom: 3px solid var(--accent-color);
}

.section-header h3 {
    margin: 0 0 0.2rem 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.section-description {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.9;
}

/* Header Title Group with Info Button */
.header-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.info-toggle-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    flex-shrink: 0;
}

.info-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.1);
}

.info-toggle-btn svg {
    color: white;
}

/* Technical Info Panel */
.tech-info-panel {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid var(--accent-color);
    margin: 0;
    padding: 0;
    overflow: hidden;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 1000px;
        opacity: 1;
    }
}

.tech-info-content {
    padding: 1rem 1.5rem;
}

.tech-info-content h4 {
    color: var(--primary-color);
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tech-detail {
    background: white;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
    font-size: 0.9rem;
    line-height: 1.6;
}

.tech-detail:last-child {
    margin-bottom: 0;
}

.tech-detail strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.25rem;
}

.tech-detail ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.5rem;
}

.tech-detail ul li {
    margin: 0.25rem 0;
}

.tech-detail ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.tech-detail ol li {
    margin: 0.3rem 0;
}

.tech-detail em {
    color: var(--primary-color);
    font-style: normal;
    font-weight: 600;
}

.denoising-content,
.sed-content,
.transcription-content,
.semantics-content {
    padding: 1.25rem 1.5rem;
}

/* Denoising Section */
.audio-toggle-container {
    text-align: center;
    margin-bottom: 1rem;
}

.audio-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-color);
    padding: 1rem 2rem;
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.toggle-option {
    font-weight: normal;
    font-size: 1rem;
    transition: all 0.3s;
}

#noisyLabel {
    opacity: 1;
    font-weight: bold;
}

#denoisedLabel {
    opacity: 0.5;
}

.waveform-container {
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.fallback-player {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* SED Section */
.sed-summary {
    text-align: center;
    margin-bottom: 1.25rem;
}

.summary-badge {
    display: inline-block;
    background: var(--gradient-primary);
    color: white;
    padding: 0.85rem 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.badge-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
}

.badge-label {
    display: block;
    font-size: 1rem;
    margin-top: 0.5rem;
    opacity: 0.95;
}

.subsection-title {
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: 0.6rem;
    font-weight: 600;
}

.visualization-image {
    width: 100%;
    max-width: 1200px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.boundaries-table-container {
    margin-top: 1rem;
}

.no-results {
    text-align: center;
    padding: 2rem;
    background: var(--bg-color);
    border-radius: 8px;
    color: var(--text-light);
}

/* Phone Transcription Section */
.phone-sequence-visualization {
    text-align: center;
}

.hubert-visualization {
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    height: 400px;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hubert-visualization img {
    height: 100%;
    width: auto;
    max-width: none;
    object-fit: contain;
}

.bark-transcriptions {
    margin-top: 2rem;
}

.bark-transcription-card {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.bark-transcription-card:hover {
    background: #f0f7ff;
    box-shadow: 0 2px 8px rgba(0, 100, 177, 0.15);
}

.bark-trans-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.bark-number {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.bark-timing {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--text-light);
    background: white;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
}

.phone-count-badge {
    font-size: 0.85rem;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
}

/* Interactive Visualization */
.interactive-visualization {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.bark-waveform {
    margin-bottom: 0.5rem;
    border-radius: 4px;
    overflow: hidden;
}

.bark-spectrogram {
    border-radius: 4px;
    overflow: hidden;
}

/* Phone Legend */
.phone-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
}

.phone-legend strong {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.phone-legend-item {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.phone-sequence {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.phone-badge {
    display: inline-block;
    background: white;
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary-color);
    cursor: help;
    transition: all 0.2s ease;
}

.phone-badge:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0, 100, 177, 0.3);
}

/* Semantics Section - Todo Placeholder */
.todo-placeholder {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 2px dashed var(--border-color);
}

.todo-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.todo-placeholder h4 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}

.todo-placeholder p {
    color: var(--text-light);
    margin: 0.5rem 0;
}

.todo-description {
    font-size: 0.9rem;
    font-style: italic;
}

/* Semantics Section - Active Results */
.overall-semantics {
    margin-bottom: 1rem;
}

.overall-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.25rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.overall-summary {
    margin-bottom: 0.5rem;
}

.summary-label {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.overall-meaning {
    margin: 0.75rem 0;
}

.overall-meaning p {
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

.dominant-themes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.dominant-themes strong {
    margin-right: 0.5rem;
}

.theme-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.25);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Per-Bark Semantics */
.bark-semantics {
    margin-top: 1rem;
}

.semantic-bark-card {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.semantic-bark-card:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateX(4px);
}

.semantic-bark-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.confidence-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.confidence-high {
    background: #d4edda;
    color: #155724;
}

.confidence-medium {
    background: #fff3cd;
    color: #856404;
}

.confidence-low {
    background: #f8d7da;
    color: #721c24;
}

.semantic-meaning {
    margin: 0.5rem 0;
}

.semantic-meaning p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-color);
}

.semantic-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.semantic-keywords strong {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.keyword-tag {
    display: inline-block;
    background: #e8f4ff;
    color: var(--primary-color);
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(0, 100, 177, 0.2);
}

.detected-patterns {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f0f0f0;
}

.detected-patterns small {
    font-family: 'Courier New', monospace;
}

/* Keep original semantics-card for backward compatibility */

.semantics-card {
    background: var(--gradient-primary);
    color: white;
    border: none;
    box-shadow: var(--shadow-xl);
}

.semantics-card::before {
    background: var(--gradient-accent);
}

.semantics-result {
    text-align: center;
}

.meaning-text {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.confidence-bar {
    margin: 0.75rem 0;
}

.confidence-bar span {
    display: block;
    margin-bottom: 0.5rem;
}

.confidence-fill {
    height: 30px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    position: relative;
}

.confidence-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: inherit;
    background: white;
    border-radius: 15px;
}

.phone-sequence {
    margin-top: 1.5rem;
}

.phone-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    margin: 0.25rem;
    border-radius: 20px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

/* Audio Toggle */
.audio-toggle {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    margin-right: 1rem;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Waveform */
#waveform {
    margin: 0.75rem 0;
    border-radius: 8px;
    overflow: hidden;
}

.playback-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 12px;
}

.playback-controls .btn-primary {
    padding: 0.75rem 2rem;
    font-size: 1rem;
}

.time-display {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Transcription */
.transcription-section,
.sed-section {
    margin-top: 1rem;
}

.transcription-section h4,
.sed-section h4 {
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.transcription-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.transcription-item {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.time-marker {
    color: var(--text-light);
    font-size: 0.9rem;
}

.phone-label {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--primary-color);
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

/* Feedback */
.rating-stars {
    display: flex;
    gap: 0.5rem;
    margin: 0.5rem 0;
    font-size: 1.5rem;
}

.rating-stars .star {
    cursor: pointer;
    opacity: 0.3;
    transition: opacity 0.3s;
}

.rating-stars .star:hover {
    opacity: 0.7;
}

#feedbackComment {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    margin: 0.5rem 0;
    resize: vertical;
}

#feedbackComment:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Admin Dashboard */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--gradient-primary);
    padding: 1.5rem 1.25rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    border: none;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    color: white;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-accent);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    filter: brightness(1.08);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.stat-value {
    font-size: 2.6rem;
    font-weight: 800;
    color: white;
    line-height: 1;
    margin-bottom: 0.4rem;
    letter-spacing: -1px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.stat-label {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recent-uploads {
    background: var(--card-bg);
    padding: 1.25rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.recent-uploads h3 {
    margin-bottom: 0.75rem;
    color: var(--secondary-color);
}

.uploads-table {
    width: 100%;
    border-collapse: collapse;
}

.uploads-table thead {
    background: var(--bg-color);
}

.uploads-table th,
.uploads-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.uploads-table th {
    font-weight: 600;
    color: var(--secondary-color);
}

.filename-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.comment-cell {
    max-width: 300px;
    color: var(--text-light);
}

.rating-badge {
    background: var(--gradient-accent);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(245, 128, 37, 0.3);
}

.no-feedback,
.no-data {
    color: var(--text-light);
    font-style: italic;
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 2rem auto;
}

.login-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.login-card h2 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.error-message {
    background: #ffe0e0;
    color: #c00;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 1rem;
    color: var(--text-light);
    text-decoration: none;
}

.back-link:hover {
    color: var(--primary-color);
}

/* Footer */
.footer {
    background: var(--gradient-primary);
    padding: 1.5rem 0;
    margin-top: 2rem;
    text-align: center;
    color: white;
    box-shadow: 0 -4px 12px rgba(0, 100, 177, 0.2);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-accent);
}

.footer a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.footer a:hover {
    color: white;
    text-shadow: 0 0 8px rgba(245, 128, 37, 0.8);
}

.actions {
    text-align: center;
    margin-top: 2rem;
}

/* Bark Boundaries Visualization */
.boundary-visualization {
    margin: 20px 0;
    padding: 15px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.boundaries-table {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.boundaries-table thead {
    background: var(--gradient-primary);
    color: white;
}

.boundaries-table th,
.boundaries-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.boundaries-table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.boundaries-table tbody tr {
    transition: background 0.2s;
}

.boundaries-table tbody tr:hover {
    background: rgba(0, 100, 177, 0.05);
}

.boundaries-table tbody tr:last-child td {
    border-bottom: none;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section h2 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .steps-grid {
        grid-template-columns: 1fr;
    }

    .uploads-table {
        font-size: 0.9rem;
    }

    .uploads-table th,
    .uploads-table td {
        padding: 0.5rem;
    }
    
    .boundaries-table {
        font-size: 0.9rem;
    }
    
    .boundaries-table th,
    .boundaries-table td {
        padding: 8px 12px;
    }
}

/* ============================================
   Pattern Library Page
   ============================================ */
.pattern-library-container {
    max-width: 1200px;
    margin: 0 auto;
}

.library-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.stat-card {
    background: var(--gradient-primary);
    color: white;
    padding: 1.25rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.35rem;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
}

.search-box {
    margin: 1rem 0;
}

.search-box input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    background: white;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 100, 177, 0.1);
}

.patterns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.25rem;
    margin: 1rem 0;
}

.pattern-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.pattern-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.pattern-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.pattern-id {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.pattern-label {
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pattern-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
}

.frequency-badge {
    background: var(--bg-color);
    color: var(--primary-color);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.pattern-meanings {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.meaning-category h4 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.meaning-items {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.meaning-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.8rem;
    background: var(--bg-color);
    border-radius: 6px;
    font-size: 0.85rem;
}

.meaning-name {
    color: var(--text-color);
}

.meaning-count {
    background: white;
    color: var(--primary-color);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.75rem;
}

.error-message, .no-data {
    text-align: center;
    padding: 3rem;
    background: var(--bg-color);
    border-radius: 12px;
    margin: 2rem 0;
}

/* ============================================
   Sample Gallery Page
   ============================================ */
.sample-gallery-container {
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-info {
    background: linear-gradient(135deg, #e8f4ff 0%, #d9edff 100%);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
    margin: 1rem 0;
}

.gallery-info p {
    margin: 0;
    line-height: 1.6;
}

.samples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
    margin: 1rem 0;
}

.sample-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.sample-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-6px);
}

.sample-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sample-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.default-thumbnail {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
}

.thumbnail-icon {
    font-size: 4rem;
}

.sample-info {
    padding: 1.25rem 1.5rem;
}

.sample-info h3 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
    font-size: 1.3rem;
}

.sample-description {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0.5rem 0 1rem 0;
    line-height: 1.5;
}

.sample-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.meta-icon {
    font-size: 1.1rem;
}

.sample-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tag {
    display: inline-block;
    background: var(--bg-color);
    color: var(--primary-color);
    padding: 0.3rem 0.7rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.no-samples {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-color);
    border-radius: 12px;
    margin: 2rem 0;
}

.no-samples-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.no-samples h3 {
    color: var(--primary-color);
    margin: 1rem 0 0.5rem 0;
}

.no-samples p {
    color: var(--text-light);
    margin: 0.5rem 0 2rem 0;
}
