body {
    font-family: 'Segoe UI', sans-serif;
    font-size: 14px;
    background: #f4f4f4;
    color: #333;
    margin: 0;
    padding: 0; /* 👈 FIXED: remove default page padding */
}


.container {
    max-width: 1500px;
    margin: 30px auto 0 auto; /* 👈 Add top margin if needed */
    background: lightgray;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.0);
    overflow-x: auto;
	margin-bottom: 80px;
}

body.dark-mode .container {    
    background: gray;
    
}

h1 {
    font-size: 28px;
    margin-bottom: 10px;
    text-align: center;
}

.date-selector {
    text-align: center;
    margin-bottom: 15px;
}

.table-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
    align-items: flex-start;
}

.price-card {
    flex: 1;
    min-width: 500px;
    max-width: 49%;
    background: #fff;
    padding: 12px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.8);
}

.price-card h2 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 16px;
}

/* Compact Table Adjustments */
table {
    border-collapse: collapse;
    width: 100%;
    font-size: 11px; /* 👈 slightly smaller font */
    table-layout: auto; /* ✅ let it auto size per content */
}

th, td {
    border: 1px solid #ddd;
    padding: 3px 5px;	
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
	white-space: nowrap;
}

.arrow-icon {
    vertical-align: middle;
    display: inline-block;
    margin-right: 4px;
}

.price-up {
    background-color: #ffe6e6;
    color: #b00000;
}

.price-down {
    background-color: #e6ffe6;
    color: #007500;
}

/* Dark mode */
body.dark-mode .price-card {
    background-color: #1e1e1e;
}



body.dark-mode th, body.dark-mode td {
    border-color: #333;
    color: #e0e0e0;
}


/* Default Light Mode */
body.light-mode {
    background: #f4f4f4;
    color: #222;
}

body.dark-mode {
    background: #121212;
    color: #e0e0e0;
}

/* Header section */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--header-bg, #f0f0f0);
    padding: 20px 20px;
    flex-wrap: wrap;
    position: relative;
}

.header-left h1 {
    margin: 0;
}

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.header-center .category-buttons {
    display: flex;
    gap: 8px;
}

.category-buttons button {
    padding: 5px 12px;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
    border-radius: 5px;
    font-weight: bold;
}

.category-buttons button.active {
    background-color: #444;
    color: #fff;
    border-color: #444;
}

.header-right {
    margin-left: auto;
}

/* End Header section */

#theme-toggle {
    background: none;
    border: 2px solid black;
    color: black;
    padding: 5px 12px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
}

body.dark-mode .main-header {
    background: #333;
    color: #fff;
}

body.dark-mode #theme-toggle {
    border-color: #ccc;
    color: #ccc;
}

body.dark-mode table,
body.dark-mode th,
body.dark-mode td {
    color: #e0e0e0;
    background-color: #1e1e1e;
    border-color: #333;
}

body.dark-mode table tr:nth-child(even) {
    background-color: #2a2a2a;
}

body.dark-mode .price-up {
    background-color: #4a1e1e;
    color: #ff6666;
}

body.dark-mode .price-down {
    background-color: #1e4a1e;
    color: #66ff66;
}

@media screen and (max-width: 768px) {
    .table-columns {
        flex-direction: column;
    }

    .price-card {
        max-width: 100%;
    }
}

/* Brand row */
.brand-bar {
    width: 100%;
    background: #fff;
    padding: 20px 0;
    display: flex;
    justify-content: center;
    border-bottom: 1px solid #ccc;
    margin-bottom: 10px;
}

body.dark-mode .brand-bar {    
    background: darkgray;    
}

body.dark-mode .comparison-card {
  display: inline-flex;           /* shrink to contents */
  flex-direction: column;
  align-items: flex-start;
  padding: 1.5rem;
  background: #000;
  border-radius: .5rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.8);
  margin: 2rem auto;
  /* no fixed width—let it size itself */
  width: fit-content;             
  max-width: 100%;                /* but never overflow page */
}

body.dark-mode .lightsaber-col {
  background-color: #444;
}

body.dark-mode .dropdown-btn {
  background: none;
  border: none;
  font-size: 0.95rem;
  cursor: pointer;
  color: #fff;
}

.brand-selector {
    display: flex;
    gap: 20px;
}

.brand-selector button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s ease;
}

.brand-selector button:hover {
    transform: scale(1.05);
}

.brand-selector img {
    width: 155px;
    height: auto;
    border-radius: 6px;
    /*box-shadow: 0 1px 5px rgba(0,0,0,0.2);*/
}
/* End Brand Bar */

.price-card-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 auto 10px auto;
    width: 100%;
    max-width: 100%;
    gap: 10px;
}

.price-card-buttons .button-left,
.price-card-buttons .button-right {
    flex: 1;
    display: flex;
    justify-content: center;
}

.price-card-buttons button {
    padding: 6px 14px;
    font-size: 14px;
    background-color: #444;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.price-card-buttons button:hover {
    background-color: #666;
}

@media (max-width: 768px) {
    .price-card-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .price-card-buttons .button-left,
    .price-card-buttons .button-right {
        width: 100%;
        justify-content: center;
    }
}


/* Comparison Table */
/* Make the price‐card a flexible, vertical container */
.comparison-card {
  display: inline-flex;           /* shrink to contents */
  flex-direction: column;
  align-items: flex-start;
  padding: 1.5rem;
  background: #fff;
  border-radius: .5rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.8);
  margin: 2rem auto;
  /* no fixed width—let it size itself */
  width: fit-content;             
  max-width: 100%;                /* but never overflow page */
}



.comparison-card #cmp-table-container {
  width: 100%;
  overflow-x: auto;               /* scroll if table too wide */
}

.comparison-card .comparison-table {
  width: auto;                    /* table will size to its columns */
  border-collapse: collapse;
  min-width: 0;                   /* allow it to shrink smaller than parent */
}


/* Wrap the table so it can scroll horizontally on small screens */
.comparison-section #cmp-table-container {
  width: 100%;
  overflow-x: auto;
  margin-top: 1rem;
}

/* Make the table itself fluid */
.comparison-section .comparison-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;          /* ensures all columns show before scrolling */
}

/* Uniform padding & borders on cells for a neat look */
.comparison-section .comparison-table th,
.comparison-section .comparison-table td {
  padding: 0.75rem 1rem;
  text-align: center;
  border: 1px solid #e2e8f0;
}

/* Control row of dropdowns also flexes */
.comparison-section .controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1rem;
}

/* Optional: style the headings inside the card */
.comparison-section h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

/* Default (light‐mode) shade */
.lightsaber-col {
  background-color: #f5f5f5;
}


.comparison-card .controls {
  display: flex;
  align-items: center;     /* vertically center labels & selects */
  gap: 0.5rem 1rem;        /* horizontal space between items */
}

.comparison-card .controls label {
  white-space: nowrap;     /* prevent wrapping */
  font-weight: 500;
}


/* Nav section */

.header-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  text-decoration: none;
  color: #333;
  font-size: 0.95rem;
}

.nav-link:hover {
  text-decoration: underline;
}

/* Dropdown */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-btn {
  background: none;
  border: none;
  font-size: 0.95rem;
  cursor: pointer;
  color: #333;
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background-color: white;
  min-width: 160px;
  box-shadow: 0px 4px 10px rgba(0,0,0,0.4);
  z-index: 10;
}

.dropdown-content a {
  color: black;
  padding: 10px 14px;
  text-decoration: none;
  display: block;
}

.dropdown-content a:hover {
  background-color: #f0f0f0;
}

.nav-dropdown:hover .dropdown-content {
  display: block;
}
