/* =========================================
   CSS Variables - Light/Dark Mode Support
   ========================================= */
:root {
  /* Light mode colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --text-primary: #333333;
  --text-secondary: #666666;
  --border-color: #e0e0e0;
  --accent-color: #6d4aff;
  --accent-hover: #5a3fd9;
  --success-color: #2e7d32;
  --warning-color: #ed6c02;
  --error-color: #d32f2f;
  --drop-zone-bg: #fafafa;
  --drop-zone-border: #cccccc;
  --progress-bg: #e0e0e0;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  /* Dark mode colors */
  --bg-primary: #121212;
  --bg-secondary: #1e1e1e;
  --text-primary: #ffffff;
  --text-secondary: #b0b0b0;
  --border-color: #333333;
  --accent-color: #6d4aff;
  --accent-hover: #8a5fff;
  --success-color: #4caf50;
  --warning-color: #ff9800;
  --error-color: #ef5350;
  --drop-zone-bg: #1a1a1a;
  --drop-zone-border: #444444;
  --progress-bg: #333333;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* =========================================
   Base Styles
   ========================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

/* =========================================
   Layout Components
   ========================================= */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

header {
  text-align: center;
  margin-bottom: 40px;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 12px;
  font-weight: 600;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

footer {
  text-align: center;
  padding: 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 40px;
}

/* =========================================
   Theme Toggle Button
   ========================================= */
.theme-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all 0.2s ease;
  z-index: 1000;
}

.theme-btn:hover {
  background: var(--border-color);
}

/* =========================================
   Drop Zone
   ========================================= */
.drop-zone {
  border: 2px dashed var(--drop-zone-border);
  background: var(--drop-zone-bg);
  border-radius: 12px;
  padding: 60px 40px;
  text-align: center;
  transition: all 0.3s ease;
  margin-bottom: 30px;
}

.drop-zone.drag-over {
  border-color: var(--accent-color);
  background: rgba(109, 74, 255, 0.05);
  transform: scale(1.02);
}

.drop-icon {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.drop-text {
  font-size: 1.3rem;
  margin-bottom: 10px;
  font-weight: 500;
}

.drop-subtext {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.drop-size {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.error-message {
  margin-top: 15px;
  color: var(--error-color);
  font-size: 0.9rem;
  padding: 10px;
  background: rgba(211, 47, 47, 0.1);
  border-radius: 6px;
}

.error-message.hidden {
  display: none;
}

/* =========================================
   Results Section
   ========================================= */
.results-section {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}

.results-section h2 {
  margin-bottom: 20px;
  font-size: 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  padding: 12px 15px;
  border-bottom: 2px solid var(--border-color);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

tbody td {
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

.file-name {
  font-weight: 500;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.hash-value {
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
  color: var(--accent-color);
  word-break: break-all;
  max-width: 400px;
}

.download-btn {
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s ease;
}

.download-btn:hover {
  background: var(--accent-hover);
}

/* =========================================
   Comparison Warning
   ========================================= */
.comparison-warning {
  margin-top: 20px;
  padding: 15px;
  background: rgba(237, 108, 2, 0.1);
  border-left: 4px solid var(--warning-color);
  border-radius: 6px;
  color: var(--warning-color);
  font-weight: 500;
}

.comparison-warning.hidden {
  display: none;
}

/* =========================================
   Progress Indicator
   ========================================= */
.progress-container {
  margin-bottom: 30px;
}

.progress-bar {
  height: 8px;
  background: var(--progress-bg);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-fill {
  height: 100%;
  background: var(--accent-color);
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-align: center;
}

/* =========================================
   Timer Section
   ========================================= */
.timer-section {
  text-align: center;
  margin-bottom: 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.timer-section span {
  color: var(--warning-color);
  font-weight: 600;
}

.timer-section.hidden {
  display: none;
}

/* =========================================
   Clear Button
   ========================================= */
.clear-button {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  padding: 14px 20px;
  background: transparent;
  border: 2px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.clear-button:not(.hidden) {
  border-color: var(--error-color);
  color: var(--error-color);
}

.clear-button:not(.hidden):hover {
  background: rgba(211, 47, 47, 0.1);
}

.clear-button.hidden {
  opacity: 0;
  pointer-events: none;
}

/* =========================================
   Utility Classes
   ========================================= */
.hidden {
  display: none !important;
}

/* =========================================
   Responsive Design
   ========================================= */
@media (max-width: 768px) {
  h1 {
    font-size: 1.8rem;
  }

  .container {
    padding: 20px 15px;
  }

  .drop-zone {
    padding: 40px 20px;
  }

  .results-section {
    padding: 20px;
    overflow-x: auto;
  }

  .theme-btn {
    top: 10px;
    right: 10px;
    padding: 8px 14px;
  }

  .hash-value {
    font-size: 0.75rem;
    max-width: 150px;
  }
}
/* =========================================
   Subtitle Note (Hash Comparison Explanation)
   ========================================= */
.subtitle-note {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 8px;
  font-style: italic;
}
