/* Unix Time Tool Specific Styles */

.input-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

.input-field:focus {
  outline: none;
  border-color: #0bb1ee;
  box-shadow: 0 0 0 2px rgba(11, 177, 238, 0.2);
}

.input-field::placeholder {
  color: black;
}

.timezone-toggle {
  display: flex;
  align-items: center;
}

.timezone-toggle-button:hover {
  background: rgba(34, 63, 73, 0.8);
  border-color: #0bb1ee;
  transform: translateY(-1px);
}

.timezone-toggle-button:active {
  transform: translateY(0);
}

.timezone-switch-icon {
  font-size: 1rem;
  color: #0bb1ee;
  transition: transform 0.2s ease;
}

.timezone-toggle-button:hover .timezone-switch-icon {
  transform: rotate(180deg);
}

.format-outputs-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.format-output-row:hover {
  background: rgba(16, 30, 35, 0.8);
  border-color: rgba(144, 187, 203, 0.5);
}

.copy-button:hover {
  background: #0bb1ee;
  color: #101e23;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(11, 177, 238, 0.3);
}

.copy-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(11, 177, 238, 0.3);
}

.copy-button.copied {
  background: #4ade80;
  border-color: #4ade80;
  color: #101e23;
}

.time-units-table th {
  background: #101e23;
  color: white;
  font-weight: 600;
}

.time-units-table td {
  color: #90bbcb;
  font-family: 'Courier New', monospace;
}

.time-units-table tr:hover {
  background: rgba(11, 177, 238, 0.1);
}

.format-hint {
  color: #90bbcb;
  font-size: 0.75rem;
  margin-top: 0.25rem;
  font-style: italic;
}

.error-message {
  color: #ff6b6b;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: rgba(255, 107, 107, 0.1);
  border-radius: 6px;
  border-left: 3px solid #ff6b6b;
}

/* Touch-friendly styling */
.input-field,
.copy-button {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Loading state for copy buttons */
.copy-button.loading {
  background: #90bbcb;
  border-color: #90bbcb;
  color: #101e23;
  cursor: not-allowed;
}

/* Focus visible for accessibility */
.input-field:focus-visible,
.copy-button:focus-visible {
  outline: 2px solid #0bb1ee;
  outline-offset: 2px;
}

/* Improved table responsiveness */
.time-units-table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
}

.time-units-table {
  min-width: 100%;
  white-space: nowrap;
}

/* Responsive Design - Mobile First Approach */
/* Base styles for mobile devices (up to 767px) */
.unix-time-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

.section-card {
  background: #223f49;
  border: 1px solid rgba(144, 187, 203, 0.2);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.date-inputs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.current-timestamp {
  text-align: center;
  padding: 1.25rem;
  background: #223f49;
  border: 1px solid rgba(144, 187, 203, 0.2);
  border-radius: 12px;
  margin-bottom: 2rem;
}

.current-timestamp-value {
  color: #0bb1ee;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-family: 'Courier New', monospace;
  word-break: break-all;
}

.current-timestamp-date {
  color: white;
  font-size: 0.9rem;
  line-height: 1.4;
}

.current-timestamp-timezone {
  color: #90bbcb;
  font-size: 0.8rem;
  margin-top: 0.5rem;
  font-weight: 500;
}

.timezone-toggle-button {
  background: #223f49;
  border: 1px solid rgba(144, 187, 203, 0.3);
  border-radius: 8px;
  color: white;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  min-width: 90px;
  min-height: 44px;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.format-output-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  align-items: stretch;
  padding: 1rem;
  background: #101e23;
  border: 1px solid rgba(144, 187, 203, 0.3);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.format-label {
  color: #90bbcb;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.format-value {
  color: white;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  word-break: break-all;
  overflow-wrap: break-word;
  margin-bottom: 0.75rem;
}

.conversion-result {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}

.copy-button {
  background: transparent;
  border: 1px solid #0bb1ee;
  border-radius: 8px;
  color: #0bb1ee;
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 0;
  margin-top: 0;
  width: 100%;
  min-height: 44px;
  text-align: center;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

.output-display {
  background: #101e23;
  border: 1px solid rgba(144, 187, 203, 0.3);
  border-radius: 8px;
  padding: 1.25rem;
  margin-top: 0.5rem;
}

.output-label {
  color: #90bbcb;
  font-size: 0.875rem;
  opacity: 0.8;
  margin-bottom: 0.5rem;
}

.output-value {
  color: white;
  font-size: 1.125rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  word-break: break-word;
}

.input-field {
  background: #101e23;
  border: 1px solid rgba(144, 187, 203, 0.3);
  border-radius: 8px;
  color: black;
  padding: 1rem;
  font-size: 16px; /* Prevents zoom on iOS */
  transition: all 0.2s ease;
  min-height: 52px;
  -webkit-appearance: none;
  -moz-appearance: textfield;
  -webkit-tap-highlight-color: transparent;
}

.input-label {
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.section-title {
  color: white;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(144, 187, 203, 0.3);
  padding-bottom: 0.5rem;
}

.time-units-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.875rem;
}

.time-units-table th,
.time-units-table td {
  padding: 0.75rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid rgba(144, 187, 203, 0.2);
}

/* Tablet styles (768px and up) */
@media screen and (min-width: 768px) {
  .section-card {
    padding: 1.5rem;
  }
  
  .date-inputs-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
  
  .current-timestamp {
    padding: 1.5rem;
  }
  
  .current-timestamp-value {
    font-size: 1.75rem;
  }
  
  .current-timestamp-date {
    font-size: 1rem;
  }
  
  .current-timestamp-timezone {
    font-size: 0.875rem;
  }
  
  .timezone-toggle-button {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    min-width: 120px;
  }
  
  .format-label {
    font-size: 1rem;
  }
  
  .format-value {
    font-size: 1rem;
  }
  
  .copy-button {
    padding: 1rem 1.25rem;
    font-size: 1rem;
    min-height: 48px;
  }
  
  .output-label {
    font-size: 1rem;
  }
  
  .output-value {
    font-size: 1.25rem;
  }
  
  .input-label {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }
  
  .section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  .time-units-table {
    font-size: 1rem;
  }
  
  .time-units-table th,
  .time-units-table td {
    padding: 1rem 0.75rem;
  }
}

/* Desktop styles (1024px and up) */
@media screen and (min-width: 1024px) {
  .format-output-row {
    grid-template-columns: 200px 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1.25rem;
  }
  
  .format-label {
    margin-bottom: 0;
    white-space: nowrap;
  }
  
  .format-value {
    margin-bottom: 0;
  }
  
  .conversion-result {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }
  
  .copy-button {
    margin-left: 0.75rem;
    margin-top: 0;
    width: auto;
    min-width: 80px;
  }
  
  .date-inputs-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  }
  
  .current-timestamp-value {
    font-size: 2rem;
  }
}
