* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #c5ea9e 0%, #548687 100%);
  min-height: 100vh;
  padding: 20px;
  color: #333;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

header {
  text-align: center;
  margin-bottom: 40px;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  background: linear-gradient(45deg, #8fbc96, #548687);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

header p {
  color: #666;
  font-size: 1.1rem;
}

/* Tab Navigation */
.tab-navigation {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  max-width: 450px;
  margin-left: auto;
  margin-right: auto;
}

.tab-button {
  flex: 1;
  padding: 8px 20px 8px 8px;
  border: none;
  background: transparent;
  color: #666;
  font-size: 1rem;
  font-weight: 900;
  font-family: monospace;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.tab-button:hover {
  background: rgba(143, 188, 150, 0.1);
  color: #548687;
}

.tab-button.active {
  background: linear-gradient(45deg, #8fbc96, #548687);
  color: white;
  box-shadow: 0 4px 12px rgba(143, 188, 150, 0.3);
}

/* Tab Content */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

section {
  padding: 25px;
}

section h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: #4a5568;
}

/* Timer Section */
.timer-display {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
}

.timer-circle {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8fbc96, #548687);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 15px 30px rgba(143, 188, 150, 0.3);
  position: relative;
  overflow: hidden;
}

.timer-circle::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  bottom: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
}

.timer-text {
  text-align: center;
  z-index: 2;
  position: relative;
}

.current-session {
  font-size: 1.2rem;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 10px;
}

.time-remaining {
  font-size: 3rem;
  font-weight: bold;
  color: #2d3748;
  font-family: "Courier New", monospace;
}

.timer-controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

/* Settings Section */
.settings-grid {
  margin-left: 20px;
  margin-bottom: 50px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: space-between;
}

.setting-item label {
  font-weight: 600;
  color: #4a5568;
}

.setting-item input {
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.setting-item input:focus {
  outline: none;
  border-color: #8fbc96;
}

.setting-item small {
  font-size: 0.8rem;
  color: #718096;
  font-style: italic;
}

/* Settings Toggles */
.settings-toggles {
  margin-left: 20px;
  margin-bottom: 50px;
}

.toggle-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px 0;
}

.toggle-item:last-child {
  margin-bottom: 0;
}

.toggle-item label {
  font-weight: 600;
  color: #4a5568;
  font-size: 1rem;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 60px;
  height: 30px;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 30px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(45deg, #8fbc96, #548687);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(30px);
}

.toggle-switch:hover .toggle-slider {
  box-shadow: 0 0 10px rgba(143, 188, 150, 0.3);
}

/* Settings Select */
.setting-item select {
  padding: 10px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  background: white;
}

.sound-row {
  flex-direction: row !important;
  align-items: center;
}

/* Statistics Section */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.stat-item {
  text-align: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.stat-number {
  font-size: 2rem;
  font-weight: bold;
  color: #2d3748;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.9rem;
  color: #666;
  font-weight: 500;
}

.stat-controls {
  text-align: right;
  margin: 20px 20px 20px 20px;
}

/* Session History Table */
.table-container {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 15px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.5);
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.history-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}

.history-table thead {
  background: linear-gradient(45deg, #8fbc96, #548687);
  color: white;
}

.history-table thead th:first-child {
  border-top-left-radius: 15px;
}

.history-table thead th:last-child {
  border-top-right-radius: 15px;
}

.history-table th,
.history-table td {
  padding: 14px 10px;
  text-align: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.history-table th {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.85rem;
  padding: 18px 12px;
}

.history-table tbody tr {
  transition: background-color 0.2s ease;
}

.history-table tbody tr:hover {
  background: rgba(143, 188, 150, 0.15);
  transform: scale(1.01);
  transition: all 0.2s ease;
}

.history-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.6);
}

.history-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.4);
}

.history-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 15px;
}

.history-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 15px;
}

.no-sessions {
  text-align: center;
  color: #666;
  font-style: italic;
  padding: 60px 20px;
  display: none;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 15px;
  margin: 20px 0;
}

.no-sessions.show {
  display: block;
}

.remark-input {
  width: 100%;
  max-width: 220px;
  padding: 8px 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  font-size: 0.85rem;
}

.remark-input:focus {
  outline: none;
  border-color: #8fbc96;
  box-shadow: 0 4px 12px rgba(143, 188, 150, 0.12);
}

/* Buttons */
.btn {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-family: monospace;
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.btn-primary {
  background: linear-gradient(45deg, #8fbc96, #548687);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(143, 188, 150, 0.4);
}

.btn-secondary {
  background: #718096;
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background: #4a5568;
  transform: translateY(-2px);
}

.btn-danger {
  background: #e53e3e;
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #c53030;
  transform: translateY(-2px);
}

.btn-info {
  background: #3182ce;
  color: white;
}

.btn-info:hover:not(:disabled) {
  background: #2c5aa0;
  transform: translateY(-2px);
}

.btn-outline {
  margin-left: 20px;
  background: transparent;
  color: #548687;
  border: 2px solid #548687;
}

.btn-outline:hover {
  background: #548687;
  color: white;
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 20px;
    margin: 10px;
  }

  header h1 {
    font-size: 2rem;
  }

  .tab-navigation {
    flex-direction: row;
    gap: 4px;
    max-width: 350px;
    padding: 3px;
  }

  .tab-button {
    font-size: 0.75rem;
    padding: 6px 8px;
    letter-spacing: 0.1px;
  }

  .timer-circle {
    width: 200px;
    height: 200px;
  }

  .time-remaining {
    font-size: 2.5rem;
  }

  .settings-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .timer-controls {
    flex-direction: column;
    align-items: center;
  }

  .timer-controls .btn {
    width: 100%;
    max-width: 200px;
  }
}

/* Animation for timer circle */
.timer-circle.active {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 15px 30px rgba(84, 134, 135, 0.3);
  }
  50% {
    box-shadow: 0 15px 30px rgba(84, 134, 135, 0.6);
  }
  100% {
    box-shadow: 0 15px 30px rgba(84, 134, 135, 0.3);
  }
}

/* Focus state styles */
.timer-circle.focus {
  background: linear-gradient(135deg, #8fbc96, #548687);
}

.timer-circle.short-break {
  background: linear-gradient(135deg, #c5ea9e, #4ecdc4);
}

.timer-circle.long-break {
  background: linear-gradient(135deg, #c5ea9e, #4ecdc4);
}
