/* ==============================================================
   PricesHub.ge — Modern Premium Light Theme
   Professional UI/UX Overrides (CSS-only, SEO-safe)
   ============================================================== */

/* ─── 0. CSS Custom Properties (Design Tokens) ─── */
:root {
    --ph-bg: #f0f2f5;
    --ph-surface: #ffffff;
    --ph-surface-hover: #fafbfc;
    --ph-border: #e5e7eb;
    --ph-border-light: #f3f4f6;
    --ph-text-primary: #111827;
    --ph-text-secondary: #6b7280;
    --ph-text-muted: #9ca3af;
    --ph-accent: #2563eb;
    --ph-accent-light: #dbeafe;
    --ph-accent-hover: #1d4ed8;
    --ph-green: #059669;
    --ph-amber: #d97706;
    --ph-sky: #0284c7;
    --ph-red: #dc2626;
    --ph-sidebar-bg: #111827;
    --ph-sidebar-text: #9ca3af;
    --ph-sidebar-active: #ffffff;
    --ph-radius-sm: 8px;
    --ph-radius-md: 12px;
    --ph-radius-lg: 16px;
    --ph-shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
    --ph-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --ph-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
    --ph-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── 1. Global Reset & Base ─── */
body {
    background-color: var(--ph-bg) !important;
    color: var(--ph-text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
#wrapper {
    min-height: 100vh !important;
    display: flex !important;
}
#wrapper #content-wrapper {
    background-color: var(--ph-bg) !important;
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
}
#content {
    flex: 1 0 auto !important;
}

/* ─── 2. Sidebar ─── */
.sidebar,
.sidebar.bg-gradient-primary {
    background: var(--ph-sidebar-bg) !important;
    box-shadow: none !important;
}
.sidebar .sidebar-brand {
    color: var(--ph-sidebar-active) !important;
    padding: 1.25rem 1rem !important;
}
.sidebar .sidebar-brand-icon i {
    color: var(--ph-accent) !important;
}
.sidebar hr.sidebar-divider {
    border-top: 1px solid rgba(255,255,255,0.06) !important;
    margin: 0.5rem 1rem !important;
}
.sidebar-heading {
    color: rgba(255,255,255,0.35) !important;
    font-size: 0.65rem !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
    padding: 0.75rem 1rem 0.25rem !important;
}
.sidebar .nav-item .nav-link {
    color: var(--ph-sidebar-text) !important;
    transition: color var(--ph-transition), background var(--ph-transition);
    font-size: 0.875rem !important;
    padding: 0.65rem 1rem !important;
}
.sidebar .nav-item .nav-link i {
    color: rgba(255,255,255,0.25) !important;
    transition: color var(--ph-transition);
    font-size: 0.9rem !important;
}
.sidebar .nav-item .nav-link:hover,
.sidebar .nav-item.active .nav-link {
    color: var(--ph-sidebar-active) !important;
    background: rgba(255,255,255,0.04) !important;
}
.sidebar .nav-item .nav-link:hover i,
.sidebar .nav-item.active .nav-link i {
    color: var(--ph-accent) !important;
}

/* Toggled sidebar (icon-only mode) */
.sidebar.toggled .nav-item .nav-link {
    padding: 0.75rem 0 !important;
}

/* Social icon in sidebar */
.sidebar .text-center.d-none.d-md-inline a {
    color: rgba(255,255,255,0.4) !important;
    transition: color var(--ph-transition);
}
.sidebar .text-center.d-none.d-md-inline a:hover {
    color: #fff !important;
}

/* ─── 3. Topbar ─── */
.topbar {
    background: var(--ph-surface) !important;
    box-shadow: var(--ph-shadow-sm) !important;
    border-bottom: 1px solid var(--ph-border) !important;
    height: auto !important;
    min-height: 3.5rem;
}

/* ─── 4. Page Heading ─── */
.h3,
h1.h3 {
    font-weight: 700 !important;
    color: var(--ph-text-primary) !important;
    font-size: 1.35rem !important;
    letter-spacing: -0.01em;
}

/* ─── 5. Cards — Global ─── */
.card {
    border: 1px solid var(--ph-border) !important;
    border-radius: var(--ph-radius-lg) !important;
    background: var(--ph-surface) !important;
    box-shadow: var(--ph-shadow-sm) !important;
    transition: box-shadow var(--ph-transition), transform var(--ph-transition) !important;
    overflow: hidden;
}
.card:hover {
    box-shadow: var(--ph-shadow-md) !important;
    transform: translateY(-2px) !important;
}
.card-body {
    padding: 1.25rem !important;
}
.card-header {
    background: var(--ph-surface) !important;
    border-bottom: 1px solid var(--ph-border-light) !important;
    padding: 0.875rem 1.25rem !important;
}
.card-header h6 {
    font-size: 0.875rem !important;
    font-weight: 700 !important;
    color: var(--ph-text-primary) !important;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ─── 6. Top "Best Price" Summary Cards ─── */
/* Replace left-border accents with subtle top-line */
.border-left-primary { border-left: none !important; border-top: 3px solid var(--ph-accent) !important; }
.border-left-success { border-left: none !important; border-top: 3px solid var(--ph-green) !important; }
.border-left-info    { border-left: none !important; border-top: 3px solid var(--ph-sky) !important; }
.border-left-warning { border-left: none !important; border-top: 3px solid var(--ph-amber) !important; }
.border-left-danger  { border-left: none !important; border-top: 3px solid var(--ph-red) !important; }

/* Fuel-type label in summary cards */
.text-xs.font-weight-bold {
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    color: var(--ph-text-muted) !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.3;
    margin-bottom: 0.35rem !important;
}
/* Company logo thumbnails in summary cards */
.text-xs img,
#bestprice .text-xs img {
    width: 20px !important;
    height: 20px !important;
    border-radius: 4px !important;
    margin-right: 6px !important;
    vertical-align: middle;
    box-shadow: none !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

/* Price numbers in summary cards */
#output, #outputap, #outputp, #outputar, #outputrr,
#outputdd, #outputed, #outputd, #outputga, #outputgal {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: #4e73df !important;
    background-color: #f8f9fc !important;
    border: 1px solid #e3e6f0 !important;
    padding: 5px 12px !important;
    border-radius: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    white-space: nowrap !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.2s ease;
}
#output:hover, #outputap:hover, #outputp:hover, #outputar:hover, #outputrr:hover,
#outputdd:hover, #outputed:hover, #outputd:hover, #outputga:hover, #outputgal:hover {
    background-color: #4e73df !important;
    color: #ffffff !important;
    border-color: #4e73df !important;
}

/* ─── 7. Ad Banner ─── */
#adbanner {
    margin: 0 0 1.5rem 0;
    padding: 0;
}
#adbanner a {
    margin: 0 !important;
}
#adbanner img {
    border-radius: var(--ph-radius-md) !important;
    box-shadow: var(--ph-shadow-sm);
}

/* ─── 8. Comparison Section (Dynamic) ─── */
.compare-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0;
    margin-bottom: 0;
}
.compare-tab-btn {
    background: var(--ph-bg);
    color: var(--ph-text-secondary);
    border: 1px solid var(--ph-border);
    border-radius: 999px;
    padding: 3px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--ph-transition);
    line-height: 1.4;
    white-space: nowrap;
    outline: none;
}
.compare-tab-btn i {
    margin-right: 3px;
    font-size: 0.65rem;
}
.compare-tab-btn:hover {
    background: var(--ph-accent-light);
    color: var(--ph-accent);
    border-color: var(--ph-accent);
}
.compare-tab-btn.active {
    background: var(--ph-accent);
    color: #fff;
    border-color: var(--ph-accent);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

/* Compare list items */
.compare-list {
    height: 245px;
    overflow-y: auto;
    padding-right: 5px; /* space for scrollbar */
}

@media (width < 1400px) {
    .compare-list {
        height: 215px;
    }
}

/* Custom Scrollbar for compare list */
.compare-list::-webkit-scrollbar {
    width: 6px;
}
.compare-list::-webkit-scrollbar-track {
    background: var(--ph-bg); 
    border-radius: 10px;
}
.compare-list::-webkit-scrollbar-thumb {
    background: var(--ph-border); 
    border-radius: 10px;
}
.compare-list::-webkit-scrollbar-thumb:hover {
    background: var(--ph-text-muted); 
}
.compare-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: var(--ph-radius-sm);
    transition: all var(--ph-transition);
    margin-bottom: 4px;
    position: relative;
    background: var(--ph-surface);
    border: 1px solid transparent;
}
.compare-item:hover {
    background: var(--ph-bg);
    transform: translateX(3px);
}
.compare-item--best {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.03));
    border: 1px solid rgba(16, 185, 129, 0.25);
}
.compare-item--best:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(16, 185, 129, 0.06));
}
.compare-item__rank {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--ph-bg);
    color: var(--ph-text-secondary);
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    flex-shrink: 0;
}
.compare-item.rank-1 .compare-item__rank {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
}
.compare-item.rank-2 .compare-item__rank {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
}
.compare-item.rank-3 .compare-item__rank {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
}
.compare-item__logo {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    margin-right: 10px;
    flex-shrink: 0;
    object-fit: contain;
}
.compare-item__name {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ph-text-primary);
}
.compare-item__price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ph-accent);
    white-space: nowrap;
}
.compare-item--best .compare-item__price {
    color: #059669;
}
.compare-item__currency {
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.7;
}
.compare-item__badge {
    margin-left: 8px;
    color: #f59e0b;
    font-size: 0.75rem;
    animation: crownPulse 2s ease-in-out infinite;
}
@keyframes crownPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.7; }
}

/* ─── 9. Calculator ─── */
.calc {
    text-align: left !important;
}
.calc select,
.calc input[type="number"] {
    width: 100% !important;
    padding: 10px 14px !important;
    margin: 0 0 10px 0 !important;
    border: 1px solid var(--ph-border) !important;
    border-radius: var(--ph-radius-sm) !important;
    outline: none !important;
    box-shadow: none !important;
    font-size: 0.875rem !important;
    color: var(--ph-text-primary) !important;
    background: var(--ph-surface) !important;
    transition: border-color var(--ph-transition);
    -webkit-appearance: none;
    appearance: none;
}
.calc select:focus,
.calc input[type="number"]:focus {
    border-color: var(--ph-accent) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}
.calc button {
    width: 100% !important;
    padding: 10px !important;
    margin: 4px 0 0 0 !important;
    background: var(--ph-accent) !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--ph-radius-sm) !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: background var(--ph-transition) !important;
}
.calc button:hover {
    background: var(--ph-accent-hover) !important;
}
#resultcal {
    margin-top: 12px !important;
    padding: 10px 14px;
    background: var(--ph-bg);
    border-radius: var(--ph-radius-sm);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--ph-text-primary);
    text-align: center;
}
#resultcal:empty {
    display: none;
}

/* ─── 10. Company Price Tables ─── */
/* Company card headers with logo */
.vertn {
    display: flex !important;
    align-items: center !important;
    gap: 10px;
}
.vertn img {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    object-fit: contain;
}
.vertn button {
    margin-left: auto !important;
    background: var(--ph-bg) !important;
    border: 1px solid var(--ph-border) !important;
    border-radius: 999px !important;
    font-size: 0.7rem !important;
    padding: 4px 12px !important;
    color: var(--ph-text-secondary) !important;
    cursor: pointer;
    transition: all var(--ph-transition);
    font-weight: 600;
}
.vertn button:hover {
    background: var(--ph-accent-light) !important;
    color: var(--ph-accent) !important;
    border-color: var(--ph-accent) !important;
}

/* Tables inside company cards */
table {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0;
}
th, td {
    padding: 10px 12px !important;
    text-align: left !important;
    font-size: 0.85rem;
}
th {
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    color: var(--ph-text-muted) !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--ph-border) !important;
    background: transparent !important;
}
td {
    color: var(--ph-text-secondary) !important;
    border-bottom: 1px solid var(--ph-border-light) !important;
    border-top: none !important;
    font-weight: 500;
    vertical-align: middle !important;
}
/* Price column (last column) */
td:last-child {
    text-align: right !important;
    font-weight: 800 !important;
    font-size: 0.95rem !important;
    color: var(--ph-text-primary) !important;
}
th:last-child {
    text-align: right !important;
}
/* Octane column (middle) */
td:nth-child(2) {
    text-align: center !important;
    color: var(--ph-text-muted) !important;
    font-size: 0.8rem !important;
}
th:nth-child(2) {
    text-align: center !important;
}
/* Alternating row colors */
tr:nth-child(even) {
    background-color: var(--ph-bg) !important;
}
tr:nth-child(odd) {
    background-color: var(--ph-surface) !important;
}
/* Hover effect on rows */
tbody tr {
    transition: background var(--ph-transition);
}
tbody tr:hover {
    background-color: var(--ph-accent-light) !important;
}
/* Last row in table (no bottom border) */
tbody tr:last-child td {
    border-bottom: none !important;
}

/* ─── 11. Poll Section ─── */
.OPP-linkBack {
    display: none !important;
}

/* ─── 12. Modals ─── */
.modal-window > div {
    border-radius: var(--ph-radius-lg) !important;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25) !important;
    background: var(--ph-surface) !important;
    padding: 2rem !important;
    max-width: 520px !important;
    width: 90% !important;
}
.modal-close {
    color: var(--ph-text-muted) !important;
    font-size: 1.25rem !important;
    width: 40px !important;
    height: 40px !important;
    line-height: 40px !important;
    border-radius: 50%;
    transition: background var(--ph-transition);
}
.modal-close:hover {
    background: var(--ph-bg);
    color: var(--ph-text-primary) !important;
}

/* ─── 13. Mobile Sidebar Menu (sidebar1) ─── */
.sidebar1 {
    background-color: var(--ph-sidebar-bg) !important;
}
.sidebar1 a {
    color: rgba(255,255,255,0.8) !important;
    font-size: 0.95rem !important;
    padding: 12px 20px 12px 24px !important;
}
.sidebar1 a:hover {
    background: rgba(255,255,255,0.05);
    color: #fff !important;
}

/* ─── 14. Footer ─── */
footer.sticky-footer {
    background: var(--ph-surface) !important;
    border-top: 1px solid var(--ph-border);
    padding: 1.5rem 0 !important;
}
footer .copyright {
    color: var(--ph-text-muted) !important;
    font-size: 0.75rem !important;
}

/* ─── 15. Scroll to Top Button ─── */
.scroll-to-top {
    background: var(--ph-accent) !important;
    border-radius: var(--ph-radius-sm) !important;
    box-shadow: var(--ph-shadow-md);
    transition: background var(--ph-transition);
    width: 2.5rem !important;
    height: 2.5rem !important;
    line-height: 2.5rem !important;
}
.scroll-to-top:hover {
    background: var(--ph-accent-hover) !important;
}
.scroll-to-top i {
    color: #fff !important;
}

/* ─── 16. Helper text beneath cards ─── */
.mt-4.text-center.small {
    font-size: 0.75rem !important;
    color: var(--ph-text-muted) !important;
    font-weight: 500;
    padding-top: 0.5rem;
    border-top: 1px solid var(--ph-border-light);
    margin-top: 1rem !important;
}

/* ─── 19. Contact Page Buttons & Icon Fixes ─── */
.btn-icon-split {
    display: inline-flex !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    padding: 0 !important;
    overflow: hidden;
    border: none !important;
    color: #fff !important;
    transition: transform var(--ph-transition), box-shadow var(--ph-transition) !important;
}
.btn-icon-split:hover {
    transform: translateY(-2px);
    box-shadow: var(--ph-shadow-md) !important;
    color: #fff !important;
}
.btn-icon-split .icon {
    background: rgba(0, 0, 0, 0.15) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 50px;
    padding: 0 !important;
}
.btn-icon-split .icon,
.btn-icon-split .icon i,
.btn-icon-split .icon * {
    color: #ffffff !important;
    opacity: 1 !important;
}
.btn-icon-split .icon i {
    font-size: 1.2rem !important;
}
.btn-icon-split .text {
    padding: 0.75rem 1.5rem !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #ffffff !important;
}

/* Explicit colors for button types */
.btn-primary.btn-icon-split {
    background: var(--ph-accent) !important;
}
.btn-primary.btn-icon-split:hover {
    background: var(--ph-accent-hover) !important;
}
.btn-success.btn-icon-split {
    background: var(--ph-green) !important;
}
.btn-success.btn-icon-split:hover {
    background: #047857 !important;
}
.btn-info.btn-icon-split {
    background: var(--ph-sky) !important;
}
.btn-info.btn-icon-split:hover {
    background: #0369a1 !important;
}

/* ─── 17. Responsive Tweaks ─── */
@media (max-width: 768px) {
    .h3, h1.h3 {
        font-size: 1.1rem !important;
    }
    .card-body {
        padding: 1rem !important;
    }
    .w3-bar button {
        font-size: 0.7rem !important;
        padding: 5px 10px !important;
    }
    .city li {
        font-size: 0.8rem !important;
        padding: 6px 8px !important;
    }
    table {
        font-size: 0.8rem !important;
    }
    th, td {
        padding: 8px !important;
    }
    td:last-child {
        font-size: 0.85rem !important;
    }
    .modal-window > div {
        width: 95% !important;
        padding: 1.5rem !important;
    }
}

/* ─── 18. Print Styles ─── */
@media print {
    .sidebar, .topbar, footer, .scroll-to-top, #adbanner { display: none !important; }
    body, #content-wrapper { background: #fff !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }
}

/* ─── 19. Modern Table Styling in Cards ─── */
.card-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
}

.card-body table th {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #a0aec0; /* cool gray header */
    padding: 10px 14px;
    border-bottom: 2px solid #edf2f7;
}

.card-body table td {
    padding: 12px 14px;
    font-size: 0.95rem;
    color: #4a5568;
    border-bottom: 1px solid #edf2f7;
    vertical-align: middle;
    transition: all 0.15s ease;
}

/* Alignments */
.card-body table th:nth-child(1),
.card-body table td:nth-child(1) {
    text-align: left;
}

.card-body table th:nth-child(2),
.card-body table td:nth-child(2) {
    text-align: center;
    color: #a0aec0;
    font-size: 0.85rem;
}

.card-body table th:nth-child(3),
.card-body table td:nth-child(3) {
    text-align: right;
}

/* Subtle row zebra and hover */
.card-body table tbody tr {
    transition: background-color 0.15s ease;
}
.card-body table tbody tr:nth-child(even) {
    background-color: #fcfdfe;
}
.card-body table tbody tr:hover {
    background-color: #f7fafc;
}

/* Modern Price Styling inside table divs */
.card-body table td div[class*="outputDiv"] {
    font-weight: 700;
    color: #2d3748;
    font-size: 0.98rem;
    display: inline-block;
}

/* Automatically append Lari symbol in CSS */
.card-body table td div[class*="outputDiv"]::after {
    content: " ₾";
    font-weight: 500;
    font-size: 0.85em;
    color: #718096;
    margin-left: 2px;
}
