/**
 * Flaeske Restaurant Comparison Styles
 * Following brand guidelines exactly - Simple & Coherent
 * Mobile-first responsive design
 */

/* ============================================
   BRAND VARIABLES
   ============================================ */
:root {
    --brand-green: #4A7C59;
    --brand-gold: #D4A017;
    --brand-cream: #F9F7F2;
    --brand-charcoal: #2C2C2C;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
.flaeske-comparison-page {
    font-family: 'Lato', sans-serif;
    color: var(--brand-charcoal);
    background-color: var(--brand-cream);
}

.flaeske-comparison-page h1,
.flaeske-comparison-page h2,
.flaeske-comparison-page h3,
.flaeske-comparison-page h4 {
    font-family: 'Merriweather', serif;
    font-weight: bold;
}

/* ============================================
   COMPARISON BUTTON
   ============================================ */
.restaurant-comparison-button-wrapper {
    display: inline-block;
}

.flaeske-comparison-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--brand-green);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    font-family: 'Lato', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px -1px rgba(74, 124, 89, 0.05), 0 1px 2px -1px rgba(74, 124, 89, 0.03);
}

.flaeske-comparison-btn:hover {
    background: #3a6346;
}

.flaeske-comparison-btn.in-comparison {
    background: var(--brand-green);
}

.flaeske-comparison-btn.in-comparison:hover {
    background: #3a6346;
}

.comparison-btn-icon {
    font-size: 16px;
}

.comparison-btn-text {
    white-space: nowrap;
}

/* Toolbar button style */
.flaeske-comparison-btn.hero-toolbar-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    border-radius: 8px;
}

.flaeske-comparison-btn.hero-toolbar-btn .toolbar-icon {
    font-size: 18px;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.flaeske-comparison-toast {
    position: fixed;
    bottom: 32px;
    right: 32px;
    padding: 16px 24px;
    background: var(--brand-charcoal);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    font-family: 'Lato', sans-serif;
    z-index: 10000;
    opacity: 0;
    transform: translateY(128px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 16px;
    border-left: 4px solid var(--brand-green);
}

.flaeske-comparison-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.flaeske-comparison-toast.toast-success {
    background: var(--brand-charcoal);
    border-left-color: var(--brand-green);
}

.flaeske-comparison-toast.toast-warning {
    background: var(--brand-charcoal);
    border-left-color: var(--brand-gold);
}

.flaeske-comparison-toast.toast-info {
    background: var(--brand-charcoal);
    border-left-color: var(--brand-green);
}

/* ============================================
   COMPARISON PAGE
   ============================================ */
.flaeske-comparison-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 16px;
}

/* Header - Matching hero style exactly from brand guidelines */
.comparison-header {
    background: var(--brand-green);
    border-radius: 16px;
    padding: 24px 16px;
    margin-bottom: 20px;
    color: #fff;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(212, 160, 23, 0.2);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
}

.comparison-header::before {
    content: '';
    position: absolute;
    top: -64px;
    right: -64px;
    width: 300px;
    height: 300px;
    background: var(--brand-gold);
    border-radius: 50%;
    opacity: 0.1;
    filter: blur(24px);
    pointer-events: none;
    transition: opacity 0.7s ease;
}

.comparison-header:hover::before {
    opacity: 0.2;
}

.comparison-header-content {
    position: relative;
    z-index: 10;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.comparison-header h1 {
    margin: 0 0 12px 0;
    font-size: clamp(1.5rem, 6vw, 2.5rem);
    font-weight: 900;
    font-family: 'Merriweather', serif;
    color: #fff;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.comparison-header p {
    margin: 0;
    font-size: clamp(0.875rem, 3vw, 1.125rem);
    color: rgba(249, 247, 242, 0.9);
    line-height: 1.5;
    font-family: 'Lato', sans-serif;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.comparison-header-actions {
    position: relative;
    z-index: 10;
    margin-top: 16px;
}

.comparison-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(212, 160, 23, 0.4);
    border-radius: 9999px;
    font-size: 11px;
    font-weight: bold;
    font-family: 'Lato', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    backdrop-filter: blur(4px);
    white-space: nowrap;
}

.comparison-count-badge .count-number {
    font-size: 13px;
    color: var(--brand-gold);
}

/* Search Section - Matching filter section from ui-kit.html exactly */
.comparison-add-section {
    margin-bottom: 24px;
}

.comparison-search-wrapper {
    background: var(--brand-cream);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid rgba(74, 124, 89, 0.1);
    position: relative;
}

.comparison-search-label {
    display: block;
    font-size: 12px;
    font-weight: bold;
    color: var(--brand-charcoal);
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    font-family: 'Lato', sans-serif;
}

.comparison-search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(74, 124, 89, 0.2);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Lato', sans-serif;
    color: var(--brand-charcoal);
    background: var(--brand-cream);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.comparison-search-input:focus {
    outline: none;
    border-color: var(--brand-green);
    box-shadow: 0 0 0 1px var(--brand-green);
}

.comparison-search-input::placeholder {
    color: var(--brand-charcoal);
    opacity: 0.4;
}

.comparison-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--brand-cream);
    border-radius: 8px;
    box-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.25);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    border: 1px solid rgba(74, 124, 89, 0.2);
}

.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(74, 124, 89, 0.1);
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgba(74, 124, 89, 0.05);
}

.search-result-item.in-comparison {
    background: rgba(74, 124, 89, 0.1);
}

.search-result-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.search-result-name {
    font-weight: bold;
    color: var(--brand-charcoal);
    font-size: 14px;
    font-family: 'Lato', sans-serif;
}

.search-result-location {
    font-size: 12px;
    color: var(--brand-charcoal);
    opacity: 0.6;
    font-family: 'Lato', sans-serif;
}

.search-result-add-btn {
    padding: 6px 12px;
    background: var(--brand-green);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    font-family: 'Lato', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.search-result-add-btn:hover {
    background: #3a6346;
}

.search-result-item.in-comparison .search-result-add-btn {
    background: var(--brand-green);
}

.search-loading,
.search-no-results {
    padding: 16px;
    text-align: center;
    color: var(--brand-charcoal);
    opacity: 0.6;
    font-size: 14px;
    font-family: 'Lato', sans-serif;
}

/* Empty State - Simple, no borders or special containers */
.comparison-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.comparison-empty-state h2 {
    margin: 0 0 12px 0;
    font-size: 24px;
    font-family: 'Merriweather', serif;
    font-weight: bold;
    color: var(--brand-charcoal);
}

.comparison-empty-state p {
    margin: 0 0 24px 0;
    color: var(--brand-charcoal);
    opacity: 0.6;
    line-height: 1.6;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    font-family: 'Lato', sans-serif;
}

.empty-state-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--brand-green);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    font-family: 'Lato', sans-serif;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px -1px rgba(74, 124, 89, 0.05), 0 1px 2px -1px rgba(74, 124, 89, 0.03);
}

.empty-state-cta:hover {
    background: #3a6346;
    color: #fff;
}

.empty-state-cta::after {
    content: '→';
    color: var(--brand-gold);
}

/* ============================================
   COMPARISON TABLE - EXACT match from ui-kit.html
   ============================================ */
.comparison-table-wrapper {
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid rgba(74, 124, 89, 0.2);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
    background: #ffffff;
}

.comparison-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.comparison-table {
    width: 100%;
    text-align: left;
    border-collapse: collapse;
    font-family: 'Lato', sans-serif;
}

.comparison-table th,
.comparison-table td {
    padding: 12px 16px;
    text-align: left;
    vertical-align: middle;
    box-sizing: border-box;
}

.comparison-table thead tr {
    background: var(--brand-green);
    color: #fff;
}

.comparison-table thead th {
    padding: 12px 16px;
    font-size: 13px;
    font-family: 'Merriweather', serif;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
    box-sizing: border-box;
}

.comparison-table .comparison-label-col {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
    position: sticky;
    left: 0;
    z-index: 5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    white-space: normal;
}

.comparison-table tbody .comparison-label-col {
    background: #ffffff;
    font-weight: bold;
    color: var(--brand-charcoal);
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    white-space: normal;
    line-height: 1.4;
}

.comparison-table thead .comparison-label-col {
    background: var(--brand-green);
    color: #fff;
    z-index: 15;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    white-space: normal;
    line-height: 1.3;
}

.comparison-table .restaurant-col {
    min-width: 140px;
    width: 140px;
    max-width: 140px;
}

.comparison-table tbody {
    background: #ffffff;
}

.comparison-table tbody tr {
    border-top: 1px solid rgba(74, 124, 89, 0.1);
    transition: background-color 0.2s ease;
}

.comparison-table tbody tr:first-child {
    border-top: none;
}

.comparison-table tbody tr:hover {
    background: rgba(249, 247, 242, 0.3);
}

.comparison-table tbody tr:hover .comparison-label-col {
    background: rgba(249, 247, 242, 0.3);
}

.comparison-table tbody tr:last-child td {
    border-bottom: none;
}

.comparison-table tbody td {
    white-space: nowrap;
    color: var(--brand-charcoal);
    font-size: 13px;
    box-sizing: border-box;
}

.comparison-table tbody td.comparison-label-col {
    white-space: normal;
}

.comparison-table tbody td:not(.comparison-label-col) {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.restaurant-header-cell {
    position: relative;
    padding-right: 40px;
}

.restaurant-header-cell .comparison-remove-btn {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: auto;
    height: auto;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: none;
    border-radius: 0;
    font-size: 20px;
    font-weight: normal;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    font-family: 'Lato', sans-serif;
    padding: 4px;
}

.restaurant-header-cell .comparison-remove-btn:hover {
    background: transparent;
    color: #fff;
}

.restaurant-name-link {
    display: block;
    color: #ffffff !important;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    font-family: 'Lato', sans-serif;
    line-height: 1.4;
    margin-bottom: 4px;
}

.restaurant-name-link:hover {
    text-decoration: underline;
    color: #ffffff !important;
}

.restaurant-name-link:visited {
    color: #ffffff !important;
}

.restaurant-city {
    display: block;
    font-size: 13px;
    font-weight: normal;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 2px;
    font-family: 'Lato', sans-serif;
}

/* Cell badges */
.cell-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: bold;
    font-family: 'Lato', sans-serif;
}

.cell-badge--reviewed {
    background: rgba(74, 124, 89, 0.1);
    color: var(--brand-green);
    border: 1px solid rgba(74, 124, 89, 0.2);
}

.cell-badge--pending {
    background: rgba(74, 124, 89, 0.1);
    color: var(--brand-charcoal);
    opacity: 0.6;
    border: 1px solid rgba(74, 124, 89, 0.2);
}

.cell-badge--closed {
    background: rgba(239, 68, 68, 0.1);
    color: rgba(239, 68, 68, 1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.comparison-table tbody a {
    color: var(--brand-green);
    text-decoration: none;
    font-family: 'Lato', sans-serif;
}

.comparison-table tbody a:hover {
    text-decoration: underline;
}

.comparison-table thead a {
    color: #ffffff !important;
    text-decoration: none;
    font-family: 'Lato', sans-serif;
}

.comparison-table thead a:hover {
    text-decoration: underline;
    color: #ffffff !important;
}

/* Stars */
.comparison-stars {
    color: var(--brand-gold);
    font-size: 16px;
}

.comparison-stars .rating-number {
    color: var(--brand-charcoal);
    opacity: 0.6;
    font-size: 13px;
    font-family: 'Lato', sans-serif;
}

.meat-quality-stars {
    color: var(--brand-gold);
    font-size: 14px;
}

/* Actions */
.comparison-actions {
    text-align: center;
    padding: 16px 0;
}

.comparison-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    border: 2px solid var(--brand-green);
    color: var(--brand-green);
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    font-family: 'Lato', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.comparison-clear-btn:hover {
    background: var(--brand-green);
    color: #fff;
}

/* Loading State */
.comparison-loading {
    padding: 60px 20px;
    text-align: center;
    color: var(--brand-charcoal);
    opacity: 0.6;
    font-size: 16px;
    font-family: 'Lato', sans-serif;
}

.comparison-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(249, 247, 242, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    border-radius: 16px;
    backdrop-filter: blur(4px);
}

.comparison-loading-overlay span {
    padding: 16px 32px;
    background: var(--brand-cream);
    border-radius: 8px;
    box-shadow: 0 2px 4px -1px rgba(74, 124, 89, 0.05), 0 1px 2px -1px rgba(74, 124, 89, 0.03);
    color: var(--brand-charcoal);
    font-size: 14px;
    font-family: 'Lato', sans-serif;
    border: 1px solid rgba(74, 124, 89, 0.2);
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE (320px - 479px)
   ============================================ */
@media (max-width: 479px) {
    .flaeske-comparison-page {
        padding: 12px;
    }
    
    .comparison-header {
        padding: 20px 14px;
        border-radius: 12px;
        margin-bottom: 16px;
    }
    
    .comparison-header h1 {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }
    
    .comparison-header p {
        font-size: 0.875rem;
        line-height: 1.4;
    }
    
    .comparison-header-actions {
        margin-top: 12px;
    }
    
    .comparison-count-badge {
        font-size: 10px;
        padding: 4px 10px;
        gap: 4px;
    }
    
    .comparison-count-badge .count-number {
        font-size: 12px;
    }
    
    /* Table mobile optimizations */
    .comparison-table-wrapper {
        border-radius: 8px;
        margin-bottom: 16px;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 10px 8px;
        font-size: 11px;
    }
    
    .comparison-table thead th {
        padding: 10px 8px;
        font-size: 10px;
        letter-spacing: 0.03em;
    }
    
    .comparison-table .comparison-label-col {
        width: 80px;
        min-width: 80px;
        max-width: 80px;
        padding: 10px 6px;
        font-size: 11px;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        white-space: normal;
        line-height: 1.3;
        word-break: break-word;
    }
    
    .comparison-table tbody .comparison-label-col {
        line-height: 1.35;
    }
    
    .comparison-table thead .comparison-label-col {
        line-height: 1.25;
    }
    
    .comparison-table .restaurant-col {
        min-width: 120px;
        width: 120px;
        max-width: 120px;
    }
    
    .comparison-table tbody td {
        font-size: 11px;
        line-height: 1.4;
    }
    
    .restaurant-name-link {
        font-size: 13px;
        line-height: 1.3;
    }
    
    .restaurant-city {
        font-size: 11px;
        margin-top: 2px;
    }
    
    .cell-badge {
        font-size: 10px;
        padding: 3px 8px;
    }
    
    .comparison-stars {
        font-size: 12px;
    }
    
    .comparison-stars .rating-number {
        font-size: 11px;
    }
    
    .meat-quality-stars {
        font-size: 11px;
    }
}

/* ============================================
   RESPONSIVE DESIGN - TABLET
   ============================================ */
@media (min-width: 640px) {
    .flaeske-comparison-page {
        padding: 24px;
    }
    
    .comparison-header {
        padding: 40px 28px;
        border-radius: 20px;
    }
    
    .comparison-header::before {
        top: -96px;
        right: -96px;
        width: 450px;
        height: 450px;
    }
    
    .comparison-header h1 {
        font-size: 2.25rem;
        margin-bottom: 18px;
    }
    
    .comparison-header p {
        font-size: 1rem;
    }
    
    .comparison-header-actions {
        margin-top: 20px;
    }
    
    .comparison-count-badge {
        font-size: 12px;
        padding: 6px 14px;
        gap: 6px;
    }
    
    .comparison-count-badge .count-number {
        font-size: 14px;
    }
    
    /* Table tablet optimizations */
    .comparison-table th,
    .comparison-table td {
        padding: 14px 20px;
        font-size: 14px;
    }
    
    .comparison-table thead th {
        padding: 14px 20px;
        font-size: 13px;
    }
    
    .comparison-table .comparison-label-col {
        width: 120px;
        min-width: 120px;
        max-width: 120px;
    }
    
    .comparison-table .restaurant-col {
        min-width: 160px;
        width: 160px;
        max-width: 160px;
    }
    
    .comparison-table tbody td {
        font-size: 14px;
    }
}

/* ============================================
   RESPONSIVE DESIGN - DESKTOP
   ============================================ */
@media (min-width: 992px) {
    .flaeske-comparison-page {
        padding: 32px;
    }
    
    .comparison-header {
        padding: 64px 48px;
        border-radius: 24px;
    }
    
    .comparison-header::before {
        top: -128px;
        right: -128px;
        width: 600px;
        height: 600px;
        filter: blur(48px);
    }
    
    .comparison-header h1 {
        font-size: 48px;
        margin-bottom: 24px;
    }
    
    .comparison-header p {
        font-size: 18px;
        line-height: 1.6;
    }
    
    .comparison-header-actions {
        margin-top: 24px;
    }
    
    .comparison-count-badge {
        font-size: 12px;
        padding: 6px 16px;
        gap: 8px;
    }
    
    .comparison-count-badge .count-number {
        font-size: 14px;
    }
    
    .comparison-table {
        font-size: 15px;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 16px 24px;
        font-size: 15px;
    }
    
    .comparison-table thead th {
        padding: 16px 24px;
        font-size: 14px;
    }
    
    .comparison-table .comparison-label-col {
        width: 150px;
        min-width: 150px;
        max-width: 150px;
    }
    
    .comparison-table .restaurant-col {
        min-width: 200px;
        width: 200px;
        max-width: none;
    }
    
    .comparison-table tbody td {
        font-size: 15px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .comparison-header-actions,
    .comparison-add-section,
    .comparison-actions,
    .comparison-remove-btn,
    .flaeske-comparison-toast {
        display: none !important;
    }
    
    .flaeske-comparison-page {
        padding: 0;
    }
    
    .comparison-header {
        background: var(--brand-green) !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .comparison-table-wrapper {
        display: block !important;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .comparison-table thead th {
        background: var(--brand-green) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
