@import url("styles.css");
body {
  font-family: var(--font-family);
  background-color: transparent;
  margin: 0;
  padding: 0;
  transition: background-color 0.5s ease, background-image 0.5s ease;
}

.theme-options {
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 25px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 25px;
  box-shadow: -1px 1px 2px 0px rgb(191 191 191 / 71%);
}

.slider:before {
  position: absolute;
  content: "";
  height: 17px;
  width: 17px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #3c3c3c;
}

input:checked + .slider:before {
  transform: translateX(24px);
}

.theme-button {
  margin-top: 10px;
  padding: 5px 15px;
  border: none;
  border-radius: 5px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: -1px 1px 2px 0px rgba(191, 191, 191, 0.71);
}

.theme-button:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #059669, #10b981);
  box-shadow: 0 10px 20px rgba(16, 185, 129, 0.4);
}

.modal-container {
  position: fixed;
  overflow: hidden; 
  top: 0;
  right: -100%;
  width: 335px;
  height: 100%;
  background-color: rgb(255, 255, 255);
  box-shadow: -4px 0 10px rgba(0, 0, 0, 0.3);
  transition: right 0.5s ease;
  z-index: 1000;
}

.modal-content {
  position: relative;
  overflow-y: auto;
  max-height: calc(100vh - 40px); 
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}


.modal-container.active {
  right: 0;
}

.modal-container.closing {
  right: -100%;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease;
  z-index: 999;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}


.close-button {
  top: 10px;
  left: 10px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  transition: right 0.5s ease;
}

.modal-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.close-button,
.settings-button {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
}

.user-section {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.user-avatar {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 50px;
  height: 50px;
  border: 2px solid #ccc;
  border-radius: 50px;
  overflow: hidden;
  cursor: pointer;
}

.user-avatar img {
  cursor: pointer;
  max-width: 100px;
  max-height: 100px;
  border-radius: 50%;
}

.user-avatar input[type=file] {
  display: none;
}

.user-name-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.user-name {
  font-size: 16px;
  color: var(--title-color-text);
  cursor: pointer;
  transition: color 0.3s ease;
}

.user-name:hover {
  color: var(--hover-color);
}

#editUserName {
  font-size: 14px;
  padding: 5px;
  border-radius: 4px;
  max-width: 200px;
}

.settings-list {
  list-style: none;
  padding: 0;
  width: 100%;
  margin: 0;
}

.setting-item {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 15px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.setting-item:hover {
  background-color: #f0f0f0;
  border-radius: 5px;
  color: var(--hover-color);
}

.icon-container {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

  .modal-link-highlight {
    padding-right: 15px;
    font-size: 16px;
    color: #918d8d;
    text-decoration: none;
    font-style: italic;
    opacity: 0.8;
    transition: opacity 0.3s ease, color 0.3s ease;
  }

  .modal-link-highlight:hover {
    opacity: 1;
    color: #45a049;
    text-decoration: underline;
  }

@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-width: 350px;
    padding: 15px;
  }
  .setting-item {
    font-size: 14px;
  }
  .user-avatar img {
    width: 100px;
    height: 50px;
    border-radius: 50%;
  }
  .user-name {
    font-size: 14px;
  }
}
.border {
  border-bottom: 1px solid rgba(51, 51, 51, 0.4078431373);
  margin-bottom: 10px;
}

.fade-in-calendar {
  animation: fadeInUp 0.8s ease forwards;
  opacity: 0;
  transform: translateY(8px);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.broker-select-label {
  font-size: 14px;
}

.broker-select {
  padding: 6px 10px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #ccc;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  box-shadow: -1px 1px 2px 0px rgb(191 191 191 / 71%);
}

.broker-select:focus,
.broker-select:hover {
  border-color: #4caf50;
  outline: none;
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2); 
}

    .broker-form {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    max-width: 300px;
    gap: 10px;
  }

  .broker-fieldset {
    border: none;
    padding: 0;
    margin-bottom: 10px;
  }

  .broker-legend {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 5px;
  }

  .broker-radio-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 15px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
  }
  

  .broker-radio {
  accent-color: #4caf50;
  }

  .broker-input-label {
    font-size: 13px;
    font-weight: 500;
  }

.broker-input {
  width: 243px;
  padding: 6px 10px;
  font-size: 14px;
  border-radius: 5px;
  border: 1px solid #ccc;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  box-shadow: -1px 1px 2px 0px rgb(191 191 191 / 71%);
}

.broker-input:focus,
.broker-input:hover {
  border-color: #4caf50;
  outline: none;
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}


  .broker-submit {
    padding: 8px 12px;
    font-size: 14px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: -1px 1px 2px 0px rgba(191, 191, 191, 0.71);
  }

  .broker-submit:hover,
  .broker-submit:focus {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #059669, #10b981);
  box-shadow: 0 10px 20px rgba(16, 185, 129, 0.4);
  }

  input.readonly-input {
    background-color: #f4f4f4;
    color: #999;
    cursor: not-allowed;
  }

  .locked-field {
    position: relative;
    cursor: not-allowed;
  }
  
  .locked-field::after {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #888;
    font-size: 0.9rem;
    opacity: 0.6;
  }
  

.disabled-label {
  opacity: 0.6;
  cursor: not-allowed;
}

.coming-soon {
  font-size: 0.8em;
  color: #888;
  margin-left: 4px;
}

/* ------------------- */

body.fade-bg {
  transition: background-image 0.3s ease-in-out, background-color 0.3s ease-in-out;
}

.bg-fade-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  background-color: rgba(0, 0, 0, 0.1);
  opacity: 1;
  transition: opacity 0.5s ease;
}
.bg-fade-overlay.fade-out {
  opacity: 0;
}

/* -------------------------------------------------------------------------------------- */

#marketCalendarBox {
  padding: 12px 10px;
  background-color: #fff;
  border-radius: 10px;
  margin-top: 10px;
  box-shadow: -1px 1px 2px 0px rgba(191, 191, 191, 0.71);
  max-width: 600px;
  transition: all 0.3s ease;
}

.market-calendar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Header: Month & Arrows */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 18px;
  padding: 0 10px;
  margin-bottom: 10px;
}

.calendar-title {
  color: #2d3748;
}

.calendar-header button {
  background: transparent;
  border: none;
  font-size: 11px;
  color: #073e37;
  cursor: pointer;
  padding: 6px 8px;
}


.calendar-header button:hover {
  border-radius: 50%;
  background: #e2edff;
}

/* Grid */
.calendar-grid {
  padding: 2px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  text-align: center;
  font-size: 14px;
  word-break: break-word;
  overflow-x: hidden;
}

.calendar-grid::before {
    content: "";
    position: absolute;
    top: 25px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #e0e0e0a6;
    z-index: 0;
}



/* Weekday headers */
.calendar-day {
  font-size: 11px;
  font-weight: 600;
  color: #6c7179;
  padding: 6px 0;
  /* border-bottom: 1px solid #e2e8f0; */
}

/* Individual date cells */
.calendar-date {
  background: #c9c9c966;
  box-shadow: -1px 1px 2px 0px rgba(191, 191, 191, 0.71);
  border-radius: 5px;
  padding: 5px 3px;
  position: relative;
  font-weight: 500;
  color: #4a5568;
  transition: all 0.2s ease;
  min-height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.calendar-date:hover {
  transform: translateY(-1px);
  background: #e8e8e8;
  cursor: pointer;
}

/* Today */
.calendar-date.today {
      background: linear-gradient(135deg, #10b981cc, #059668e0) !important;
  font-weight: bold;
  border: 1px solid #4caf50;
}

.calendar-date.today:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #059668e0, #10b981cc)!important;
}


.calendar-date.today .calendar-date-label {
  font-weight: bold;
  color: #fff;
}

.calendar-day-label.today-day {
  color: #059669;
  font-weight: bold;
  position: relative;
  display: inline-block;
}

.calendar-day-label.today-day::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: #059669;
  border-radius: 2px;
}

/* Closed market day */
.calendar-date.closed {
  background: #f0f0f0;
  color: #c9c9c9;
  border: 1px dashed #d3d3d3;
}

/* Event = open market day */
.calendar-date.event {
  border: 1px solid #6bc34ac9;
  box-shadow: -1px 1px 2px 0px rgba(191, 191, 191, 0.71);
  background: #ffffff;
  position: relative;
}

.calendar-date.event:hover {
  transform: translateY(-1px);
  background: #dff0d8;
  cursor: pointer;
}

.calendar-date.event::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 4px;
  height: 4px;
  background: #6bc34aa3;
  border-radius: 50%;
}

.calendar-date.short-day {
    border: solid 1px #ffcd6f;
    background-color: #fff6c4;
}


/* Empty cells */
.calendar-date.empty {
  background: transparent;
  border: none;
  box-shadow: none;
}

#calendar-tooltip {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.85rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  white-space: pre-line;
  opacity: 0;
  transition: opacity 0.2s ease;
  max-width: 90%;
}

#calendar-tooltip.visible {
  opacity: 1;
}

/* Tooltip (invisible until hover if needed later) */
.market-hours-tooltip {
  font-size: 10px;
  margin-top: 4px;
  color: #4a5568;
  line-height: 1.3;
  text-align: center;
}


.calendar-legend {
  margin-top: 12px;
  font-size: 13px;
  color: #555;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-item-text {
  font-size: 12px;
  color: #718096;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.today-dot {
  background-color: #059668e0; 
  border: 1px solid #6bc34ac9;
}
  

.event-dot {
  background-color: #ffffff; 
  border: 1px solid #6BC34A;
}

.short-day-dot {
    border: solid 1px #ffcd6f;
    background-color: #fff6c4;
}

.closed-dot {
  background-color: #c9c9c9;
}

.calendar-date.closed-day {
  background: #f0f0f0;
  color: #a0aec0;
  border: 1px dashed #d3d3d3;
}

.calendar-date.closed-today-gradient {
  background: linear-gradient(90deg, #f3a2a2, #f24747d8) !important;
  color: white;
  border: 1px solid #f24747;
  font-weight: bold;
}

.calendar-date.closed-day:hover {
  background: linear-gradient(90deg, #ffe1e1, #ffc4c4) !important;
  cursor: pointer;
}