/* ==========================================================
   Comparison View Styles V11 - Final & Fully Complete Version
   This version ensures ALL panels have a dynamic background and
   maintains full support for all analysis modes.
   ========================================================== */

/* --- General Containers & Graph --- */
.comparison-graph-scroll-wrapper {
    overflow-x: auto;
    width: 100%;
    margin-bottom: 10px;
    border-radius: 12px;
    border: 1px solid var(--theme-border-primary-dark-medium);
}

.comparison-graph-container {
    position: relative;
    background: var(--theme-bg-primary-darkest);
    padding: 14px;
    min-width: 600px;
    border-radius: 12px;
    flex-shrink: 0;
}

/* --- Keyframes for Dynamic Background Animation (Moving Spheres) --- */
@keyframes movingSpheres {
    0% { background-position: 0% 0%; }
    25% { background-position: 25% 50%; }
    50% { background-position: 50% 100%; }
    75% { background-position: 75% 50%; }
    100% { background-position: 0% 0%; }
}

/* --- Analysis Insights Panel - Glassmorphism Effect --- */
.analysis-summary-panel {
    margin-bottom: 16px;
    padding: 20px;
    border-radius: 20px;
    border: 1px solid var(--theme-border-primary-dark-medium);
    position: relative;
    overflow: hidden;
    background-color: rgba(26, 26, 26, 0.7);
    transition: background 0.5s ease-out, transform 0.3s ease;
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
}
.analysis-summary-panel:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.analysis-summary-panel::before {
    content: '';
    position: absolute;
    top: -50px; left: -50px; right: -50px; bottom: -50px;
    z-index: -1;
    transition: opacity 0.5s ease;
    opacity: 1;
    background: var(--dynamic-gradient, linear-gradient(135deg, #1a1a1a, #333333));
    background-size: 1000% 1000%;
    animation: movingSpheres 25s infinite ease-in-out;
}

.analysis-summary-panel > * {
    position: relative;
    z-index: 2;
}


.analysis-summary-panel h3 {
    margin: 0 0 12px 0;
    font-size: 1.2em;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.analysis-summary-panel .insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.insight-card {
    background-color: rgba(255, 255, 255, 0.08);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}
.insight-card:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-6px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}
.insight-card .main-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.insight-icon { font-size: 2em; flex-shrink: 0; color: #fff; }
.insight-text { margin: 0; font-size: 1em; color: #fff; line-height: 1.5; }
.insight-text strong { color: #fff; font-weight: 600; }

.expand-btn {
    align-self: flex-start;
    margin-top: 8px;
    padding: 6px 12px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #fff;
    font-size: 0.85em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}
.expand-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}
.details-content {
    margin-top: 8px;
    font-size: 0.9em;
    color: #fff;
    line-height: 1.6;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 12px;
}

.model-agreement-container {
    font-size: 0.9em;
}
.model-agreement-container strong {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}
.model-tags-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.model-tag {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.85em;
    color: #e5e7eb;
    transition: background-color 0.2s ease;
}
.model-tag:hover {
    background-color: rgba(255, 255, 255, 0.2);
}
.tag-percentage {
    color: #fff;
    font-weight: 600;
    opacity: 0.8;
    margin-right: 4px;
}

/* --- Analysis Mode Switch --- */
.analysis-mode-switch {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 16px;
    background-color: rgba(26, 26, 26, 0.7);
    border-radius: 20px;
    padding: 4px;
    border: 1px solid var(--theme-border-primary-dark-medium);
    position: relative;
    overflow: hidden;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
.analysis-mode-switch::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
    opacity: 0.8;
    background: var(--dynamic-gradient, linear-gradient(135deg, #1a1a1a, #333333));
    background-size: 1000% 1000%;
    animation: movingSpheres 20s infinite ease-in-out;
}
.analysis-mode-switch input[type="radio"] { display: none; }
.analysis-mode-switch label {
    position: relative;
    z-index: 2;
    padding: 8px 16px;
    font-size: 0.9em;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    border-radius: 16px;
    transition: all 0.3s ease;
    -webkit-user-select: none;
    user-select: none;
    background-color: transparent;
}
.analysis-mode-switch input[type="radio"]:checked + label {
    background-color: rgba(255, 255, 255, 0.2);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* --- Day Selector Dropdown --- */
.day-selector-dropdown {
    background-color: rgba(26, 26, 26, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 8px;
}

.day-selector-dropdown:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.day-selector-dropdown label {
    font-weight: 500;
    color: #fff;
    font-size: 0.9em;
    flex-shrink: 0;
}

.day-selector-dropdown select {
    width: 100%;
    flex-grow: 1;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--theme-border-primary-dark-medium);
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
}

.day-selector-dropdown select:focus {
    border-color: #4CAF50;
    outline: none;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
}

.day-selector-dropdown select option:disabled {
    color: #aaa;
    background-color: #2a2a2a;
}

/* --- [V11] Accordion Panels with DYNAMIC BACKGROUND --- */
.explanation-accordion, .advanced-details {
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background-color: rgba(26, 26, 26, 0.7);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.explanation-accordion::before, .advanced-details::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    background: var(--dynamic-gradient, linear-gradient(135deg, #2a2a2a, #333333));
    background-size: 1000% 1000%;
    animation: movingSpheres 20s infinite ease-in-out;
    opacity: 0.5; /* Slightly more subtle background */
}

.explanation-accordion summary, .advanced-details summary {
    position: relative;
    z-index: 2;
    font-weight: 500; padding: 14px 18px;
    cursor: pointer; outline: none;
    color: #fff;
    display: flex; align-items: center; gap: 8px;
}

.explanation-accordion summary::-webkit-details-marker { display: none; }
.explanation-accordion summary::before { content: '▶'; font-size: 0.8em; transition: transform 0.2s ease-in-out; }
.explanation-accordion[open] > summary::before { transform: rotate(90deg); }
.explanation-accordion[open] > summary { border-bottom: 1px solid rgba(255, 255, 255, 0.2); }
.explanation-accordion .explanation-content { position: relative; z-index: 2; padding: 16px 20px; font-size: 0.9em; color: #fff; line-height: 1.6; }

.advanced-details[open] > summary { border-bottom: 1px solid rgba(255, 255, 255, 0.2); }
.advanced-details .pro-controls-advanced { position: relative; z-index: 2; }


/* --- Main Controls Panel --- */
.pro-main-controls {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 16px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);

    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    align-items: center;

    margin-top: 16px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.pro-main-controls::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    background: var(--dynamic-gradient, linear-gradient(135deg, #2a2a2a, #333333));
    background-size: 1000% 1000%;
    animation: movingSpheres 20s infinite ease-in-out;
    opacity: 0.8;
}

.pro-main-controls .control-group {
    position: relative; z-index: 2;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pro-main-controls .control-group label {
    display: block;
    margin-bottom: 0;
    font-weight: 500;
    color: #e5e7eb;
    font-size: 0.85em;
    padding-left: 4px;
}

.pro-main-controls select {
    width: 100%;
    height: 44px;
    padding: 10px 32px 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 0.95em;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.pro-main-controls select:hover {
    background-color: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.3);
}

.pro-main-controls select:focus {
    border-color: #4CAF50;
    outline: none;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.3);
}

.pro-view-toggles {
    position: relative; z-index: 2;
    display: flex;
    height: 44px;
    box-sizing: border-box;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 22px;
    padding: 4px;
}

.pro-view-toggles input { display: none; }

.pro-view-toggles label {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    font-size: 0.9em;
    font-weight: 500;
    color: #e5e7eb;
    cursor: pointer;
    z-index: 2;
    transition: color 0.4s ease;
}

.pro-view-toggles label::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 4px);
    height: calc(100% - 4px);
    border-radius: 18px;
    background-color: rgba(255, 255, 255, 0.2);
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.3s ease;
    z-index: -1;
}

.pro-view-toggles input:checked + label { color: #fff; }
.pro-view-toggles input:checked + label::before { opacity: 1; }

/* --- Advanced Details Panel Content --- */
.pro-controls-advanced { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; padding: 16px; }
.controls-section { padding: 0; border: none; margin: 0; }
.controls-section legend {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--theme-text-accent-primary);
    margin-bottom: 12px;
    padding-bottom: 6px;
    width: 100%;
    border-bottom: 1px solid var(--theme-border-primary-dark-medium);
}
.model-checkboxes { display: flex; flex-wrap: wrap; gap: 10px 14px; }
.model-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    transition: background-color 0.3s ease;
}
.model-checkbox-label:hover {
    background-color: rgba(255, 255, 255, 0.15);
}
.model-checkbox-label input[type="checkbox"]:checked + span {
    color: #4CAF50;
}
.slider-group { margin-top: 12px; }
.slider-group label { display: block; margin-bottom: 6px; font-size: 0.9em; color: #fff; }
.slider-group input[type="range"] {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 6px; border-radius: 5px;
    background: linear-gradient(to right, #ef444d, #ffee56 35%, #00cf8e 50%, #ffee56 65%, #ef444d);
    outline: none; cursor: pointer;
    transition: background 0.3s ease;
}
.slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 20px; height: 20px; border-radius: 50%;
    background: #ffffff; cursor: pointer;
    border: 2px solid #555;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    margin-top: -7px;
    transition: all 0.2s ease;
}
.slider-group input[type="range"]::-moz-range-thumb {
    width: 20px; height: 20px; border-radius: 50%;
    background: #ffffff; cursor: pointer;
    border: 2px solid #555;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.slider-group input[type="range"]::-webkit-slider-thumb:hover,
.slider-group input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.1);
}

/* --- Responsive Adjustments --- */
@media (max-width: 480px) {
    .analysis-summary-panel { padding: 14px; border-radius: 14px; }
    .analysis-mode-switch label { padding: 6px 14px; font-size: 0.85em; }
    .pro-main-controls {
        grid-template-columns: 1fr; /* Stack controls on small screens */
        gap: 12px;
    }
    .pro-controls-advanced { grid-template-columns: 1fr; gap: 12px; }
}

/* --- Typewriter Effect Cursor --- */
@keyframes blink {
    50% { opacity: 0; }
}

.details-content p.is-typing::after {
    content: '▋';
    font-weight: 400;
    color: #fff;
    opacity: 1;
    animation: blink 1s step-end infinite;
    margin-right: 2px;
}


/* הוסף בסוף הקובץ Comparison_view.css */

.expand-insights-container {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

#expand-insights-btn {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

#expand-insights-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}