/* Red & white design - SMS Activation Shop */
:root {
  --red: #c41e3a;
  --red-dark: #9e1830;
  --red-light: #e63950;
  --white: #ffffff;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-600: #6c757d;
  --gray-800: #343a40;
  --black: #212529;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--black); background: var(--gray-100); }

.container { max-width: 1140px; margin: 0 auto; padding: 0 1rem; }

/* Header – platform name (left) + wallet / auth (right) */
.site-header { background: var(--white); border-bottom: 3px solid var(--red); box-shadow: var(--shadow); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; gap: 1rem; }
.logo { font-weight: 700; font-size: 1.25rem; color: var(--red); text-decoration: none; flex-shrink: 0; }
.logo:hover { color: var(--red-dark); }
.header-right { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.wallet-balance-link { text-decoration: none; }
.wallet-balance-link:hover .wallet-balance { background: var(--red); color: var(--white); }
.wallet-balance { font-weight: 600; color: var(--red); padding: 0.35rem 0.65rem; background: var(--gray-100); border-radius: var(--radius); transition: background 0.2s, color 0.2s; }
.nav-main { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.nav-main a { color: var(--gray-800); text-decoration: none; font-weight: 500; }
.nav-main a:hover, .nav-main a.active { color: var(--red); }
.nav-guest { display: flex; align-items: center; gap: 0.75rem; }
.nav-guest-link { color: var(--gray-800); text-decoration: none; font-weight: 500; padding: 0.35rem 0.5rem; }
.nav-guest-link:hover, .nav-guest-link.active { color: var(--red); }
@media (max-width: 768px) {
  .nav-main.nav-desktop { display: none; }
  .nav-guest { display: none; }
}
@media (min-width: 769px) {
  .nav-guest .btn { padding: 0.4rem 0.75rem; font-size: 0.875rem; }
}

/* Bottom navbar – mobile only */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--white); border-top: 2px solid var(--gray-200); box-shadow: 0 -2px 10px rgba(0,0,0,0.08); z-index: 99; padding: 0.5rem 0; padding-bottom: max(0.5rem, env(safe-area-inset-bottom)); display: flex; align-items: stretch; justify-content: space-around; }
@media (min-width: 769px) {
  .bottom-nav { display: none !important; }
}
.bottom-nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem; padding: 0.5rem 1rem; text-decoration: none; color: var(--gray-600); font-size: 0.75rem; font-weight: 500; flex: 1; min-width: 0; transition: color 0.2s, background 0.2s; }
.bottom-nav-item:hover { color: var(--red); background: var(--gray-100); }
.bottom-nav-item.active { color: var(--red); }
.bottom-nav-icon { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; }
.bottom-nav-icon svg { width: 22px; height: 22px; }
.bottom-nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bottom-nav-guest .bottom-nav-cta { color: var(--red); font-weight: 600; }
.bottom-nav-guest .bottom-nav-cta:hover { background: var(--gray-100); color: var(--red-dark); }
.bottom-nav-guest .bottom-nav-cta.active { color: var(--red); }

/* Main content – padding so fixed bottom nav doesn’t cover content */
@media (max-width: 768px) {
  body.has-bottom-nav .main-content { padding-bottom: 5rem; }
}

/* Buttons */
.btn { display: inline-block; padding: 0.5rem 1rem; border-radius: var(--radius); font-weight: 600; text-decoration: none; border: 2px solid transparent; cursor: pointer; font-size: 0.95rem; }
.btn-primary { background: var(--red); color: var(--white); border-color: var(--red); }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); color: var(--white); }
.btn-outline { background: transparent; color: var(--red); border-color: var(--red); }
.btn-outline:hover { background: var(--red); color: var(--white); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.875rem; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Main content */
.main-content { min-height: calc(100vh - 140px); padding: 2rem 0; }

/* Cards */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; margin-bottom: 1.5rem; border: 1px solid var(--gray-200); }
.card-title { margin: 0 0 1rem; font-size: 1.25rem; color: var(--gray-800); }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.35rem; font-weight: 600; color: var(--gray-800); }
.form-control { width: 100%; max-width: 400px; padding: 0.5rem 0.75rem; border: 1px solid var(--gray-300); border-radius: var(--radius); font-size: 1rem; }
.form-control:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 2px rgba(196, 30, 58, 0.2); }
.form-error, .form-hint { color: var(--gray-600); font-size: 0.875rem; margin-top: 0.25rem; display: block; }
.form-select { appearance: auto; cursor: pointer; }
.input-wrap { position: relative; }
.input-wrap .form-control { width: 100%; max-width: none; padding-right: 2.75rem; }
.input-wrap .input-toggle { position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--gray-600); cursor: pointer; padding: 0.25rem; font-size: 0.875rem; }
.input-wrap .input-toggle:hover { color: var(--red); }
.btn-block { display: block; width: 100%; text-align: center; }

/* Auth pages (login / signup) */
.auth-page .main-content { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 140px); padding: 2rem 1rem; }
.auth-card { max-width: 400px; width: 100%; margin: 0 auto; padding: 2rem; border-top: 4px solid var(--red); }
.auth-card .card-title { font-size: 1.5rem; margin-bottom: 0.25rem; }
.auth-subtitle { color: var(--gray-600); font-size: 0.95rem; margin-bottom: 1.5rem; }
.auth-card .form-control { max-width: none; }
.auth-card .form-group { margin-bottom: 1.25rem; }
.auth-card .btn-primary { width: 100%; padding: 0.65rem 1rem; margin-top: 0.25rem; }
.auth-footer { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--gray-200); text-align: center; }
.auth-footer a { color: var(--red); font-weight: 600; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }
.password-requirements { list-style: none; padding: 0; margin: 0.35rem 0 0; font-size: 0.875rem; color: var(--gray-600); }
.password-requirements li { margin-bottom: 0.2rem; padding-left: 1.25rem; position: relative; }
.password-requirements li::before { content: "•"; position: absolute; left: 0; color: var(--gray-400); }
.auth-forgot { margin-top: 0.5rem; margin-bottom: 0; font-size: 0.9rem; }
.auth-forgot a { color: var(--gray-600); font-weight: 500; text-decoration: none; }
.auth-forgot a:hover { color: var(--red); text-decoration: underline; }

/* Alerts */
.alert { padding: 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* Shop filters */
.shop-filters { background: var(--white); padding: 1.5rem; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 2rem; border: 1px solid var(--gray-200); }
.filter-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: 0.35rem; }
.filter-group label { font-weight: 600; font-size: 0.9rem; }

/* Searchable combo (type to filter) */
.searchable-combo { position: relative; min-width: 200px; }
.searchable-combo .searchable-select { position: absolute; left: 0; top: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; min-height: 0; }
.searchable-combo .searchable-input { width: 100%; }
.searchable-combo .searchable-dropdown { display: none; position: absolute; top: 100%; left: 0; right: 0; max-height: 220px; overflow-y: auto; background: var(--white); border: 1px solid var(--gray-300); border-top: none; border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow); z-index: 50; }
.searchable-combo.open .searchable-dropdown { display: block; }
.searchable-combo.open .searchable-input { border-radius: var(--radius) var(--radius) 0 0; }
.searchable-option { padding: 0.5rem 0.75rem; cursor: pointer; font-size: 0.95rem; border-bottom: 1px solid var(--gray-200); }
.searchable-option:last-child { border-bottom: none; }
.searchable-option:hover { background: var(--gray-100); }
.searchable-option.no-results { cursor: default; color: var(--gray-600); }
.searchable-option.no-results:hover { background: transparent; }
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.results-grid-ordered { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; }
.result-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1rem; transition: box-shadow 0.2s; display: flex; flex-direction: column; align-items: flex-start; }
.result-card:hover { box-shadow: var(--shadow); }
.result-card-name { font-weight: 600; color: var(--gray-800); display: block; margin-bottom: 0.5rem; }
.result-card-link { font-size: 0.8rem; color: var(--red); font-weight: 600; margin-top: auto; }
.result-card:hover .result-card-link { text-decoration: underline; }
.result-card .price { font-weight: 700; color: var(--red); font-size: 1.1rem; }
.result-card .meta { font-size: 0.875rem; color: var(--gray-600); margin-top: 0.5rem; }
.result-card .count { color: var(--gray-600); }
.search-filter-wrap { display: flex; flex-direction: column; gap: 0.35rem; max-width: 280px; }
.filter-label { font-weight: 600; font-size: 0.9rem; color: var(--gray-800); }
.search-filter-input { margin-bottom: 0; }

/* All services grid – alphabetical, organized */
#allServicesSection .card-title { margin-bottom: 0.5rem; }
#allServicesGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; }
.service-card { display: flex; flex-direction: column; align-items: flex-start; min-height: 0; }
.service-card .service-name { display: block; font-size: 1rem; margin-bottom: 0.25rem; }
.service-card .meta { font-size: 0.8rem; color: var(--gray-600); margin-bottom: 0.5rem; flex: 1; }
.service-card .btn { margin-top: auto; }

/* Activation page */
.activation-box { background: var(--white); border: 2px solid var(--red); border-radius: var(--radius); padding: 2rem; text-align: center; max-width: 480px; margin: 0 auto 2rem; }
.activation-box .phone { font-size: 1.5rem; font-weight: 700; color: var(--red); letter-spacing: 0.05em; margin: 1rem 0; }
.activation-box .sms-code { font-size: 2rem; font-weight: 800; color: var(--black); letter-spacing: 0.2em; margin: 1rem 0; padding: 0.5rem; background: var(--gray-100); border-radius: var(--radius); }
.activation-box .sms-text { text-align: left; margin-top: 1rem; padding: 1rem; background: var(--gray-100); border-radius: var(--radius); word-break: break-word; }
.activation-box .status { font-size: 0.9rem; color: var(--gray-600); margin-top: 0.5rem; }
.activation-box .activation-charge { font-weight: 600; font-size: 1rem; margin: 0.5rem 0; color: var(--gray-800); }
.polling-msg { color: var(--gray-600); font-size: 0.9rem; }

/* Footer – hidden on mobile */
.site-footer { background: var(--gray-800); color: var(--gray-300); padding: 2rem 0 1.5rem; margin-top: 3rem; }
@media (max-width: 768px) {
  .site-footer { display: none; }
}
.footer-grid { display: flex; flex-wrap: wrap; gap: 2rem; margin-bottom: 1.5rem; }
.footer-brand strong { color: var(--white); }
.footer-links { display: flex; gap: 1rem; }
.footer-links a { color: var(--gray-300); text-decoration: none; }
.footer-links a:hover { color: var(--white); }
.footer-copy { margin: 0; font-size: 0.875rem; color: var(--gray-600); }
.footer-own-platform { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--gray-700); font-size: 0.9rem; }
.footer-own-platform-title { font-weight: 600; color: var(--white); margin: 0 0 0.5rem; }
.footer-own-platform p { margin: 0 0 0.5rem; }
.footer-own-platform .btn { margin-top: 0.5rem; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--gray-200); }
th { background: var(--gray-100); font-weight: 600; color: var(--gray-800); }
tr:hover { background: var(--gray-100); }

/* Loader */
.loader { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; }
.loader-spinner { width: 1.25rem; height: 1.25rem; border: 2px solid var(--gray-200); border-top-color: var(--red); border-radius: 50%; animation: loader-spin 0.7s linear infinite; }
.loader-spinner-sm { width: 1rem; height: 1rem; border-width: 1.5px; }
.loader-spinner-lg { width: 2rem; height: 2rem; border-width: 3px; }
.loader-spinner-xl { width: 3rem; height: 3rem; border-width: 4px; }
.loader-block { padding: 2rem; text-align: center; color: var(--gray-600); display: flex; align-items: center; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }
.screen-loader { position: fixed; inset: 0; background: rgba(255,255,255,0.92); display: flex; align-items: center; justify-content: center; z-index: 10000; transition: opacity 0.25s; }
.screen-loader.hidden { opacity: 0; pointer-events: none; }
.screen-loader-inner { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.screen-loader-text { font-weight: 600; color: var(--gray-800); }
@keyframes loader-spin { to { transform: rotate(360deg); } }
.btn .loader-spinner { flex-shrink: 0; }
.btn.loading { pointer-events: none; opacity: 0.85; }

/* Utility */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
