/* =========================================================
   WhoisPros shared theme
   Refactored from the existing Home + Search styles.
   Keep this file compatible with existing WHOIS result HTML.
   ========================================================= */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-secondary: #f8f9fa;
  --input-bg: #f1f3f4;
  --text: #222222;
  --text-muted: #888888;
  --border: #dfe1e5;
  --border-secondary: #eeeeee;
  --primary: #4285f4;
  --primary-hover: #3367d6;
  --success: #34a853;
  --error: #d93025;
  --shadow: #0001;
  --shadow-strong: #0003;
}

html.dark {
  --bg: #181818;
  --surface: #232323;
  --surface-secondary: #232323;
  --input-bg: #232323;
  --text: #eeeeee;
  --text-muted: #aaaaaa;
  --border: #444444;
  --border-secondary: #444444;
  --primary: #8ab4f8;
  --primary-hover: #669df6;
  --success: #7be495;
  --error: #d93025;
  --shadow: #0003;
  --shadow-strong: #0005;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

html {
  background: var(--bg);
}

body {
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

/* =========================================================
   Shared footer
   ========================================================= */

.footer-simple {
  color: var(--text-muted);
  font-size: 0.95rem;
  width: 100vw;
  text-align: center;
  background: transparent;
  padding: 32px 0 12px 0;
  margin-top: auto;
}

/* =========================================================
   Home page
   ========================================================= */

.home-page {
  min-height: 100vh;
  display: flex;
  font-family: sans-serif;
  flex-direction: column;
}

.simple-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  background: none;
  justify-content: center;
  align-items: center;
}

.home-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.main-title {
  font-size: 2.5rem;
  font-weight: 400;
  letter-spacing: -2px;
  color: var(--primary);
  margin: 60px 0 24px 0;
  text-align: center;
  width: 100%;
}

.lookup-form-simple {
  width: 100%;
  max-width: 600px;
  display: flex;
  align-items: center;
  gap: 0;
  justify-content: center;
  margin: 0 auto;
}

.lookup-form-simple input[type="text"] {
  flex: 1;
  padding: 10px 16px;
  font-size: 1.1rem;
  border: 1px solid var(--border);
  border-radius: 24px 0 0 24px;
  outline: none;
  background: var(--input-bg);
  color: var(--text);
  transition: background 0.2s, color 0.2s, border 0.2s;
  min-width: 0;
}

.lookup-form-simple button {
  padding: 10px 20px;
  border: none;
  background: #4285f4;
  color: #fff;
  font-size: 1.2rem;
  border-radius: 0 24px 24px 0;
  cursor: pointer;
}

.lookup-form-simple button:disabled,
.search-bar button:disabled {
  cursor: wait;
  opacity: 0.8;
}

/* =========================================================
   Shared menu
   ========================================================= */

.menu-btn-wrap {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 110;
}

.menu-btn {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.7rem;
  cursor: pointer;
  outline: none;
  padding: 6px 10px;
}

.side-menu {
  display: none;
  position: absolute;
  top: 36px;
  left: 0;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-secondary);
  box-shadow: 0 2px 12px var(--shadow);
  border-radius: 8px;
  padding: 10px 0;
  min-width: 140px;
}

.dark-btn {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.1rem;
  cursor: pointer;
  width: 100%;
  text-align: left;
  padding: 8px 18px;
}

/* =========================================================
   Search page
   ========================================================= */

.search-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.search-header {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 100;
  background: var(--surface);
  box-shadow: 0 2px 8px var(--shadow);
  transition: box-shadow 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 72px;
  padding: 0;
}

.search-logo {
  font-size: 2.1rem;
  font-weight: 400;
  color: var(--primary);
  letter-spacing: -2px;
  text-decoration: none;
  font-family: 'Segoe UI', Arial, sans-serif;
  margin-left: 12px;
  flex: 0 0 auto;
}

.search-bar {
  flex: 1;
  display: flex;
  align-items: center;
  max-width: 600px;
  margin-left: 16px;
  justify-content: center;
}

.search-bar input[type="text"] {
  flex: 1;
  padding: 10px 16px;
  font-size: 1.1rem;
  border: 1px solid var(--border);
  border-radius: 24px 0 0 24px;
  outline: none;
  background: var(--input-bg);
  color: var(--text);
  transition: background 0.2s, color 0.2s, border 0.2s;
  min-width: 0;
}

.search-bar button {
  padding: 10px 20px;
  border: none;
  background: #4285f4;
  color: #fff;
  font-size: 1.2rem;
  border-radius: 0 24px 24px 0;
  cursor: pointer;
}

.search-content {
  flex: 1;
  max-width: 700px;
  width: 100%;
  box-sizing: border-box;
  margin: 32px auto 0 auto;
  padding: 0 16px;
  transition: opacity 0.2s ease;
}

/* =========================================================
   Existing WHOIS/result styles
   ========================================================= */

.whois-result {
  background: var(--surface-secondary);
  border-radius: 8px;
  padding: 18px 16px;
  font-size: 1rem;
  margin-top: 18px;
  white-space: pre-wrap;
  overflow-x: auto;
  transition: background 0.2s, color 0.2s;
}

.visit-link,
.visit-link-simple {
  text-decoration: none;
}

.visit-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--success);
  font-size: 1.05rem;
}

.visit-link-simple {
  color: var(--success);
  font-size: 1.1rem;
}

.error-box,
.error-box-simple {
  color: var(--error);
  margin-top: 18px;
  font-size: 1.1rem;
}

.result-box-simple {
  margin-top: 10px;
  background: var(--surface-secondary);
  color: var(--text);
  padding: 18px 16px;
  border-radius: 8px;
  max-width: 90vw;
  width: 90vw;
  min-width: 340px;
  overflow-x: auto;
  font-size: 1rem;
}

/* Keep compatibility with existing result/admin markup. */
.result {
  white-space: pre-wrap;
  background: var(--surface-secondary);
  color: var(--text);
  padding: 1rem;
  border-radius: 6px;
  margin-top: 1rem;
  font-family: monospace;
  font-size: 0.9rem;
  max-height: 500px;
  overflow-y: auto;
}

.whois-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  table-layout: fixed;
}

.whois-table th,
.whois-table td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  vertical-align: top;
  text-align: left;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.whois-table th {
  width: 30%;
  font-weight: 600;
}

.whois-table td {
  width: 70%;
  white-space: pre-line;
}

/* Generic compatibility styles retained from the original stylesheet. */
.layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  flex: 1;
  width: 80%;
  max-width: 1200px;
  margin: 0.5rem auto;
  padding: 0.2rem;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 0 20px var(--shadow);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.top-bar h1 {
  flex: 1;
  text-align: center;
  margin: 0;
  font-size: 1.5rem;
}

.top-bar button {
  padding: 0.4rem 0.8rem;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
}

.lookup-form {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.lookup-form input[type="text"] {
  flex: 1 1 300px;
  padding: 0.8rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--text);
}

.lookup-form button {
  padding: 0.8rem 1.2rem;
  font-size: 1rem;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.domain-link {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  text-align: left;
}

.pagination {
  margin-top: 1rem;
  text-align: center;
}

.pagination a {
  margin: 0 1rem;
  text-decoration: none;
  background: #007bff;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: background 0.2s;
}

.error {
  color: red;
  text-align: center;
  margin-top: 1rem;
  font-weight: bold;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
}

table,
th,
td {
  border: 1px solid var(--border);
}

th,
td {
  padding: 0.6rem;
  text-align: left;
}

thead {
  background-color: var(--surface-secondary);
}

/* =========================================================
   Responsive behavior preserved from the existing pages
   ========================================================= */

@media (max-width: 768px) {
  .container {
    width: 90%;
    margin: 0.5rem 0;
    border-radius: 0;
  }
}

@media (max-width: 600px) {
  .footer-simple {
    font-size: 0.88rem;
    padding: 18px 0 8px 0;
  }

  .result-box-simple {
    max-width: 95vw;
    width: 95vw;
    min-width: 0;
  }

  .search-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    min-height: 0;
    padding: 8px 0;
  }

  .search-logo {
    margin-left: 12px;
  }

  .search-bar {
    margin-left: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 0 8px;
  }

  .search-content {
    padding: 0 4px;
  }
}
