:root {
  --bg-primary: #121212;
  --bg-secondary: #1E1E1E;
  --bg-card: #252525;
  --accent-color: #D4AF37; /* Gold accent */
  --accent-secondary: #a07b2b; /* Taupe */
  --text-primary: #F5F5F5;
  --text-secondary: #B0B0B0;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  --border-radius: 12px;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

h1 {
  font-weight: 300;
  font-size: 2.5rem;
  letter-spacing: 1px;
  color: var(--accent-color);
  margin: 0;
}

#settings-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
}

#settings-btn:hover {
  color: var(--accent-color);
}

.timer-display {
  text-align: center;
  margin-bottom: 3rem;
}

#timer {
  font-size: 4rem;
  font-weight: 300;
  margin: 1.5rem 0;
  letter-spacing: 2px;
  color: var(--text-primary);
  font-feature-settings: "tnum";
}

#timer-btn {
  padding: 1rem 3rem;
  font-size: 1.1rem;
  background-color: var(--bg-card);
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 1px;
  text-transform: uppercase;
}

#timer-btn:hover {
  background-color: rgba(212, 175, 55, 0.1);
}

#timer-btn.running {
  color: #E57373;
  border-color: #E57373;
}

#timer-btn.running:hover {
  background-color: rgba(229, 115, 115, 0.1);
}

.stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3rem;
  gap: 2rem;
}

.stat-card {
  background-color: var(--bg-card);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  flex: 1;
  min-width: 0;
  text-align: center;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.stat-card h3 {
  margin-top: 0;
  color: var(--accent-secondary);
  font-weight: 400;
  letter-spacing: 1px;
  font-size: 1rem;
}

.stat-card p {
  font-size: 1.5rem;
  margin: 1rem 0;
  color: var(--text-primary);
}

.stat-card p:last-child {
  color: var(--accent-color);
  font-size: 1.75rem;
  font-weight: 300;
}

.history {
  background-color: var(--bg-card);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 1rem;
  color: var(--accent-secondary);
  font-weight: 400;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

tr:last-child td {
  border-bottom: none;
}

#history-table th:nth-child(4),
#history-table td:nth-child(4) {
    width: 50px;
    text-align: center;
}

.delete-btn {
    background: none;
    border: none;
    color: #E57373; /* Same red as the stop button */
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.delete-btn:hover {
    background-color: rgba(229, 115, 115, 0.1);
    transform: scale(1.1);
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: var(--bg-card);
  margin: 10% auto;
  padding: 2.5rem;
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 400px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.reset-btn {
    width: 100%;
    padding: 1rem;
    background-color: #aa2d2d; /* Same red as stop button */
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    letter-spacing: 1px;
    transition: var(--transition);
    text-transform: uppercase;
    margin-top: 1.5rem;
}

.reset-btn:hover {
    background-color: #790707;
    transform: translateY(-2px);
}

.close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  color: var(--text-secondary);
  font-size: 1.5rem;
  font-weight: 300;
  cursor: pointer;
  transition: var(--transition);
}

.close:hover {
  color: var(--accent-color);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

.form-group input {
  width: 94%;
  padding: 1rem;
  background-color: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: var(--transition);
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

#save-settings {
  width: 100%;
  padding: 1rem;
  background-color: var(--accent-color);
  color: var(--bg-primary);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  letter-spacing: 1px;
  transition: var(--transition);
  text-transform: uppercase;
}

#save-settings:hover {
  background-color: #E6C875;
  transform: translateY(-2px);
}

/* Mobile styles */
/* Calendar Styles */
.calendar-container {
  background-color: var(--bg-card);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 2rem;
}

.calendar {
  width: 100%;
  margin-top: 1rem;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.calendar-header button {
  background-color: var(--bg-secondary);
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
  border-radius: var(--border-radius);
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.calendar-header button:hover {
  background-color: rgba(212, 175, 55, 0.1);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--accent-secondary);
  font-weight: 500;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

.calendar-days div {
  padding: 0.8rem;
  text-align: center;
  border-radius: 6px;
  transition: var(--transition);
}

.calendar-days div:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.calendar-days .today {
  background-color: var(--accent-color);
  
  font-weight: 500;
}

.calendar-days .work-day {
  background-color: rgba(212, 175, 55, 0.2);
  border: 1px solid var(--accent-color);
}

/* Mobile styles */
/* Mobile styles (when height > width) */
@media (max-aspect-ratio: 1/1) and (max-width: 750px) {
    .calendar-days div {
      padding: 0.5rem;
      font-size: 0.9rem;
  }

  .container {
    padding: 1.2rem;
  }
  
  /* Header adjustments */
  header {
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  /* Timer adjustments */
  #timer {
    font-size: 2.5rem;
    margin: 1rem 0;
  }
  
  #timer-btn {
    padding: 0.8rem 2rem;
    font-size: 1rem;
  }
  
  /* Stats cards */
  .stats {
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
  }
  
  .stat-card {
    padding: 1.2rem;
  }
  
  .stat-card p {
    font-size: 1.3rem;
  }
  
  .stat-card p:last-child {
    font-size: 1.5rem;
  }
  
  /* History table */
  .history {
    padding: 1.2rem;
  }
  
  th, td {
    padding: 0.6rem;
    font-size: 0.9rem;
  }
  
  /* Modal specific adjustments */
  .modal-content {
    margin: 10% auto;
    padding: 1.2rem;
    width: 85%;
    max-height: 80vh;
    overflow-y: auto;
  }
  
  .close {
    top: 0.8rem;
    right: 0.8rem;
  }
  
  .form-group input,
  #save-settings,
  .reset-btn {
    padding: 0.8rem;
    font-size: 0.9rem;
  }
  
  .delete-btn {
    width: 25px;
    height: 25px;
    font-size: 1rem;
  }
}

.day-details {
  background-color: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin-top: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.day-details h3 {
  color: var(--accent-color);
  margin-top: 0;
  margin-bottom: 1rem;
}

.work-session-item {
  padding: 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
}

.work-session-item:last-child {
  border-bottom: none;
}

.calendar-days div {
  aspect-ratio: 1; /* Make cells square */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.calendar-days div.selected {
  transform: scale(1.1);
  box-shadow: 0 0 0 2px var(--accent-color);
  z-index: 1;
  position: relative;
}

.work-session-item.summary {
  background-color: rgba(212, 175, 55, 0.1);
  border-top: 1px solid var(--accent-color);
  margin-top: 0.5rem;
  padding-top: 1rem;
}

.work-session-item.summary span {
  font-weight: 500;
}

.chart-container {
  width: 84%;
  max-width: 1200px; /* or any consistent width matching other elements */
  margin: 2rem auto 0 auto; /* center horizontally */
  background-color: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow);
}

.calendar-container {
  width: 84%;
  max-width: 700px; /* or any consistent width matching other elements */
  max-height: 700px; /* or any consistent width matching other elements */
  margin: 2rem auto 0 auto; /* center horizontally */
  background-color: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow);
}
