/* IELabs - View-Specific Styles (Black 000000, 1e1e1e, Red ff0000, Green 117A65, Yellow C7AA37, White) */

/* ========================================================
   HOME VIEW
   ======================================================== */
.calendar-section {
  padding: 14px;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: nowrap;
}

.calendar-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
}

.month-title {
  white-space: nowrap;
}

.calendar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.btn-icon-cal {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-icon-cal:hover {
  color: #ffffff;
  background: var(--bg-surface-hover);
  border-color: var(--accent-red);
}

.btn-today-cal {
  padding: 4px 9px;
  font-size: 0.76rem;
  font-weight: 500;
  height: 28px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  overflow-x: auto;
}

.day-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 4px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.day-card:hover {
  background: var(--bg-surface-hover);
  color: #ffffff;
}

.day-name {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.day-number {
  font-size: 1.05rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #ffffff;
}

.day-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-yellow);
}

.day-dot-empty {
  width: 5px;
  height: 5px;
  opacity: 0;
}

.day-card.is-today {
  border-color: var(--accent-red);
}

.day-card.active {
  background: var(--accent-red);
  border-color: #ff3333;
  color: #ffffff;
  box-shadow: 0 2px 12px var(--accent-red-glow);
}

.day-card.active .day-number,
.day-card.active .day-name {
  color: #ffffff;
}

.day-card.active .day-dot {
  background: #ffffff;
}

.table-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.table-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ========================================================
   TIME (STOPWATCH) VIEW
   ======================================================== */
.sw-display-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 16px;
  background: linear-gradient(180deg, #1e1e1e 0%, #161616 100%);
  border: 1px solid var(--border-subtle);
}

.sw-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.sw-split-badge {
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-feature-settings: "tnum";
  font-feature-settings: "tnum";
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface-elevated);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.split-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-right: 4px;
}

.sw-time-display {
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-feature-settings: "tnum";
  font-feature-settings: "tnum";
  font-size: 3.5rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 12px 0 24px;
  text-shadow: 0 0 16px rgba(255, 0, 0, 0.15);
}

@media (max-width: 480px) {
  .sw-time-display {
    font-size: 2.7rem;
  }
}

.time-part-ms {
  font-size: 0.78em;
  font-weight: 500;
  color: var(--accent-red);
}

.sw-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.btn-sw {
  flex: 1;
  padding: 13px 20px;
  font-size: 1rem;
  font-weight: 600;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.15s ease;
}

.metric-card-btn {
  cursor: pointer;
  user-select: none;
}

.metric-card-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent-red);
  transform: translateY(-1px);
}

.metric-card-btn:active {
  transform: scale(0.98);
}

.metric-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-red);
}

.metric-info {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 500;
}

.metric-value {
  font-size: 1.15rem;
  font-weight: 600;
  color: #ffffff;
}

.lap-section {
  padding: 16px;
}

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

.lap-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lap-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.lap-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  transition: all 0.15s;
}

.lap-item:hover {
  background: var(--bg-surface-hover);
}

.lap-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lap-num {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent-red);
}

.lap-time-sub {
  font-size: 0.8rem;
}

.lap-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lap-time {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
}

/* ========================================================
   CALCU VIEW
   ======================================================== */
.calcu-container {
  padding: 18px;
}

.form-actions {
  margin-top: 18px;
}

.result-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
}

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

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.result-item {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result-item.highlight-incentive {
  background: rgba(17, 122, 101, 0.12);
  border-color: rgba(17, 122, 101, 0.4);
}

.result-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.result-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.incentive-table-wrapper {
  margin-top: 14px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
}

.incentive-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-height: 280px;
  overflow-y: auto;
}

.incentive-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.incentive-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  background: var(--bg-surface-elevated);
}

/* ========================================================
   LINK VIEW
   ======================================================== */
.link-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.links-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}

.link-card:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent-red);
  transform: translateY(-1px);
}

.link-favicon-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.link-favicon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.link-fallback-icon {
  color: var(--accent-red);
  display: flex;
  align-items: center;
  justify-content: center;
}

.link-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.link-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-domain {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-action {
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.link-card:hover .link-action {
  color: var(--accent-red);
}

/* ========================================================
   SETTING VIEW
   ======================================================== */
.setting-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setting-section-header {
  margin-bottom: 14px;
}

.cloud-sync-info {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sync-info-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}

.sync-icon {
  color: var(--color-green);
  display: flex;
}

.sync-file-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
  padding-top: 6px;
}

.upload-dropzone {
  border: 2px dashed var(--border-muted);
  border-radius: var(--radius-lg);
  padding: 30px 16px;
  text-align: center;
  background: rgba(30, 30, 30, 0.6);
  cursor: pointer;
  transition: all 0.2s;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--accent-red);
  background: rgba(255, 0, 0, 0.05);
}

.file-input-hidden {
  display: none;
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.dropzone-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--accent-red);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.link-form {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
}

.form-actions-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.setting-links-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  gap: 10px;
}

.setting-link-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.setting-link-info strong {
  font-size: 0.88rem;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.setting-link-info span {
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.setting-link-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.danger-zone {
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}
