/* Global Transitions */
:root {
    --fcs-primary: #2563eb;
    --fcs-primary-hover: #1d4ed8;
    --fcs-bg-muted: #f8fafc;
    --fcs-border: #000000;
    --fcs-icon-color: #1e293b;
    --fcs-text: #1e293b;
    --fcs-text-light: #64748b;
    --fcs-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.fcs-comparison-page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--fcs-text);
    line-height: 1.5;
}

/* Compare Buttons (Frontend) */
.fcs-compare-btn {
    border: 1px solid var(--fcs-border);
    background: #fff;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    color: var(--fcs-icon-color);
}

.fcs-compare-btn:hover {
    background: var(--fcs-bg-muted);
    border-color: var(--fcs-primary);
    color: var(--fcs-primary);
    transform: translateY(-2px);
    box-shadow: var(--fcs-shadow);
}

.fcs-compare-btn.active {
    background: var(--fcs-primary);
    color: #fff;
    border-color: var(--fcs-primary);
}

.fcs-compare-btn svg {
    width: 18px;
    height: 18px;
}

/* Share Bar */
.fcs-shareable-url-container {
    margin-bottom: 32px;
    background: #fff;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--fcs-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.fcs-share-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--fcs-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.fcs-shareable-url-bar {
    display: flex;
    background: var(--fcs-bg-muted);
    padding: 6px;
    border-radius: 100px;
    border: 1px solid var(--fcs-border);
    align-items: center;
    max-width: 600px;
    transition: all 0.3s ease;
}

.fcs-shareable-url-bar:focus-within {
    border-color: var(--fcs-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: #fff;
}

.fcs-comparison-header .fcs-share-icon {
    padding-left: 16px;
    padding-right: 10px;
    color: var(--fcs-primary);
    display: flex;
    align-items: center;
}

@media only screen and (max-width: 768px) {
    .fcs-comparison-header .fcs-share-icon {
        padding-left: 6px;
        padding-right: 0;
    }
}

.fcs-shareable-url-bar input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px;
    font-size: 14px;
    color: var(--fcs-text);
    outline: none;
    font-family: monospace;
}

@media only screen and (max-width: 768px) {
    .fcs-shareable-url-bar input {
        padding: 0;
    }
}

.fcs-shareable-url-bar button {
    background: var(--fcs-primary);
    color: white;
    border: none;
    border-radius: 100px;
    padding: 10px 24px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    transition: all 0.2s ease;
}

@media (max-width: 768px) {
    .fcs-shareable-url-bar button {
        padding: 10px 14px;
    }
}

.fcs-shareable-url-bar button:hover {
    background: var(--fcs-primary-hover);
    transform: scale(1.02);
}

/* Sidebar Prompt Styles */
.fcs-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 340px;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    z-index: 100000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    visibility: hidden;
}

.fcs-sidebar.fcs-active {
    transform: translateX(0);
    visibility: visible;
}

.fcs-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.fcs-sidebar-overlay.fcs-active {
    opacity: 1;
    visibility: visible;
}

/* Sidebar Header */
.fcs-sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--fcs-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fcs-sidebar-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.fcs-sidebar-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 5px;
    color: var(--fcs-text-light);
}

/* Sidebar Body & Product Items */
.fcs-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.fcs-sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--fcs-border);
    position: relative;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.fcs-sidebar-item:hover {
    background: var(--fcs-bg-muted);
}

.fcs-sidebar-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--fcs-border);
}

.fcs-sidebar-item-info {
    flex: 1;
}

.fcs-sidebar-item-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--fcs-text);
    display: block;
    text-decoration: none;
}

.fcs-sidebar-item-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 18px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.fcs-sidebar-item:hover .fcs-sidebar-item-remove {
    opacity: 1;
}

/* Sidebar Footer */
.fcs-sidebar-footer {
    padding: 24px;
    border-top: 1px solid var(--fcs-border);
    background: var(--fcs-bg-muted);
}

.fcs-sidebar-msg {
    font-size: 12px;
    color: var(--fcs-text-light);
    margin-bottom: 12px;
    min-height: 18px;
    text-align: center;
}

.fcs-sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fcs-go-to-comparison-btn {
    background: var(--fcs-primary);
    color: #fff !important;
    text-decoration: none !important;
    padding: 12px;
    text-align: center;
    border-radius: 8px;
    font-weight: 700;
}

.fcs-clear-comparison-btn {
    background: none;
    border: 1px solid #cbd5e1;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--fcs-text-light);
}

.fcs-clear-comparison-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
}

/* Empty states */
.fcs-sidebar-empty {
    text-align: center;
    color: var(--fcs-text-light);
    margin-top: 50px;
}

/* Responsive Sidebar */
@media (max-width: 768px) {
    .fcs-sidebar {
        width: 100%;
    }
}

/* Table Design */
.fcs-comparison-table-wrapper {
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--fcs-border);
    box-shadow: var(--fcs-shadow);
    overflow-x: auto;
    margin-bottom: 40px;
}

.fcs-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

/* Animations */
@keyframes fcs-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.fcs-shake {
    animation: fcs-shake 0.2s ease-in-out 0s 2;
    border-color: #ef4444 !important;
}

/* Sticky Header & Cards */
.fcs-table thead th {
    position: sticky;
    top: 0;
    z-index: 100; /* Above regular cells */
    background: #fff;
    padding: 24px 16px;
    border-bottom: 1px solid var(--fcs-border);
}

.fcs-table-header-cell {
    text-align: center;
    position: relative;
    background: #fff;
    border: 1px solid var(--fcs-border);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.fcs-table-header-cell:hover {
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    transform: translateY(-4px);
    border-color: var(--fcs-primary);
}

.fcs-table-header-cell img {
    width: 100%;
    max-width: 120px;
    height: auto;
    border-radius: 8px;
    margin: 0 auto 12px;
    display: block;
}

.fcs-comparison-page .fcs-comparison-table-wrapper .fcs-table-header-cell h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--fcs-text);
    min-height: 40px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fcs-comparison-page .fcs-comparison-table-wrapper .fcs-table-header-cell h3 a {
    color: var(--fcs-text);
    text-decoration: none;
}

/* Sticky Left Column (Labels) */
.fcs-table td:first-child, 
.fcs-table th:first-child {
    position: sticky;
    left: 0;
    z-index: 101; /* Above sticky headers when both overlap */
    background: #f8fafc;
    width: 200px;
    font-weight: 700;
    border-right: 2px solid var(--fcs-border);
    color: var(--fcs-text-light);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.05em;
}

.fcs-table th, .fcs-table td {
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    border-right: 1px solid #f1f5f9;
    vertical-align: middle;
    background: #fff;
    transition: background 0.2s ease;
}

/* Row & Column Highlight */
.fcs-table tbody tr:hover td {
    background: #f1f5f9;
}

.fcs-table tbody tr:hover td:first-child {
    background: #f1f5f9;
    color: var(--fcs-primary);
}

.fcs-add-to-cart {
    display: inline-block;
    background: var(--fcs-primary);
    color: white !important;
    text-decoration: none !important;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
    border: none;
    width: 100%;
    max-width: 250px;
    box-sizing: border-box;
}

.fcs-add-to-cart:hover {
    background: var(--fcs-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.fcs-add-to-cart--select {
    background: #64748b;
}

.fcs-add-to-cart--select:hover {
    background: #475569;
    box-shadow: 0 4px 12px rgba(71, 85, 105, 0.2);
}

.fcs-remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 2;
}

/* Identical Rows Styling */
.fcs-row-identical td {
    background: #fafafa !important;
    color: var(--fcs-text-light);
    font-style: italic;
}

.fcs-row-identical td:first-child::after {
    content: "SAME";
    font-size: 9px;
    background: #e2e8f0;
    color: #475569;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    font-style: normal;
    font-weight: 700;
}

/* Difference Rows Accent */
.fcs-row-diff td:not(:first-child) {
    font-weight: 500;
}

/* Responsive Table */
@media (max-width: 1024px) {
    .fcs-table {
        min-width: 900px;
    }
}

@media (max-width: 768px) {
    .fcs-table td:first-child, 
    .fcs-table th:first-child {
        width: 140px;
        padding: 12px 16px;
    }
    
    .fcs-table th, .fcs-table td {
        padding: 12px 16px;
    }
}
