/* TAO SUBNETS PREMIUM v2.2 */

:root {
  --bg: #f8fafc; --card: #fff; --text: #1e293b; --text-muted: #64748b; --border: #e2e8f0;
  --accent: #3b82f6; --accent-hover: #2563eb; --orange: #f97316; --danger: #ef4444; --success: #10b981;
  --shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); --radius: 16px; --radius-lg: 24px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  transition: var(--transition);
}

body.theme-light {
  background: linear-gradient(135deg, var(--bg) 0%, #e0e7ff 100%);
  color: var(--text);
}

body.theme-dark {
  --bg: #0f172a; --card: #1e293b; --text: #f1f5f9; --text-muted: #94a3b8; --border: #334155;
  background: linear-gradient(135deg, var(--bg) 0%, #1e3a5f 100%);
  color: var(--text);
}

.entry-content, .wp-block-post-content {
  max-width: 100% !important; width: 100% !important; margin: 0 !important;
  padding: 0 0; box-sizing: border-box;
}

/* Header */
.tao-header {
  background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); border-radius: var(--radius-lg);
  padding: 40px 180px; margin: 30px auto 40px; max-width: 1400px; box-shadow: var(--shadow);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 30px;
  transition: var(--transition);
}
body.theme-dark .tao-header { background: rgba(30, 41, 59, 0.95); }

.tao-logo {
  font-size: 32px; font-weight: 900;
  background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  display: flex; align-items: center; margin-right: auto; margin-left: -30px;
  text-decoration: none; transition: var(--transition);
}
.tao-logo:hover { opacity: 0.8; transform: translateX(5px); }
.tao-logo img { width: 70px; height: 70px; margin-right: 15px; flex-shrink: 0; }

/* Lien Actualités */
.tao-news-link {
  font-size: 32px; font-weight: 600; color: var(--text);
  text-decoration: none; display: flex; align-items: center; gap: 8px;
  transition: var(--transition); margin-left: auto; padding: 10px 20px;
  border-radius: 12px;
}
.tao-news-link:hover {
  color: var(--accent); background: rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
}

.tao-controls {
  display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
  margin-left: auto; margin-right: -30px;
}

.theme-switcher {
  display: flex; background: rgba(0, 0, 0, 0.05); border-radius: var(--radius);
  padding: 4px; transition: var(--transition);
}
body.theme-dark .theme-switcher { background: rgba(255, 255, 255, 0.05); }

.theme-btn {
  padding: 10px 20px; border: none; background: transparent; color: var(--text-muted);
  border-radius: 12px; cursor: pointer; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 8px; transition: var(--transition);
}
.theme-btn.active {
  background: var(--accent); color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.lang-switcher { display: flex; gap: 12px; }
.lang-switcher a {
  padding: 10px 24px; border: 2px solid transparent; background: white; color: var(--text);
  border-radius: 12px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px;
  transition: var(--transition); text-decoration: none; box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
body.theme-dark .lang-switcher a { background: var(--card); color: var(--text); }
.lang-switcher a:hover {
  transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.15);
  border-color: var(--accent);
}
.lang-switcher a.active {
  background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
  color: white; border-color: transparent; box-shadow: 0 8px 20px rgba(59,130,246,.4);
}

/* Hero */
.tao-hero { text-align: center; margin-bottom: 30px; padding: 0 20px; }
.tao-title {
  font-size: clamp(36px, 5vw, 56px); font-weight: 900; margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  line-height: 1.2;
}
body.theme-dark .tao-title {
  background: linear-gradient(135deg, var(--text) 0%, #8b5cf6 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.tao-subtitle {
  font-size: clamp(16px, 2vw, 20px); color: var(--text-muted);
  max-width: 800px; margin: 0 auto; line-height: 1.6;
}

/* Section info pleine largeur */
.tao-info-section {
  width: 100vw !important; max-width: none !important;
  margin-left: calc(50% - 50vw) !important; margin-right: calc(50% - 50vw) !important;
  padding: 20px 0; margin-bottom: 40px; background: rgba(59, 130, 246, 0.05);
  border-top: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
}
body.theme-dark .tao-info-section {
  background: rgba(59, 130, 246, 0.1);
}
.tao-info-section p {
  margin: 0 0 20px 0; font-size: 16px; line-height: 1.8;
  color: var(--text); text-align: left; padding: 0 40px;
}
.tao-info-section p:last-child { margin-bottom: 0; }

/* Search */
.tao-search-container {
  margin-bottom: 20px; animation: slideDown 0.4s ease-out;
  width: 100vw !important; margin-left: calc(50% - 50vw) !important; margin-right: calc(50% - 50vw) !important;
  padding: 0 30px !important; min-height: 60px; box-sizing: border-box !important;
}
.tao-search-wrapper { position: relative; max-width: 400px; display: inline-block; }
.tao-search-input {
  width: 100%; padding: 14px 45px 14px 50px; font-size: 14px; font-weight: 500;
  border: 2px solid var(--border); border-radius: var(--radius); background: white;
  color: var(--text); transition: var(--transition); outline: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
body.theme-dark .tao-search-input { background: var(--card); color: var(--text); }
.tao-search-input:focus {
  border-color: var(--accent); transform: translateY(-1px);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1), 0 4px 12px rgba(0, 0, 0, 0.08);
}
body.theme-dark .tao-search-input:focus {
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2), 0 4px 12px rgba(0, 0, 0, 0.3);
}
.tao-search-input::placeholder { color: var(--text-muted); opacity: 0.7; }
.tao-search-icon {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; color: var(--text-muted); pointer-events: none;
  transition: color 0.3s ease;
}
.tao-search-input:focus ~ .tao-search-icon { color: var(--accent); }
.tao-search-clear {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border: none; background: rgba(0, 0, 0, 0.05);
  border-radius: 50%; color: var(--text-muted); cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s ease;
  opacity: 0; animation: fadeIn 0.2s ease-out forwards;
}
body.theme-dark .tao-search-clear { background: rgba(255, 255, 255, 0.1); }
.tao-search-clear:hover {
  background: var(--danger); color: white; transform: translateY(-50%) scale(1.1);
}
.tao-search-results-count {
  font-size: 14px; color: var(--text-muted); margin-left: 35px; opacity: 0;
  animation: fadeIn 0.3s ease-out forwards; display: none !important;
}
.tao-search-results-count .count {
  font-weight: 700; color: var(--accent); margin-right: 4px;
}
.tao-search-wrapper::after {
  content: 'Ctrl+K'; position: absolute; right: 50px; top: 50%; transform: translateY(-50%);
  font-size: 11px; padding: 3px 6px; background: rgba(0, 0, 0, 0.05); border-radius: 4px;
  color: var(--text-muted); font-weight: 600; pointer-events: none; opacity: 0;
  transition: opacity 0.3s ease;
}
body.theme-dark .tao-search-wrapper::after { background: rgba(255, 255, 255, 0.1); }
.tao-search-wrapper:hover::after { opacity: 1; }

/* Table */
.table-wrapper {
  width: calc(100vw - 40px) !important; max-width: calc(100vw - 40px) !important;
  margin: 0 auto 60px !important; padding: 0 !important; background: white;
  border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow-x: auto; overflow-y: visible;
  -webkit-overflow-scrolling: touch; transition: var(--transition);
}
body.theme-dark .table-wrapper { background: var(--card); }

table[name="subnetList"] {
  width: 100% !important; min-width: 100% !important; border-collapse: separate;
  border-spacing: 0; font-size: 13px; table-layout: fixed !important;
}

table[name="subnetList"] thead th {
  background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
  padding: 20px 16px; text-align: center; font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.5px; color: var(--text); position: sticky;
  top: 0; z-index: 10; cursor: pointer; user-select: none; transition: var(--transition);
  white-space: nowrap;
}
body.theme-dark table[name="subnetList"] thead th {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}
table[name="subnetList"] thead th:first-child { border-top-left-radius: var(--radius); }
table[name="subnetList"] thead th:last-child { border-top-right-radius: var(--radius); }
table[name="subnetList"] thead th:hover { background: var(--accent); color: white; }
table[name="subnetList"] thead th.sortable::after { content: "↕"; margin-left: 8px; opacity: 0.5; font-size: 12px; }
table[name="subnetList"] thead th.asc::after { content: "↑"; opacity: 1; }
table[name="subnetList"] thead th.desc::after { content: "↓"; opacity: 1; }
body.admin-bar table[name="subnetList"] thead th { top: 32px; }

table[name="subnetList"] tbody tr {
  border-bottom: 1px solid var(--border); transition: var(--transition); cursor: pointer;
}
table[name="subnetList"] tbody tr:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
}
body.theme-dark table[name="subnetList"] tbody tr:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
}

table[name="subnetList"] tbody td {
  padding: 12px 10px !important; font-size: 13px !important; line-height: 1.45 !important;
  white-space: normal !important; overflow-wrap: anywhere !important; word-break: break-word !important;
  text-align: center !important; vertical-align: middle !important;
}
table[name="subnetList"] td span { display: block; text-align: center !important; }

table[name="subnetList"] :is(th,td):nth-child(1) { width: 3% !important; }
table[name="subnetList"] :is(th,td):nth-child(2) { width: 11% !important; }
table[name="subnetList"] :is(th,td):nth-child(3) { width: 19% !important; }
table[name="subnetList"] :is(th,td):nth-child(4) { width: 10% !important; }
table[name="subnetList"] :is(th,td):nth-child(5) { width: 19% !important; }
table[name="subnetList"] :is(th,td):nth-child(6) { width: 19% !important; }
table[name="subnetList"] :is(th,td):nth-child(7) { width: 19% !important; }

table[name="subnetList"] :is(td,th):first-child { font-weight: 700; color: var(--accent); }
table[name="subnetList"] td.shortName { font-weight: 700; color: var(--orange); }
table[name="subnetList"] td[class*="annualRevenue"] {
  color: var(--danger); font-weight: 600; font-variant-numeric: tabular-nums;
}

table[name="subnetList"] tbody tr.search-highlight {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%) !important;
}
body.theme-dark table[name="subnetList"] tbody tr.search-highlight {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%) !important;
}
table[name="subnetList"] tbody tr.single-result {
  animation: pulseHighlight 1s ease-out 2; box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulseHighlight {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
  }
}
/* Responsive */
@media (max-width: 768px) {
  .tao-header { padding: 20px; flex-direction: column; text-align: center; }
  .tao-logo { margin: 0 auto; }
  .tao-news-link { margin: 10px auto; order: 2; }
  .tao-controls { width: 100%; justify-content: center; order: 3; }
  .table-wrapper { border-radius: var(--radius); }
  table[name="subnetList"] { font-size: 11.5px; min-width: 640px !important; }
  table[name="subnetList"] :is(th,td) { padding: 8px 10px !important; }
  .tao-search-wrapper { max-width: 100%; }
  .tao-search-input { padding: 12px 40px 12px 45px; }
  .tao-search-icon { width: 18px; height: 18px; left: 15px; }
  .tao-search-clear { width: 24px; height: 24px; right: 10px; font-size: 14px; }
}

.tao-premium-header { display: none !important; }