/* ===== Material Symbols ===== */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ===== Template Design Utilities ===== */
.gradient-bg {
    background: linear-gradient(135deg, #000000, #0f172a, #581c87);
}

.gradient-text {
    background: linear-gradient(to right, #ff00ff, #8a2be2, #00bfff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

.headline-bg {
    background-color: rgba(0, 0, 0, 0.7);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h1.gradient-text.headline-bg {
    text-shadow: none;
}

/* ===== Section Cards ===== */
.tool-card,
.bg-surface-container-low {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.tool-card:hover,
.bg-surface-container-low.glow-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    border-color: rgba(138, 43, 226, 0.3);
}

.glow-box {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

/* ===== FAQ Accordion ===== */
.faq-item {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    background: #f9fafb;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: rgba(138, 43, 226, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.faq-icon {
    transform: rotate(0deg);
}

.faq-answer {
    transition: max-height 0.3s ease;
}

/* ===== Share & Toast ===== */
.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
    font-size: 18px;
    font-weight: 600;
}

.share-btn:hover {
    background: #8b5cf6;
    color: #ffffff;
    border-color: #8b5cf6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.share-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
}

.share-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1f2937;
    color: #ffffff;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 100;
}

.share-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==============================
   NEW: Mode Toggle Buttons
   ============================== */
.mode-toggle-bar {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.mode-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 14px;
    border: 2px solid #e5e7eb;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #6b7280;
    flex: 1;
    min-width: 0;
    max-width: 300px;
}

@media (max-width: 640px) {
    .mode-toggle-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .mode-toggle-btn {
        max-width: 100%;
    }
}

.mode-toggle-btn:hover {
    border-color: #a78bfa;
    color: #7c3aed;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.12);
}

.mode-toggle-btn.active {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35);
}

.mode-toggle-btn .material-symbols-outlined {
    font-size: 22px;
}

.mode-toggle-label {
    white-space: nowrap;
}

/* ==============================
   NEW: Upload Drop Zones
   ============================== */
.upload-dropzone {
    border: 2px dashed #555;
    border-radius: 16px;
    background: #2d2d2d;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 480px;
    overflow: hidden;
    position: relative;
}

.upload-dropzone:hover {
    border-color: #a78bfa;
    background: #3a3a3a;
}

.upload-dropzone.drag-over {
    border-color: #a78bfa;
    background: #4a3a6e;
    box-shadow: inset 0 0 0 2px rgba(139, 92, 246, 0.3);
}

.upload-dropzone-large {
    /* same 16:9, just a visual distinction kept */
}

.hidden-file-input {
    display: none;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.upload-icon {
    font-size: 40px !important;
    color: #a78bfa;
}

.upload-label {
    font-size: 15px;
    font-weight: 600;
    color: #d1d5db;
}

.upload-hint {
    font-size: 12px;
    color: #9ca3af;
}

.upload-preview {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ==============================
   NEW: Sim Upload Row - vertical stack, full width
   ============================== */
.sim-upload-row {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.single-upload-row {
    width: 100%;
}

/* ==============================
   NEW: Controls Bar
   ============================== */
.controls-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.status-msg {
    font-size: 14px;
    font-weight: 500;
    min-width: 0;
    transition: opacity 0.3s ease;
    text-align: center;
    flex: 0 0 auto;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Inter', sans-serif;
}

.action-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #6d28d9, #9333ea);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

.action-btn:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
}

/* ==============================
   NEW: Clear Button
   ============================== */
.clear-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    border: 2px solid #d1d5db;
    background: #ffffff;
    color: #6b7280;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Inter', sans-serif;
}

.clear-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: #fef2f2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

/* ==============================
   NEW: Result Panel
   ============================== */
.result-panel {
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.result-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.result-title {
    font-size: 20px;
    font-weight: 700;
    color: #4c1d95;
    margin-bottom: 16px;
}

/* Similarity Score - difference as primary metric */
.sim-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.sim-diff-value {
    font-size: 52px;
    font-weight: 700;
    color: #ef4444;
    line-height: 1.1;
}

.sim-diff-label {
    font-size: 15px;
    color: #ef4444;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sim-score-secondary {
    font-size: 13px;
    color: #6b7280;
    font-weight: 400;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
}

/* Result Panel Gradient variant */
.result-panel-gradient {
    color: #e5e7eb;
}
.result-panel-gradient .result-title {
    color: #ffffff;
}
.result-panel-gradient .sim-score-secondary {
    color: #c4b5fd;
    border-top-color: rgba(255,255,255,0.15);
}
.result-panel-gradient .heatmap-label {
    color: #c4b5fd;
}
.result-panel-gradient .result-legend .legend-item {
    color: #d1d5db;
}

/* Blur Score */
.blur-score-display {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.score-circle {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.score-number {
    font-size: 48px;
    font-weight: 700;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.score-max {
    font-size: 18px;
    color: #9ca3af;
    font-weight: 500;
}

.blur-grade {
    font-size: 18px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 8px;
}

.grade-excellent { background: #dcfce7; color: #166534; }
.grade-good { background: #dbeafe; color: #1e40af; }
.grade-moderate { background: #fef3c7; color: #92400e; }
.grade-significant { background: #fed7aa; color: #9a3412; }
.grade-severe { background: #fecaca; color: #991b1b; }

.score-bar-track {
    width: 100%;
    height: 10px;
    background: #f3f4f6;
    border-radius: 5px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.6s ease;
    background: linear-gradient(90deg, #ef4444, #f59e0b, #22c55e);
}

.score-bar-fill.grade-excellent { background: linear-gradient(90deg, #22c55e, #16a34a); }
.score-bar-fill.grade-good { background: linear-gradient(90deg, #3b82f6, #2563eb); }
.score-bar-fill.grade-moderate { background: linear-gradient(90deg, #f59e0b, #d97706); }
.score-bar-fill.grade-significant { background: linear-gradient(90deg, #f97316, #ea580c); }
.score-bar-fill.grade-severe { background: linear-gradient(90deg, #ef4444, #dc2626); }

/* Heatmap */
.result-body {
    padding: 24px;
}

.heatmap-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.heatmap-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.heatmap-canvas {
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.result-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: inline-block;
}

/* ===== Collapse Navigation ===== */
.collapse-trigger {
    cursor: pointer;
    user-select: none;
}

.collapse-nav {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.collapse-nav.open {
    max-height: 600px;
}

.collapse-arrow {
    transition: transform 0.3s ease;
}

.collapse-arrow.open {
    transform: rotate(180deg);
}

/* ===== Body Background ===== */
body {
    background-color: #f5f5f7;
}

/* ===== Mobile Nav ===== */
@media (max-width: 767px) {
    .hamburger-btn {
        position: absolute;
        left: 16px;
    }
    .hamburger-spacer {
        display: inline-block;
        width: 40px;
    }
}

/* ===== Spacing Utilities (tailwind supplement) ===== */
.px-margin-mobile { padding-left: 16px; padding-right: 16px; }
.px-margin-desktop { padding-left: 32px; padding-right: 32px; }
.p-sm { padding: 8px; }
.p-md { padding: 20px; }
.p-lg { padding: 28px; }
.p-xl { padding: 32px; }
.py-sm { padding-top: 12px; padding-bottom: 12px; }
.py-md { padding-top: 16px; padding-bottom: 16px; }
.py-lg { padding-top: 24px; padding-bottom: 24px; }
.py-xl { padding-top: 32px; padding-bottom: 32px; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
.gap-xl { gap: 32px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mt-xl { margin-top: 32px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.mb-xl { margin-bottom: 32px; }
.pl-lg { padding-left: 24px; }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.text-foreground { color: #111827; }
.border-border { border-color: #e5e7eb; }
.space-y-4 > * + * { margin-top: 16px; }
.space-y-8 > * + * { margin-top: 32px; }

/* ===== Tools Grid (team.php ecosystem links) ===== */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
}

@media (max-width: 767px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.tool-item {
    display: flex;
    flex-direction: column;
}

.tool-item > a.tool-card {
    flex: 1;
    transition: all 0.3s ease;
}

.tool-item > a.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    border-color: rgba(138, 43, 226, 0.3);
}

.tool-desc {
    font-size: 14px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.full-width {
    width: 100%;
    position: relative;
}
