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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #172b4d;
  padding: 12px;
  background: #fff;
  min-height: 100vh;
  overflow-x: hidden;
}

.container {
  max-width: 400px;
  margin: 0 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* Modal-specific optimizations */
@media (max-height: 600px) {
  body {
    padding: 8px;
  }
  
  .container {
    max-width: 100%;
  }
  
  h3 {
    margin-bottom: 12px;
    font-size: 16px;
  }
  
  .form-group {
    margin-bottom: 12px;
  }
  
  .timer-display {
    font-size: 28px;
    padding: 16px;
    margin-bottom: 8px;
  }
}

/* Typography */
h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #172b4d;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-family: inherit;
}

.btn-primary {
  background-color: #0079bf;
  color: #fff;
}

.btn-primary:hover {
  background-color: #026aa7;
}

.btn-danger {
  background-color: #eb5a46;
  color: #fff;
}

.btn-danger:hover {
  background-color: #cf513d;
}

.btn-secondary {
  background-color: #091e420a;
  color: #172b4d;
}

.btn-secondary:hover {
  background-color: #091e4214;
}

.button-group {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  padding-top: 8px;
}

.button-group .btn {
  flex: 1;
  padding: 6px 12px;
  font-size: 13px;
}

/* Compact textarea for modals */
textarea.form-control {
  resize: vertical;
  min-height: 50px;
  max-height: 80px;
}

/* Inline form layouts for compact display */
.form-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.form-col {
  flex: 1;
}

.form-col-small {
  flex: 0 0 80px;
}

.form-col-half {
  flex: 1;
}

.form-col-large {
  flex: 2;
}

.form-row .form-group {
  margin-bottom: 0;
  flex: 1;
}

.form-row .form-group label {
  margin-bottom: 4px;
  font-size: 12px;
}

.form-row .form-control {
  padding: 6px 8px;
  font-size: 13px;
}

/* Timer Display */
.timer-display {
  font-size: 32px;
  font-weight: 600;
  text-align: center;
  padding: 16px;
  background: #f4f5f7;
  border-radius: 6px;
  margin-bottom: 8px;
  font-family: 'Courier New', monospace;
  color: #0079bf;
}

.current-session {
  text-align: center;
  font-size: 12px;
  color: #5e6c84;
  margin-bottom: 8px;
}

/* Forms */
.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
  color: #5e6c84;
  font-size: 13px;
}

.form-control {
  width: 100%;
  padding: 6px 10px;
  font-size: 14px;
  line-height: 1.4;
  color: #172b4d;
  background-color: #fafbfc;
  border: 2px solid #dfe1e6;
  border-radius: 3px;
  transition: border-color 0.2s ease;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: #0079bf;
  background-color: #fff;
}

input[type="number"].form-control {
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

textarea.form-control {
  resize: vertical;
  min-height: 60px;
}

/* Time Entries Display */
.member-section {
  margin-bottom: 24px;
  border: 1px solid #dfe1e6;
  border-radius: 3px;
  overflow: hidden;
}

.member-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f4f5f7;
  border-bottom: 1px solid #dfe1e6;
}

.member-total {
  font-size: 16px;
  font-weight: 600;
  color: #0079bf;
}

.entries-list {
  padding: 8px;
}

/* Time Entries Table */
.entries-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 13px;
}

.entries-table th {
  background-color: #f4f5f7;
  border: 1px solid #dfe1e6;
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  color: #5e6c84;
  font-size: 12px;
}

.entries-table td {
  border: 1px solid #dfe1e6;
  padding: 8px 12px;
  vertical-align: middle;
}

.entries-table tbody tr:hover {
  background-color: #f8f9fa;
}

.entries-table tbody tr:nth-child(even) {
  background-color: #fafbfc;
}

.entries-table tbody tr:nth-child(even):hover {
  background-color: #f0f1f3;
}

.entry-actions-table {
  display: flex;
  gap: 4px;
}

.btn-table-action {
  padding: 4px 8px;
  font-size: 11px;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  font-weight: 500;
}

.btn-edit-table {
  background-color: #0079bf;
  color: white;
}

.btn-edit-table:hover {
  background-color: #026aa7;
}

.btn-delete-table {
  background-color: #eb5a46;
  color: white;
}

.btn-delete-table:hover {
  background-color: #cf513d;
}

.no-entries {
  text-align: center;
  padding: 32px;
  color: #5e6c84;
  font-style: italic;
}

/* Time Tracking Section (Card Detail) */
.time-section-container {
  padding: 8px 0;
  font-family: inherit;
}

.time-summary {
  margin-bottom: 12px;
  padding: 8px;
  background-color: #f4f5f7;
  border-radius: 4px;
  text-align: center;
}

.total-time-display {
  font-size: 14px;
  font-weight: 600;
  color: #172b4d;
}

.timer-status {
  margin-top: 4px;
  padding: 4px 8px;
  background-color: #61bd4f;
  color: white;
  border-radius: 3px;
  font-size: 12px;
  text-align: center;
}

.time-section-note {
  margin-top: 8px;
  text-align: center;
  color: #8c8c8c;
  font-size: 11px;
}

.time-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.time-action-btn {
  flex: 1;
  min-width: 80px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.time-action-btn:hover {
  opacity: 0.9;
}

/* Responsive layout for small spaces */
@media (max-width: 300px) {
  .time-actions {
    flex-direction: column;
  }
  
  .time-action-btn {
    flex: none;
    width: 100%;
  }
}

.entry-item {
  padding: 12px;
  margin-bottom: 8px;
  background: #fafbfc;
  border-radius: 3px;
  border-left: 3px solid #0079bf;
}

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

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.entry-type {
  font-size: 12px;
  color: #5e6c84;
}

.entry-duration {
  font-weight: 600;
  color: #172b4d;
}

.entry-date {
  font-size: 11px;
  color: #5e6c84;
  margin-bottom: 4px;
}

.entry-description {
  font-size: 13px;
  color: #172b4d;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #dfe1e6;
}

.no-entries {
  text-align: center;
  padding: 32px;
  color: #5e6c84;
}

.error {
  text-align: center;
  padding: 32px;
  color: #eb5a46;
}

.error-message {
  color: #eb5a46;
  font-size: 12px;
  margin-top: 4px;
  display: block;
}

.total-time {
  margin-top: 24px;
  padding: 16px;
  background: #e4f0f6;
  border-radius: 3px;
  text-align: center;
  font-size: 16px;
  color: #172b4d;
}

.total-time strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #5e6c84;
}

/* Reports Styles */
.container.reports {
  max-width: 100%;
  width: 100%;
  padding: 12px;
  margin: 0;
}

.filters-section {
  background: #f4f5f7;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  border: 1px solid #dfe1e6;
}

.filters-section h3 {
  margin-bottom: 12px;
  color: #172b4d;
  font-size: 16px;
}

.filter-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.filter-group {
  flex: 1;
  min-width: 150px;
}

.filter-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #5e6c84;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.date-input,
.filter-select {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  color: #172b4d;
  background-color: #fff;
  border: 2px solid #dfe1e6;
  border-radius: 3px;
  transition: border-color 0.2s ease;
}

.date-input:focus,
.filter-select:focus {
  outline: none;
  border-color: #0079bf;
}

.filter-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.btn-success {
  background-color: #61bd4f;
  color: #fff;
}

.btn-success:hover {
  background-color: #51a93f;
}

.loading {
  text-align: center;
  padding: 40px;
  color: #5e6c84;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #dfe1e6;
  border-top: 4px solid #0079bf;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.summary-section {
  background: #fff;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  border: 1px solid #dfe1e6;
  box-shadow: 0 1px 3px rgba(9, 30, 66, 0.1);
}

.summary-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stat-card {
  flex: 1;
  min-width: 120px;
  padding: 12px;
  background: #f4f5f7;
  border-radius: 6px;
  text-align: center;
  border: 1px solid #dfe1e6;
}

.stat-label {
  display: block;
  font-size: 12px;
  color: #5e6c84;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.stat-value {
  display: block;
  font-size: 20px;
  font-weight: 600;
  color: #0079bf;
}

.reports-section {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #dfe1e6;
  box-shadow: 0 1px 3px rgba(9, 30, 66, 0.1);
  overflow: hidden;
}

.reports-section h3 {
  padding: 16px;
  margin: 0;
  background: #f4f5f7;
  border-bottom: 1px solid #dfe1e6;
  font-size: 16px;
}

.table-container {
  overflow-x: auto;
  max-height: 600px;
  overflow-y: auto;
  width: 100%;
}

.reports-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.reports-table th {
  background: #f4f5f7;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: #172b4d;
  border-bottom: 1px solid #dfe1e6;
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 12px;
}

.reports-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f4f5f7;
  color: #172b4d;
  vertical-align: top;
  font-size: 12px;
}

.reports-table tr:hover {
  background-color: #f8f9fa;
}

.group-cell {
  background: #e4f0f6 !important;
  font-weight: 600;
  color: #0079bf;
  border-left: 4px solid #0079bf;
}

.summary-row {
  background: #fff3cd !important;
  border-top: 2px solid #ffeaa7;
}

.summary-row td {
  font-weight: 600;
  color: #856404;
  text-align: center;
}

.no-data {
  text-align: center;
  padding: 60px 20px;
  color: #5e6c84;
}

.no-data-content h3 {
  margin-bottom: 12px;
  color: #172b4d;
}

.no-data-content p {
  font-size: 14px;
  color: #5e6c84;
  line-height: 1.6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .container.reports {
    padding: 12px;
  }
  
  .filter-row {
    flex-direction: column;
  }
  
  .filter-actions {
    flex-direction: column;
  }
  
  .filter-actions .btn {
    width: 100%;
  }
  
  .summary-stats {
    flex-direction: column;
  }
  
  .reports-table {
    font-size: 12px;
  }
  
  .reports-table th,
  .reports-table td {
    padding: 8px 12px;
  }
}

/* Edit button styles */
.btn-edit {
  background: #0079bf;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  transition: background-color 0.2s;
}

.btn-edit:hover {
  background: #026aa7;
}

.btn-edit:disabled {
  background: #ddd;
  cursor: not-allowed;
}

/* Actions column styling */
.reports-table th:last-child,
.reports-table td:last-child {
  text-align: center;
  min-width: 80px;
}

/* Card entry action buttons */
.entry-actions {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.btn-edit-small,
.btn-delete-small {
  padding: 2px 6px;
  border: none;
  border-radius: 2px;
  font-size: 10px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-edit-small {
  background: #0079bf;
  color: white;
}

.btn-edit-small:hover {
  background: #026aa7;
}

.btn-delete-small {
  background: #eb5a46;
  color: white;
}

.btn-delete-small:hover {
  background: #cf513d;
}

.entry-item {
  position: relative;
}
