/**
 * Compare Modal CSS
 * Path: public_html/css/compare-modal.css
 * Version: 1.0.1
 *
 * Styles for the quick comparison modal overlay.
 */

/* ============================================
   Modal Overlay
   ============================================ */

.compare-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: compareModalFadeIn 0.2s ease;
}

@keyframes compareModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.compare-modal-content {
    background-color: #ffffff;
    border-radius: 12px;
    width: 100%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.compare-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
}

.compare-modal-header h2 {
    font-size: 1.1rem;
    margin: 0;
    color: #1a1a2e;
}

.compare-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    border-radius: 4px;
}

.compare-modal-close:hover {
    color: #1a1a2e;
    background-color: #f1f3f5;
}

.compare-modal-close:focus-visible {
    outline: 2px solid #0056b3;
    outline-offset: 2px;
}

/* ============================================
   Search
   ============================================ */

.compare-modal-search {
    padding: 16px 20px;
    position: relative;
}

.compare-modal-search-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background-color: #f8f9fa;
    color: #1a1a2e;
    outline: none;
    box-sizing: border-box;
}

.compare-modal-search-input:focus {
    border-color: #0056b3;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

.compare-modal-search-results {
    position: absolute;
    top: 100%;
    left: 20px;
    right: 20px;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 10;
}

.compare-modal-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background-color 0.1s ease;
}

.compare-modal-search-item:hover {
    background-color: #f1f3f5;
}

.compare-modal-search-item img {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    object-fit: contain;
    flex-shrink: 0;
}

.compare-modal-search-item span {
    font-size: 0.9rem;
    color: #1a1a2e;
}

.compare-modal-search-none {
    padding: 12px 14px;
    color: #6c757d;
    font-size: 0.85rem;
    text-align: center;
}

/* ============================================
   Quick Table
   ============================================ */

.compare-modal-table {
    padding: 0 20px 16px;
}

.compare-modal-empty {
    text-align: center;
    color: #6c757d;
    padding: 24px 0;
    font-size: 0.9rem;
}

.compare-modal-grid {
    display: grid;
    gap: 12px;
}

.compare-modal-grid[data-count="2"] {
    grid-template-columns: 1fr 1fr;
}

.compare-modal-grid[data-count="3"] {
    grid-template-columns: 1fr 1fr 1fr;
}

.compare-modal-tool {
    position: relative;
    text-align: center;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.compare-modal-tool-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: #e9ecef;
    color: #495057;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.compare-modal-tool-remove:hover {
    background: #dc3545;
    color: #ffffff;
}

.compare-modal-tool img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: contain;
    margin-bottom: 6px;
}

.compare-modal-tool-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.compare-modal-tool-desc {
    font-size: 0.8rem;
    color: #595f66;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.compare-modal-tool-pricing {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
}

.compare-modal-tool-pricing span {
    font-size: 0.7rem;
    padding: 2px 8px;
    background-color: #e8f5e9;
    color: #2e7d32;
    border-radius: 3px;
}

.compare-modal-tool-rating {
    font-size: 0.78rem;
    color: #f59e0b;
    margin-top: 4px;
}

/* ============================================
   Footer
   ============================================ */

.compare-modal-footer {
    padding: 12px 20px 16px;
    text-align: center;
}

.compare-modal-full-link {
    display: inline-block;
    padding: 10px 24px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #ffffff;
    background-color: #0056b3;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.compare-modal-full-link:hover {
    background-color: #004085;
}

.compare-modal-full-link:focus-visible {
    outline: 2px solid #0056b3;
    outline-offset: 2px;
}

/* ============================================
   Dark Mode
   ============================================ */

[data-theme="dark"] .compare-modal-content {
    background-color: #1e293b;
}

[data-theme="dark"] .compare-modal-header {
    border-bottom-color: #334155;
}

[data-theme="dark"] .compare-modal-header h2 {
    color: #e2e8f0;
}

[data-theme="dark"] .compare-modal-close {
    color: #94a3b8;
}

[data-theme="dark"] .compare-modal-close:hover {
    color: #e2e8f0;
    background-color: #334155;
}

[data-theme="dark"] .compare-modal-search-input {
    background-color: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .compare-modal-search-input:focus {
    border-color: #2563eb;
    background-color: #1e293b;
}

[data-theme="dark"] .compare-modal-search-results {
    background-color: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .compare-modal-search-item:hover {
    background-color: #334155;
}

[data-theme="dark"] .compare-modal-search-item span {
    color: #e2e8f0;
}

[data-theme="dark"] .compare-modal-tool {
    background-color: #0f172a;
    border-color: #334155;
}

[data-theme="dark"] .compare-modal-tool-remove {
    background: #334155;
    color: #cbd5e1;
}

[data-theme="dark"] .compare-modal-tool-remove:hover {
    background: #dc3545;
    color: #ffffff;
}

[data-theme="dark"] .compare-modal-tool-name {
    color: #e2e8f0;
}

[data-theme="dark"] .compare-modal-tool-desc {
    color: #94a3b8;
}

[data-theme="dark"] .compare-modal-tool-pricing span {
    background-color: #14532d;
    color: #86efac;
}

[data-theme="dark"] .compare-modal-full-link {
    background-color: #2563eb;
}

[data-theme="dark"] .compare-modal-full-link:hover {
    background-color: #1d4ed8;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 600px) {
    .compare-modal-overlay {
        padding: 10px;
    }

    .compare-modal-content {
        max-height: 90vh;
    }

    .compare-modal-grid {
        grid-template-columns: 1fr !important;
    }
}
