/* ===== Disk Speed Test — Styles ===== */
:root {
  --bg: #0a0a10;
  --surface: #12121c;
  --surface2: #1a1a28;
  --border: rgba(255,255,255,0.06);
  --text: #e0e0e4;
  --text2: #909098;
  --accent: #6b6bff;
  --accent2: #4ecdc4;
  --accent3: #ff6b6b;
  --green: #4ecdc4;
  --orange: #ffa94d;
  --red: #ff6b6b;
  --blue: #6b6bff;
  --purple: #a78bfa;
  --gradient: linear-gradient(135deg, #667eea, #764ba2);
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.4);
  --glow: 0 0 40px rgba(102,126,234,0.25);
  --glow-lg: 0 0 60px rgba(102,126,234,0.4);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== Header ===== */
.header {
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header .container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-icon {
  display: flex;
  align-items: center;
}

.brand-logo {
  height: 40px;
  width: 40px;
  border-radius: 10px;
  vertical-align: middle;
}

.brand-text {
  font-size: 1rem;
  font-weight: 600;
  color: #ddd;
}

/* ===== Language Picker ===== */
.header-right { display: flex; align-items: center; gap: 12px; }

.lang-picker {
  position: relative;
  display: inline-block;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: none;
  box-shadow: var(--shadow);
  border-radius: 8px;
  color: #ddd;
  padding: 6px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}

.lang-btn:hover {
  background: #22223a;
  box-shadow: var(--shadow-lg);
}

.lang-arrow {
  font-size: 0.7rem;
  opacity: 0.6;
  transition: transform 0.2s;
}

.lang-picker.open .lang-arrow {
  transform: rotate(180deg);
}

.lang-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 180px;
  background: #1e1e36;
  border: none;
  box-shadow: var(--shadow-lg);
  border-radius: 10px;
  padding: 6px;
  z-index: 1000;
  list-style: none;
}

.lang-picker.open .lang-menu { display: block; }

.lang-menu li { margin: 0; }

.lang-menu li button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: #bbb;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
  text-align: left;
  font-family: inherit;
}

.lang-menu li button:hover {
  background: rgba(102,126,234,0.15);
  color: #fff;
}

.lang-menu li button.active {
  background: rgba(102,126,234,0.12);
  color: var(--purple);
  font-weight: 600;
}

.lang-menu li button.active::after {
  content: ' ✓';
  margin-left: auto;
  opacity: 0.7;
}

/* ===== Hero ===== */
.hero {
  padding: 40px 0 30px;
  text-align: center;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text2);
  max-width: 550px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ===== Container ===== */
.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 20px;
}

.main .container {
  padding-bottom: 60px;
}

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border: none;
  box-shadow: var(--shadow);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 20px;
  transition: box-shadow 0.3s;
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card h2 i {
  color: var(--accent);
  font-size: 1rem;
}

.card p, .card li {
  font-size: 0.95rem;
  color: var(--text2);
  line-height: 1.7;
}

/* ===== Test Card ===== */
/* Test Card */
.test-card .card-header { margin-bottom: 20px; }

.fsa-warning {
  background: rgba(255, 169, 77, 0.08);
  border: none;
  box-shadow: inset 0 0 0 1px rgba(255, 169, 77, 0.15);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
}

.fsa-warning p {
  font-size: 0.9rem;
  color: var(--orange);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.fsa-warning i {
  color: var(--orange);
  margin-top: 2px;
  flex-shrink: 0;
}

.fsa-mobile {
  display: block;
  font-size: 0.82rem;
  color: rgba(255,169,77,0.6);
  margin-top: 4px;
}

/* Drop Zone — nhỏ gọn */
.drop-zone {
  border: 2px dashed rgba(107,107,255,0.2);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(107,107,255,0.03);
}

.drop-zone:hover {
  border-color: rgba(107,107,255,0.4);
  background: rgba(107,107,255,0.06);
  box-shadow: 0 0 20px rgba(107,107,255,0.06);
}

.drop-zone.selected {
  border-style: solid;
  border-color: var(--accent2);
  background: rgba(78,205,196,0.05);
}

.drop-zone-icon {
  font-size: 1.5rem;
  color: var(--accent);
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.3s;
}

.drop-zone:hover .drop-zone-icon {
  opacity: 1;
}

.drop-zone-text {
  flex: 1;
  min-width: 0;
}

.drop-zone-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #ddd;
  margin-bottom: 2px;
}

.drop-zone-sub {
  font-size: 0.8rem;
  color: var(--text2);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drop-zone-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 7px 18px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  flex-shrink: 0;
}

.drop-zone-btn:hover {
  background: #5555ee;
  box-shadow: 0 0 14px rgba(107,107,255,0.3);
}

/* ===== Test Center ===== */
.test-center {
  text-align: center;
  margin-bottom: 20px;
}

.test-desc {
  font-size: 0.9rem;
  color: var(--text2);
  margin-bottom: 24px;
  min-height: 1.2em;
}

/* Big Circular Start Button */
.start-btn {
  background: none;
  border: none;
  cursor: pointer;
  margin: 0 auto;
  display: inline-block;
  position: relative;
}

.start-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-circle {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--glow);
  margin: 0 auto;
  position: relative;
  overflow: visible;
}

.btn-circle::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent 50%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.btn-circle:hover {
  transform: scale(1.08);
  box-shadow: 0 0 60px rgba(102,126,234,0.45), 0 0 100px rgba(102,126,234,0.15);
}

.btn-circle:active {
  transform: scale(0.93);
}

/* Ripple rings */
.ripple-ring {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 2px solid rgba(102,126,234,0.15);
  top: 0;
  left: 0;
  pointer-events: none;
}

.ring-2 {
  width: 230px;
  height: 230px;
  top: -15px;
  left: -15px;
  border-color: rgba(102,126,234,0.08);
}

/* Testing animation */
.btn-circle.testing {
  animation: pulse-glow 2.4s ease-in-out infinite, btn-blink 1.0s ease-in-out infinite;
}

.testing-status { /* status text blink handled by .status-blinking */ }

@keyframes btn-blink {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.25); }
}

.status-blinking {
  animation: text-blink 1.2s ease-in-out infinite;
}

@keyframes text-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.btn-circle.testing .ripple-ring {
  animation: ripple-expand 2.4s ease-out infinite;
}

.btn-circle.testing .ring-2 {
  animation: ripple-expand 2.4s ease-out 0.6s infinite;
}

.stop-circle.testing {
  animation: pulse-red 2.4s ease-in-out infinite, btn-blink 1.0s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 40px rgba(102,126,234,0.3), 0 0 80px rgba(102,126,234,0.1);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 70px rgba(102,126,234,0.5), 0 0 140px rgba(102,126,234,0.2);
    transform: scale(1.06);
  }
}

@keyframes ripple-expand {
  0% {
    opacity: 0.6;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.3);
  }
}

@keyframes pulse-red {
  0%, 100% {
    box-shadow: 0 0 40px rgba(255,107,107,0.25), 0 0 80px rgba(255,107,107,0.1);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 60px rgba(255,107,107,0.4), 0 0 120px rgba(255,107,107,0.15);
    transform: scale(1.06);
  }
}

.btn-text {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 2;
}

.btn-text i {
  font-size: 1.8rem;
  color: #fff;
}

/* Stop button circle */
.btn-stop-circle {
  background: none;
  border: none;
  cursor: pointer;
  margin: 0 auto;
  display: inline-block;
  position: relative;
}

.stop-circle {
  background: linear-gradient(135deg, #ff6b6b, #cc4444, #e05555);
  box-shadow: 0 0 40px rgba(255,107,107,0.25), 0 0 80px rgba(255,107,107,0.1);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stop-circle:hover {
  transform: scale(1.08);
  box-shadow: 0 0 60px rgba(255,107,107,0.4), 0 0 100px rgba(255,107,107,0.15);
}

.stop-circle:active {
  transform: scale(0.93);
}

/* ===== Results Table ===== */
.results-wrapper { margin-top: 10px; }

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

.results-header h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.results-header h3 i {
  color: var(--accent);
  font-size: 1rem;
}

.result-cdminfo {
  font-size: 0.8rem;
  color: var(--text2);
  background: var(--surface2);
  padding: 4px 12px;
  border-radius: 6px;
}

.cdm-table {
  border: none;
  box-shadow: var(--shadow);
  border-radius: 10px;
  overflow: hidden;
}

.cdm-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.cdm-row:last-child { border-bottom: none; }

.cdm-header {
  background: var(--surface2);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text2);
}

.cdm-header i {
  margin-right: 4px;
  color: var(--accent);
  font-size: 0.7rem;
}

.cdm-cell {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.cdm-cell + .cdm-cell {
  border-left: 1px solid rgba(255,255,255,0.04);
}

.cdm-testname {
  font-family: 'SF Mono', 'Menlo', 'Courier New', monospace;
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 500;
}

.result-val {
  font-family: 'SF Mono', 'Menlo', 'Courier New', monospace;
  font-size: 1.15rem;
  font-weight: 700;
  transition: all 0.3s ease;
}

.result-val.just-updated {
  animation: result-pop 0.5s ease-out;
}

@keyframes result-pop {
  0% {
    transform: scale(1.3);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.result-unit {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.25);
}

/* Result colors — tinted to match accent theme */
.result-fast {
  color: #4ecdc4;
  text-shadow: 0 0 12px rgba(78,205,196,0.3);
}
.result-good {
  color: #6b6bff;
  text-shadow: 0 0 12px rgba(107,107,255,0.3);
}
.result-ok {
  color: #ffa94d;
  text-shadow: 0 0 10px rgba(255,169,77,0.2);
}
.result-slow {
  color: #ff6b6b;
  text-shadow: 0 0 10px rgba(255,107,107,0.2);
}

.cdm-row-iops {
  background: rgba(102,126,234,0.05);
}

.cdm-row-iops i {
  color: var(--accent2);
}

/* ===== FAQ ===== */
.faq-list { display: flex; flex-direction: column; gap: 4px; }

.faq-item {
  border: none;
  box-shadow: var(--shadow);
  border-radius: 10px;
  padding: 14px 18px;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(255,255,255,0.01);
}

.faq-item:hover { 
  box-shadow: var(--shadow-lg);
  background: rgba(255,255,255,0.02);
}

.faq-item summary {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
  cursor: pointer;
}

.faq-item p {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--text2);
  line-height: 1.7;
}

/* ===== Tips ===== */
.tips-list {
  list-style: none;
  padding: 0;
}

.tips-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 6px;
  font-size: 0.92rem;
  color: var(--text2);
}

.tips-list li::before {
  content: '▶';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.7rem;
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 30px 20px;
  text-align: center;
}

.footer-inner {
  max-width: 600px;
  margin: 0 auto;
}

.footer p {
  font-size: 0.85rem;
  color: var(--text2);
  margin-bottom: 8px;
}

.footer-stats {
  font-size: 0.85rem;
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.stat-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stat-item i {
  font-size: 0.85rem;
  color: var(--accent);
  opacity: 0.7;
}

.stat-divider { margin: 0 8px; opacity: 0.3; }

.footer-privacy { margin-top: 10px; }
.footer-privacy a {
  color: rgba(255,255,255,0.3);
  text-decoration: none;
  font-size: 0.75rem;
  transition: color 0.2s;
}
.footer-privacy a:hover {
  color: rgba(255,255,255,0.7);
  text-decoration: underline;
}

/* ===== Privacy Page ===== */
.privacy-page {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.7;
  padding: 40px 20px;
}

.privacy-container {
  max-width: 720px;
  margin: 0 auto;
  background: var(--surface);
  border: none;
  box-shadow: var(--shadow-lg);
  border-radius: 16px;
  padding: 40px;
}

.privacy-back {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 24px;
}
.privacy-back:hover { color: #8b8bff; }

.privacy-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: #fff;
}

.privacy-date {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.3);
  margin-bottom: 24px;
}

.privacy-intro {
  font-size: 1rem;
  color: var(--text2);
  margin-bottom: 32px;
}

.privacy-section { margin-bottom: 28px; }
.privacy-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 10px;
}

.privacy-section ul { margin: 0; padding: 0 0 0 20px; list-style: none; }
.privacy-section ul li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 6px;
  color: var(--text2);
  font-size: 0.95rem;
}
.privacy-section ul li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .hero-title { font-size: 1.6rem; }
  .card { padding: 20px; }
  .cdm-row { grid-template-columns: 1fr 1fr 1fr; }
  .cdm-cell { padding: 10px 12px; }
  .privacy-container { padding: 20px; }
  .btn-circle { width: 90px; height: 90px; }
}
