/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Card */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* Upload area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-color);
    background-color: #eff6ff;
}

.upload-prompt svg {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.upload-prompt p {
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

/* File info */
.file-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #f1f5f9;
    border-radius: 8px;
}

.file-info h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.file-info ul {
    list-style: none;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.file-info li {
    padding: 0.25rem 0;
}

.sample-data {
    margin-top: 1rem;
    text-align: center;
}

/* Parameters */
.param-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.param-group {
    display: flex;
    flex-direction: column;
}

.param-group label {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.param-group input,
.param-group select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.param-group input:focus,
.param-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.param-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-large {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: none;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Plots */
#waveform-plot,
#spectrum-plot,
#envelope-plot {
    width: 100%;
    height: 400px;
    margin-bottom: 1rem;
}

/* Peak frequencies table */
.peak-frequencies {
    margin-top: 2rem;
}

.peak-frequencies h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

#peak-table {
    width: 100%;
    border-collapse: collapse;
}

#peak-table th,
#peak-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

#peak-table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: var(--text-primary);
}

#peak-table tbody tr:hover {
    background-color: #f8fafc;
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.stat-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-card:nth-child(4) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.stat-card h4 {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.stat-unit {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Download section */
.download-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.download-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.download-section button {
    margin-right: 1rem;
    margin-bottom: 0.5rem;
}

/* Loading overlay - Startup screen style */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.loading-content {
    text-align: center;
    max-width: 600px;
    padding: 3rem 2rem;
}

/* Loading logo */
.loading-logo {
    margin-bottom: 2rem;
}

.logo-circle {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.logo-wave {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    animation: wave 2s ease-in-out infinite;
}

.logo-wave:nth-child(2) {
    animation-delay: 0.3s;
}

.logo-wave:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes wave {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Loading title */
.loading-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin: 1rem 0 0.5rem;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.loading-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 2rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 300;
}

/* Loading status */
.loading-status-container {
    margin: 2rem 0 1.5rem;
    min-height: 40px;
}

.loading-status {
    font-size: 1.1rem;
    color: white;
    margin: 0;
    font-weight: 400;
    display: inline-block;
}

.loading-dots {
    display: inline-block;
    margin-left: 0.25rem;
}

.loading-dots span {
    display: inline-block;
    width: 4px;
    height: 4px;
    margin: 0 2px;
    background-color: white;
    border-radius: 50%;
    animation: dot-pulse 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes dot-pulse {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Progress container */
.progress-container {
    margin: 2rem 0;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: visible;
    position: relative;
    backdrop-filter: blur(10px);
    margin-bottom: 0.75rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 0 10px rgba(79, 172, 254, 0.5);
}

.progress-glow {
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    border-radius: 10px;
    animation: glow-slide 2s ease-in-out infinite;
}

@keyframes glow-slide {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.progress-percent {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-weight: 500;
    text-align: right;
}

/* Loading info */
.loading-info {
    margin-top: 2rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.loading-info svg {
    flex-shrink: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Processing overlay (simpler style) */
.processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.processing-content {
    text-align: center;
    max-width: 400px;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.processing-content h2 {
    margin: 1rem 0;
    color: var(--text-primary);
}

.processing-content p {
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

/* Spinner for processing */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .card {
        padding: 1.5rem;
    }

    .param-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .download-section button {
        width: 100%;
        margin-right: 0;
    }
}

/* ============================================
   ERROR DIALOG
   ============================================ */

.error-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
    user-select: none; /* モーダル背景は選択不可 */
}

.error-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    user-select: auto; /* コンテンツは選択可能 */
    animation: slideDown 0.3s ease-out;
}

.error-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 2px solid #fee2e2;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

.error-header h3 {
    margin: 0;
    color: #991b1b;
    font-size: 1.25rem;
}

.error-close-btn {
    background: transparent;
    border: none;
    font-size: 28px;
    color: #991b1b;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.error-close-btn:hover {
    background: rgba(153, 27, 27, 0.1);
}

.error-body {
    padding: 24px;
}

.error-message-section,
.error-stack-section,
.error-context-section {
    margin-bottom: 20px;
}

.error-body h4 {
    margin: 0 0 10px 0;
    color: #374151;
    font-size: 0.95rem;
    font-weight: 600;
}

.error-text {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #1f2937;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
    margin: 0;
}

.error-text.selectable {
    user-select: text;
    cursor: text;
}

.error-message-section .error-text {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
    font-weight: 500;
}

.error-stack-section details summary,
.error-context-section details summary {
    cursor: pointer;
    padding: 8px 12px;
    background: #f3f4f6;
    border-radius: 4px;
    color: #4b5563;
    font-weight: 500;
    user-select: none;
    transition: background 0.2s;
}

.error-stack-section details summary:hover,
.error-context-section details summary:hover {
    background: #e5e7eb;
}

.error-stack-section details[open] summary,
.error-context-section details[open] summary {
    margin-bottom: 10px;
}

.error-actions {
    display: flex;
    gap: 10px;
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 12px 12px;
}

.error-actions button {
    flex: 1;
}

.error-actions .btn-primary {
    background: #3b82f6;
}

.error-actions .btn-primary:hover {
    background: #2563eb;
}

.error-actions .btn-secondary {
    background: #6b7280;
}

.error-actions .btn-secondary:hover {
    background: #4b5563;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .error-content {
        width: 95%;
        max-height: 90vh;
    }

    .error-actions {
        flex-direction: column;
    }

    .error-actions button {
        width: 100%;
    }
}

/* ========================================
   Diagnosis Results Styles (ISO 10816-3)
   ======================================== */

.diagnosis-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 1rem 0;
}

.diagnosis-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.diagnosis-card.level-good {
    border-color: #10b981;
    background: linear-gradient(to bottom, #f0fdf4, white);
}

.diagnosis-card.level-acceptable {
    border-color: #3b82f6;
    background: linear-gradient(to bottom, #eff6ff, white);
}

.diagnosis-card.level-unsatisfactory {
    border-color: #f59e0b;
    background: linear-gradient(to bottom, #fffbeb, white);
}

.diagnosis-card.level-unacceptable {
    border-color: #ef4444;
    background: linear-gradient(to bottom, #fef2f2, white);
}

.diagnosis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.diagnosis-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #1f2937;
}

.diagnosis-badge {
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1rem;
    text-align: center;
    min-width: 150px;
}

.diagnosis-badge.level-good {
    background: #10b981;
    color: white;
}

.diagnosis-badge.level-acceptable {
    background: #3b82f6;
    color: white;
}

.diagnosis-badge.level-unsatisfactory {
    background: #f59e0b;
    color: white;
}

.diagnosis-badge.level-unacceptable {
    background: #ef4444;
    color: white;
}

.diagnosis-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.diagnosis-metric {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
}

.metric-label {
    font-size: 1rem;
    color: #6b7280;
    font-weight: 500;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #1f2937;
}

.metric-unit {
    font-size: 1.25rem;
    color: #9ca3af;
}

.diagnosis-level-bar {
    position: relative;
    display: flex;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.level-segment {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0.5rem;
}

.level-segment.zone-a {
    background: linear-gradient(to right, #d1fae5, #a7f3d0);
}

.level-segment.zone-b {
    background: linear-gradient(to right, #dbeafe, #bfdbfe);
}

.level-segment.zone-c {
    background: linear-gradient(to right, #fef3c7, #fde68a);
}

.level-segment.zone-d {
    background: linear-gradient(to right, #fee2e2, #fecaca);
}

.zone-label {
    font-size: 1.25rem;
    font-weight: bold;
    color: #1f2937;
}

.zone-threshold {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.level-indicator {
    position: absolute;
    top: -8px;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 16px solid;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    z-index: 10;
    transition: left 0.5s ease;
}

.level-indicator.level-good {
    border-top-color: #10b981;
}

.level-indicator.level-acceptable {
    border-top-color: #3b82f6;
}

.level-indicator.level-unsatisfactory {
    border-top-color: #f59e0b;
}

.level-indicator.level-unacceptable {
    border-top-color: #ef4444;
}

.diagnosis-recommendation {
    padding: 1.5rem;
    background: #f9fafb;
    border-left: 4px solid #3b82f6;
    border-radius: 4px;
}

.diagnosis-recommendation h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1.125rem;
    color: #1f2937;
}

.diagnosis-recommendation p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: #4b5563;
}

.diagnosis-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
}

.info-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.info-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
}

.zone-reference {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
}

.zone-reference h4 {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    color: #1f2937;
}

.zone-table {
    width: 100%;
    border-collapse: collapse;
}

.zone-table thead {
    background: #f9fafb;
}

.zone-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.zone-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.zone-table tbody tr:last-child td {
    border-bottom: none;
}

.zone-row-a td:first-child {
    color: #10b981;
    font-weight: bold;
}

.zone-row-b td:first-child {
    color: #3b82f6;
    font-weight: bold;
}

.zone-row-c td:first-child {
    color: #f59e0b;
    font-weight: bold;
}

.zone-row-d td:first-child {
    color: #ef4444;
    font-weight: bold;
}

/* Mobile responsiveness for diagnosis */
@media (max-width: 768px) {
    .diagnosis-container {
        padding: 0.5rem 0;
    }

    .diagnosis-card {
        padding: 1rem;
    }

    .diagnosis-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .diagnosis-badge {
        width: 100%;
    }

    .metric-value {
        font-size: 2rem;
    }

    .diagnosis-level-bar {
        height: 60px;
    }

    .zone-label {
        font-size: 1rem;
    }

    .zone-threshold {
        font-size: 0.625rem;
    }

    .diagnosis-info {
        grid-template-columns: 1fr;
    }

    .zone-table {
        font-size: 0.875rem;
    }

    .zone-table th,
    .zone-table td {
        padding: 0.5rem;
    }
}

/* ========================================
   Sample Data Selection Styles
   ======================================== */

.sample-data {
    margin-top: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
}

.sample-data h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #1e293b;
}

.sample-selector {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.sample-dropdown {
    flex: 1;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: white;
    color: #1e293b;
    cursor: pointer;
    transition: border-color 0.2s;
}

.sample-dropdown:hover {
    border-color: #3b82f6;
}

.sample-dropdown:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.sample-info {
    padding: 15px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-top: 10px;
}

.sample-info strong {
    color: #1e293b;
    font-size: 15px;
}

.sample-info small {
    color: #64748b;
    font-size: 13px;
}

/* Badge styles for sample metadata */
.badge {
    display: inline-block;
    padding: 4px 10px;
    margin: 5px 5px 5px 0;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.badge-zone-a {
    background: #dcfce7;
    color: #166534;
}

.badge-zone-b {
    background: #fef9c3;
    color: #854d0e;
}

.badge-zone-c {
    background: #fed7aa;
    color: #9a3412;
}

.badge-zone-d {
    background: #fecaca;
    color: #991b1b;
}

.badge-rms {
    background: #dbeafe;
    color: #1e40af;
}

/* Mobile responsiveness for sample selector */
@media (max-width: 768px) {
    .sample-selector {
        flex-direction: column;
    }

    .sample-dropdown {
        width: 100%;
    }

    .sample-selector button {
        width: 100%;
    }
}

/* ========================================
   Envelope Spectrum Styles
   ======================================== */

.envelope-info {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(to bottom, #f5f3ff, white);
    border: 2px solid #8b5cf6;
    border-radius: 8px;
}

.envelope-info h3 {
    font-size: 1.25rem;
    color: #5b21b6;
    margin-bottom: 1rem;
}

.envelope-info p {
    font-size: 1rem;
    line-height: 1.8;
    color: #4b5563;
    margin-bottom: 1rem;
}

.envelope-params {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1rem;
    margin-top: 1rem;
}

.envelope-params h4 {
    font-size: 1rem;
    color: #1f2937;
    margin-bottom: 0.75rem;
}

.envelope-params ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.envelope-params li {
    padding: 0.5rem 0;
    font-size: 0.95rem;
    color: #4b5563;
    border-bottom: 1px solid #f3f4f6;
}

.envelope-params li:last-child {
    border-bottom: none;
}

.envelope-params strong {
    color: #7c3aed;
    font-weight: 600;
}

/* Mobile responsiveness for envelope spectrum */
@media (max-width: 768px) {
    .envelope-info {
        padding: 1rem;
    }

    .envelope-info h3 {
        font-size: 1.1rem;
    }

    .envelope-info p {
        font-size: 0.95rem;
    }

    .envelope-params {
        padding: 0.75rem;
    }
}

/* ============================================
   Phase 5: Bearing Info Panel Styles
   ============================================ */

.bearing-info-panel {
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    color: white;
}

.bearing-info-panel h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
}

.bearing-info-panel h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
}

.bearing-spec,
.fault-frequencies {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.bearing-spec-table,
.frequency-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    overflow: hidden;
}

.bearing-spec-table tr,
.frequency-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bearing-spec-table tr:last-child,
.frequency-table tr:last-child {
    border-bottom: none;
}

.bearing-spec-table td {
    padding: 0.5rem;
    font-size: 0.95rem;
}

.bearing-spec-table td:first-child {
    width: 40%;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

.bearing-spec-table td:last-child {
    font-weight: 600;
    color: white;
}

.frequency-table th,
.frequency-table td {
    padding: 0.75rem 0.5rem;
    text-align: left;
}

.frequency-table th {
    background: rgba(255, 255, 255, 0.15);
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.frequency-table td {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.95);
}

/* Fault frequency row colors */
.freq-bpfo {
    border-left: 4px solid #3b82f6; /* Blue */
}

.freq-bpfi {
    border-left: 4px solid #ef4444; /* Red */
}

.freq-bsf {
    border-left: 4px solid #10b981; /* Green */
}

.freq-ftf {
    border-left: 4px solid #f59e0b; /* Orange */
}

.frequency-table td:nth-child(2) {
    font-weight: 600;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .bearing-info-panel {
        padding: 1rem;
        margin: 1rem 0;
    }

    .bearing-info-panel h3 {
        font-size: 1.2rem;
    }

    .bearing-info-panel h4 {
        font-size: 1rem;
    }

    .bearing-spec-table td,
    .frequency-table th,
    .frequency-table td {
        padding: 0.5rem;
        font-size: 0.85rem;
    }

    .frequency-table th:nth-child(3),
    .frequency-table td:nth-child(3) {
        display: none; /* Hide description column on mobile */
    }
}

/* Phase 5-4: Fault Detection Panel Styles */
.fault-detection-panel {
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    color: white;
}

.fault-detection-panel h3 {
    margin-top: 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.detection-summary {
    background: rgba(255, 255, 255, 0.2);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.detection-summary p {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
}

.fault-detection-table {
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
    color: #1f2937;
}

.fault-detection-table thead {
    background: #1f2937;
    color: white;
}

.fault-detection-table th,
.fault-detection-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.fault-detection-table th {
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fault-detection-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.1);
}

.fault-type-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.fault-type-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.severity-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}

.severity-1 {
    background: #10b981;
    color: white;
}

.severity-2 {
    background: #fbbf24;
    color: #1f2937;
}

.severity-3 {
    background: #f59e0b;
    color: white;
}

.severity-4 {
    background: #ef4444;
    color: white;
}

.severity-5 {
    background: #dc2626;
    color: white;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.detection-note {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.detection-note p {
    margin: 0;
}

.detection-note strong {
    font-weight: 600;
}

/* No faults detected state */
.no-faults-detected {
    color: #10b981;
    font-weight: 600;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .fault-detection-table {
        font-size: 0.85rem;
    }

    .fault-detection-table th,
    .fault-detection-table td {
        padding: 0.5rem;
    }

    .fault-detection-table th:nth-child(3),
    .fault-detection-table td:nth-child(3) {
        display: none; /* Hide detected frequency on mobile */
    }
}

/* ============================================ */
/* Phase 6-B: CSV Auto-Detection Results */
/* ============================================ */

.csv-detection-results {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    color: white;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.csv-detection-results h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.csv-detection-results h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 0.5rem;
}

/* Confidence Badge */
.detection-confidence {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.confidence-label,
.format-label {
    font-weight: 500;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.badge-success {
    background: #10b981;
    color: white;
}

.badge-warning {
    background: #f59e0b;
    color: white;
}

.badge-danger {
    background: #ef4444;
    color: white;
}

#confidence-score {
    font-weight: 700;
    font-size: 1.2rem;
}

/* Format Type */
.detection-format {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.format-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

#format-description {
    font-style: italic;
    opacity: 0.9;
}

/* Metadata Tables */
.metadata-table,
.columns-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.metadata-table th,
.columns-table th {
    text-align: left;
    padding: 0.75rem;
    font-weight: 500;
    width: 40%;
    background: rgba(0, 0, 0, 0.2);
}

.metadata-table td,
.columns-table td {
    padding: 0.75rem;
    font-weight: 600;
}

.metadata-table tr:hover,
.columns-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Warnings */
.detection-warnings {
    background: rgba(245, 158, 11, 0.2);
    border: 2px solid #f59e0b;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.detection-warnings h4 {
    margin-top: 0;
    color: #fbbf24;
    border-bottom: none;
}

.detection-warnings ul {
    margin: 0.5rem 0 0 1.5rem;
    padding: 0;
}

.detection-warnings li {
    margin-bottom: 0.5rem;
    color: #fef3c7;
}

/* Data Preview */
.detection-preview {
    margin-top: 1.5rem;
}

.preview-table-scroll {
    overflow-x: auto;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    max-height: 300px;
    overflow-y: auto;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
}

.preview-table thead {
    position: sticky;
    top: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.preview-table th,
.preview-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.preview-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.preview-table td {
    white-space: nowrap;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .csv-detection-results {
        padding: 1rem;
    }

    .csv-detection-results h3 {
        font-size: 1.1rem;
    }

    .detection-confidence,
    .detection-format {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .metadata-table th,
    .columns-table th {
        width: 50%;
        font-size: 0.85rem;
    }

    .metadata-table td,
    .columns-table td {
        font-size: 0.85rem;
    }

    .preview-table {
        font-size: 0.75rem;
    }

    .preview-table th,
    .preview-table td {
        padding: 0.4rem 0.5rem;
    }
}

/* =============================================================================
   Phase 6-B: CSV Import Settings Modal
   ============================================================================= */

/* Modal Container */
.csv-import-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.csv-import-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

.csv-import-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.4s ease-out;
    z-index: 10001;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Header */
.csv-import-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid #e5e7eb;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.csv-import-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.csv-import-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
}

.csv-import-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Step Indicator */
.csv-import-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 2rem 1rem;
    background: #f9fafb;
}

.csv-import-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.csv-import-step.active .step-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transform: scale(1.1);
}

.csv-import-step.completed .step-number {
    background: #10b981;
    color: white;
}

.csv-import-step.completed .step-number::after {
    content: '✓';
}

.step-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.csv-import-step.active .step-label {
    color: #667eea;
    font-weight: 600;
}

.csv-import-step-connector {
    width: 80px;
    height: 2px;
    background: #e5e7eb;
    margin: 0 1rem;
    position: relative;
    top: -20px;
}

/* Modal Body */
.csv-import-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.csv-import-step-content {
    animation: fadeInContent 0.3s ease-out;
}

@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.csv-import-step-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: #1f2937;
}

.step-description {
    margin: 0 0 1.5rem 0;
    color: #6b7280;
    font-size: 0.95rem;
}

/* Auto-detection Summary */
.csv-auto-detect-summary {
    background: #f0f9ff;
    border: 2px solid #bae6fd;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.summary-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.summary-icon {
    font-size: 1.5rem;
}

.summary-title {
    font-weight: 600;
    color: #0c4a6e;
    flex: 1;
}

.summary-details {
    font-size: 0.9rem;
    color: #075985;
    line-height: 1.6;
}

.summary-details dl {
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1rem;
}

.summary-details dt {
    font-weight: 600;
}

.summary-details dd {
    margin: 0;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
}

.required {
    color: #ef4444;
}

.field-hint {
    color: #6b7280;
    font-weight: 400;
    font-size: 0.85rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.2s;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control:invalid {
    border-color: #fca5a5;
}

.field-help {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.4;
}

.field-error {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 4px;
    font-size: 0.875rem;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 400;
    margin: 0;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Column Preview */
.column-preview {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.column-preview h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: #374151;
}

.preview-table-scroll {
    overflow-x: auto;
    max-height: 300px;
    border-radius: 6px;
}

/* Confirmation Summary */
.confirmation-summary {
    display: grid;
    gap: 1.5rem;
}

.confirmation-section {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.confirmation-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: #1f2937;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.confirmation-section dl {
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem 1.5rem;
}

.confirmation-section dt {
    font-weight: 600;
    color: #6b7280;
}

.confirmation-section dd {
    margin: 0;
    color: #1f2937;
    font-weight: 500;
}

.confirmation-note {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #fef3c7;
    border: 2px solid #fcd34d;
    border-radius: 6px;
}

.confirmation-note p {
    margin: 0;
    color: #92400e;
    font-size: 0.95rem;
}

/* Modal Footer */
.csv-import-modal-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 2rem;
    border-top: 2px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 12px 12px;
}

.footer-spacer {
    flex: 1;
}

.csv-import-modal-footer .btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.csv-import-modal-footer .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.csv-import-modal-footer .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.csv-import-modal-footer .btn-secondary {
    background: white;
    color: #374151;
    border: 2px solid #d1d5db;
}

.csv-import-modal-footer .btn-secondary:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* Responsive Design */
@media (max-width: 768px) {
    .csv-import-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .csv-import-modal-header {
        padding: 1rem 1.5rem;
    }

    .csv-import-modal-header h2 {
        font-size: 1.25rem;
    }

    .csv-import-steps {
        padding: 1.5rem 1rem 0.75rem;
    }

    .step-number {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .step-label {
        font-size: 0.75rem;
    }

    .csv-import-step-connector {
        width: 60px;
    }

    .csv-import-modal-body {
        padding: 1.5rem;
    }

    .csv-import-modal-footer {
        flex-wrap: wrap;
        padding: 1rem 1.5rem;
    }

    .csv-import-modal-footer .btn {
        padding: 0.65rem 1.25rem;
        font-size: 0.95rem;
    }

    .confirmation-section dl {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .confirmation-section dt {
        font-weight: 700;
        margin-bottom: 0.25rem;
    }
}

/* ============================================================================
   Preset Manager Styles (Phase 6-B)
   ============================================================================ */

/* Preset Load Section */
.preset-load-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8f0fe 100%);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid #d0dae8;
}

.preset-load-header {
    font-weight: 600;
    font-size: 0.95rem;
    color: #2c3e50;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preset-icon {
    font-size: 1.25rem;
}

.preset-load-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-group-inline {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.form-group-inline select {
    flex: 1;
}

.form-group-inline .btn {
    white-space: nowrap;
}

.btn-danger-outline {
    background: white;
    color: #e74c3c;
    border: 1px solid #e74c3c;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger-outline:hover:not(:disabled) {
    background: #e74c3c;
    color: white;
}

.btn-danger-outline:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.preset-info {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #d0dae8;
    font-size: 0.9rem;
    color: #34495e;
}

.preset-info strong {
    color: #2c3e50;
    font-size: 1rem;
    display: block;
    margin-bottom: 0.5rem;
}

.preset-info p {
    margin: 0.5rem 0;
    color: #7f8c8d;
    font-style: italic;
}

.preset-info ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.5rem;
    list-style-type: disc;
}

.preset-info li {
    margin: 0.25rem 0;
}

/* Preset Save Section */
.preset-save-section {
    background: linear-gradient(135deg, #fffbf0 0%, #fff4e0 100%);
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 1.5rem;
    border: 1px solid #ffeaa7;
}

.preset-save-section h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: #2c3e50;
}

.preset-save-section .section-description {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    color: #7f8c8d;
}

#preset-save-fields {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #ffeaa7;
}

#preset-save-fields .form-group {
    margin-bottom: 1rem;
}

#preset-save-fields textarea {
    resize: vertical;
    min-height: 60px;
}

/* Responsive adjustments for preset UI */
@media (max-width: 768px) {
    .form-group-inline {
        flex-direction: column;
    }

    .form-group-inline select,
    .form-group-inline .btn {
        width: 100%;
    }
}
