/* ================================
   🌐 ROOT VARIABLES
===================================*/
:root {
  /* Header */
  --header-bg: #111;
  --header-text-color: #fff;
  --header-padding-y: 12px;
  --header-padding-x: 20px;

  /* Rank display */
  --rank-font-size: 1.3em;
  --rank-font-weight: bold;
  --rank-label-color: #fbbf24;
  --rank-title-color: #fff;

  /* Hamburger */
  --hamburger-color: #fff;
  --hamburger-font-size: 24px;
  --hamburger-cursor: pointer;

  /* Dropdown menu */
  --dropdown-bg: #fff;
  --dropdown-text-color: #111;
  --dropdown-radius-desktop: 10px 0 0 10px;
  --dropdown-shadow: -2px 0 12px rgba(0, 0, 0, 0.25);
  --dropdown-width-desktop: 50%;
  --dropdown-height-desktop: 60%;
  --dropdown-transform-hidden: translateX(100%);
  --dropdown-transform-visible: translateX(0);
  --dropdown-opacity-hidden: 0;
  --dropdown-opacity-visible: 1;
  --dropdown-transition: 0.4s ease;

  /* Dropdown links/buttons */
  --dropdown-item-padding-y: 14px;
  --dropdown-item-padding-x: 18px;
  --dropdown-item-font-size: 16px;
  --dropdown-item-hover-bg: #f4f4f4;

  /* Dropdown responsive (tablet) */
  --dropdown-width-tablet: 80%;
  --dropdown-height-tablet: 70%;
  --dropdown-radius-tablet: 10px 0 0 0;

  /* Dropdown responsive (mobile) */
  --dropdown-width-mobile: 60%;
  --dropdown-height-mobile: 30%;
  --dropdown-radius-mobile: 0;

  /* Profile card */
  --card-bg: #fff;
  --card-text-color: #111;
  --card-padding: 20px;
  --card-radius: 10px;
  --card-max-width: 400px;
  --card-margin-top: 40px;
  --card-margin-bottom: 10px;
  --card-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);

  /* Profile actions */
  --action-margin-top: 15px;
  --action-btn-bg: #fbbf24;
  --action-btn-text: #111;
  --action-btn-padding-y: 10px;
  --action-btn-padding-x: 16px;
  --action-btn-radius: 8px;

  /* My ads */
  --ads-max-width: 600px;
  --ads-margin-top: 25px;
  --ads-bg: #fff;
  --ads-radius: 10px;
  --ads-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  --ads-padding: 10px;
  --ads-border-color: #ddd;
  --ads-card-radius: 8px;

  /* Sell section */
  --sell-bg: #ffc107;
  --sell-hover-bg: #e0a800;
  --sell-text: #000;
  --sell-padding-y: 10px;
  --sell-padding-x: 20px;
  --sell-radius: 8px;

  /* Footer */
  --footer-bg: #111;
  --footer-text-color: #fff;
  --footer-padding-y: 15px;
  --footer-margin-top: 20px;

  /* Delete button */
  --delete-color: #b91c1c;
  --delete-hover-bg: #fee2e2;
}

/* ================================
   🧭 HEADER
===================================*/
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--header-padding-y) var(--header-padding-x);
  background: var(--header-bg);
  color: var(--header-text-color);
}

.rank-display {
  font-size: var(--rank-font-size);
  font-weight: var(--rank-font-weight);
}

.rank-label {
  color: var(--rank-label-color);
}

.rank-title {
  color: var(--rank-title-color);
}

/* ================================
   🍔 HAMBURGER MENU
===================================*/
.hamburger-icon {
  background: none;
  border: none;
  color: var(--hamburger-color);
  font-size: var(--hamburger-font-size);
  cursor: var(--hamburger-cursor);
}

.menu-wrapper {
  position: relative;
  margin-left: auto;
}

/* ================================
   📜 DROPDOWN MENU
===================================*/
.dropdown-menu {
  position: fixed;
  top: 0;
  right: 0;
  background: var(--dropdown-bg);
  color: var(--dropdown-text-color);
  border-radius: var(--dropdown-radius-desktop);
  box-shadow: var(--dropdown-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  width: var(--dropdown-width-desktop);
  height: var(--dropdown-height-desktop);
  transform: var(--dropdown-transform-hidden);
  opacity: var(--dropdown-opacity-hidden);
  transition: transform var(--dropdown-transition), opacity var(--dropdown-transition);
}

.dropdown-menu.show {
  transform: var(--dropdown-transform-visible);
  opacity: var(--dropdown-opacity-visible);
}

.dropdown-menu button,
.dropdown-menu a {
  background: none;
  border: none;
  text-align: left;
  padding: var(--dropdown-item-padding-y) var(--dropdown-item-padding-x);
  font-size: var(--dropdown-item-font-size);
  cursor: pointer;
  width: 100%;
  color: var(--dropdown-text-color);
}

.dropdown-menu button:hover,
.dropdown-menu a:hover {
  background: var(--dropdown-item-hover-bg);
}

/* ================================
   📱 RESPONSIVE
===================================*/
@media (max-width: 768px) {
  .dropdown-menu {
    width: var(--dropdown-width-tablet);
    height: var(--dropdown-height-tablet);
    border-radius: var(--dropdown-radius-tablet);
  }
}

@media (max-width: 480px) {
  .dropdown-menu {
    width: var(--dropdown-width-mobile);
    height: var(--dropdown-height-mobile);
    border-radius: var(--dropdown-radius-mobile);
  }
}

/* ================================
   🧾 PROFILE CARD
===================================*/
.profile-card {
  background: var(--card-bg);
  color: var(--card-text-color);
  padding: var(--card-padding);
  border-radius: var(--card-radius);
  max-width: var(--card-max-width);
  margin: var(--card-margin-top) auto var(--card-margin-bottom);
  box-shadow: var(--card-shadow);
}

/* ================================
   🎯 PROFILE ACTIONS
===================================*/
.profile-actions {
  text-align: center;
  margin-top: var(--action-margin-top);
}

.profile-actions a {
  display: inline-block;
  background: var(--action-btn-bg);
  color: var(--action-btn-text);
  padding: var(--action-btn-padding-y) var(--action-btn-padding-x);
  border-radius: var(--action-btn-radius);
  font-weight: bold;
  text-decoration: none;
}

/* ================================
   📢 MY ADS
===================================*/
#myAds {
  max-width: var(--ads-max-width);
  margin: var(--ads-margin-top) auto;
  padding: var(--ads-padding);
  background: var(--ads-bg);
  border-radius: var(--ads-radius);
  box-shadow: var(--ads-shadow);
}

#myAds h2 {
  margin-bottom: 10px;
}

.ad-card {
  border: 1px solid var(--ads-border-color);
  border-radius: var(--ads-card-radius);
  padding: 10px;
  margin: 8px 0;
}

/* ================================
   💰 SELL SECTION
===================================*/
.sell-section {
  text-align: center;
  margin: 25px auto;
}

.sell-section a {
  background: var(--sell-bg);
  color: var(--sell-text);
  padding: var(--sell-padding-y) var(--sell-padding-x);
  border-radius: var(--sell-radius);
  font-weight: bold;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s;
}

.sell-section a:hover {
  background: var(--sell-hover-bg);
}

/* ================================
   ⚓ FOOTER
===================================*/
.footer {
  text-align: center;
  padding: var(--footer-padding-y) 0;
  background: var(--footer-bg);
  color: var(--footer-text-color);
  margin-top: var(--footer-margin-top);
}

/* ================================
   🟥 DELETE BUTTON
===================================*/
#menuDelete {
  color: var(--delete-color);
  font-weight: bold;
}

#menuDelete:hover {
  background: var(--delete-hover-bg);
}

.view-btn {
  background: var(--action-btn-bg);
  color: var(--action-btn-text);
  border: none;
  border-radius: var(--action-btn-radius);
  padding: 4px 10px;
  margin-left: 8px;
  cursor: pointer;
  font-size: 0.9em;
  transition: background 0.2s;
}
.view-btn:hover {
  background: #eab308;
}
/* ---------- switches UI styles ---------- */
.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(0,0,0,0.06);
  padding: 10px 12px;
  border-radius: 8px;
  margin: 8px 0;
  background: var(--card-bg);
  color: var(--card-text-color);
}

.switch-info {
  display:flex;
  flex-direction:column;
  gap:4px;
}
.switch-label {
  font-size: 1rem;
}
.switch-ts {
  font-size: 0.8rem;
  color: rgba(0,0,0,0.45);
}

.switch-actions {
  display:flex;
  gap:8px;
  align-items:center;
}

/* toggle button */
.toggle-btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  background: var(--action-btn-bg);
  color: var(--action-btn-text);
  transition: background 0.18s;
}
.toggle-btn:hover { opacity: 0.9; }

/* remove button */
.remove-btn {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.08);
  background: transparent;
  cursor: pointer;
  color: var(--delete-color);
}
.remove-btn:hover {
  background: var(--delete-hover-bg);
}

/* small action button (Add Switch) */
.action-small {
  background: var(--action-btn-bg);
  color: var(--action-btn-text);
  border: none;
  padding: 8px 12px;
  border-radius: var(--action-btn-radius);
  cursor: pointer;
  font-weight: 700;
}
.action-small:hover { opacity: 0.95; }

/* responsive */
@media (max-width: 480px) {
  .switch-row { flex-direction: column; align-items:flex-start; gap:8px; }
  .switch-actions { width:100%; display:flex; justify-content:flex-end; }
}
/* last */
.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-bottom: 8px;
  background: #f9f9f9;
}

.switch-info {
  flex: 1;
}

.switch-actions button {
  margin-left: 6px;
  padding: 4px 8px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
}

.switch-actions .toggle-btn {
  background: #fbbf24;
  color: #111;
}

.switch-actions .rename-btn {
  background: #3b82f6;
  color: #fff;
}

.switch-actions .remove-btn {
  background: #ef4444;
  color: #fff;
}
.add-switch-box {
  max-width: 600px;
  margin: 0 auto 12px;
  display: flex;
  gap: 8px;
}

.add-switch-box input {
  flex: 1;
  padding: 8px;
  border-radius: 5px;
  border: 1px solid #ccc;
}

.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 6px;
}

.switch-info {
  flex: 1;
}

.switch-actions button {
  margin-left: 6px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}
.edit-btn {
   background: orange;
}
/* ---------- Device UI styles ---------- */
#deviceSection {
  max-width: 600px;
  margin: 20px auto 12px;
}

.add-device-box {
  display: flex;
  gap: 8px;
}

.add-device-box input {
  flex: 1;
  padding: 8px;
  border-radius: 5px;
  border: 1px solid #ccc;
}
#connectDeviceBtn.connected {
  background-color: gold;
  color: black;
  box-shadow: 0 0 10px gold;
  transition: 0.3s;
}
