/* Green UI theme for the Iran Travian player panel. */
:root {
  --it-green-950: #052e22;
  --it-green-900: #06432f;
  --it-green-800: #09613e;
  --it-green-700: #0b7a4d;
  --it-green-600: #11945e;
  --it-green-100: #e4f7ec;
  --it-green-50: #f3fbf6;
  --it-ink: #15372b;
  --it-muted: #687d73;
  --it-line: #e0eee5;
  --it-shadow: 0 16px 42px rgba(8, 65, 43, .09);
}

html { scroll-behavior: smooth; }
body,
input,
textarea,
select,
button,
.navbar,
.breadcrumb,
.table,
.form-control {
  font-family: Tahoma, Arial, sans-serif !important;
}
body {
  color: var(--it-ink);
  background:
    radial-gradient(ellipse at 8% 4%, rgba(17, 148, 94, .08), transparent 33rem),
    radial-gradient(ellipse at 95% 20%, rgba(55, 180, 113, .07), transparent 28rem),
    #f5faf7;
  direction: rtl;
  text-align: right;
}

.navbar.navbar-dark.bg-dark,
.navbar.static-top {
  min-height: 68px;
  padding: .65rem 1.25rem;
  background: linear-gradient(115deg, var(--it-green-950), var(--it-green-800)) !important;
  box-shadow: 0 7px 26px rgba(3, 44, 29, .19);
  position: relative;
  z-index: 20;
}
.navbar-brand {
  color: #fff !important;
  font-family: Tahoma, Arial, sans-serif !important;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -.2px;
  transition: opacity .2s ease;
}
.navbar-brand:hover { opacity: .88; }
#sidebarToggle { color: rgba(255,255,255,.85) !important; }

#wrapper { min-height: calc(100vh - 68px); }
.sidebar.navbar-nav {
  position: relative;
  z-index: 1100;
  isolation: isolate;
  flex: 0 0 250px;
  width: 250px !important;
  min-height: calc(100vh - 68px);
  padding: 20px 12px;
  background: linear-gradient(180deg, var(--it-green-950), #0a4934 76%, #073b2b) !important;
  box-shadow: 8px 0 28px rgba(5, 46, 34, .08);
}
.sidebar .nav-item { margin: 4px 0; }
.sidebar .nav-item .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: .8rem .9rem;
  border: 1px solid transparent;
  border-radius: 13px;
  color: rgba(241, 255, 247, .78) !important;
  text-align: right;
  transition: background .22s ease, color .22s ease, transform .22s ease, box-shadow .22s ease;
}
.sidebar .nav-item .nav-link i {
  width: 22px;
  margin: 0;
  color: #8de1b4;
  font-size: 1rem;
  text-align: center;
}
.sidebar .nav-item .nav-link span {
  display: inline !important;
  font-size: .88rem !important;
  font-weight: 600;
  line-height: 1.8;
}
.sidebar .nav-item .nav-link:hover,
.sidebar .nav-item.active .nav-link {
  color: #fff !important;
  background: linear-gradient(100deg, rgba(34, 184, 111, .27), rgba(17, 148, 94, .12));
  border-color: rgba(141, 225, 180, .17);
  box-shadow: inset 3px 0 0 #5ee29b, 0 8px 20px rgba(0, 0, 0, .08);
  transform: translateX(-2px);
}
.sidebar .nav-item.active .nav-link i { color: #b5ffd3; }
.sidebar .nav-item-logout { position: relative; z-index: 1101; margin-top: auto; padding-top: 15px; }
.sidebar .nav-item-logout .nav-link { position: relative; z-index: 1102; pointer-events: auto !important; cursor: pointer; color: #ffd7d7 !important; }
.sidebar .nav-item-logout .nav-link i { color: #ffadad; }
.sidebar .nav-item-logout .nav-link:hover { background: rgba(220, 53, 69, .15); border-color: rgba(255, 173, 173, .18); }

#content-wrapper,
#content-wrapper1 {
  min-width: 0;
  height: auto !important;
  width: 100%;
  padding: 24px 26px 76px !important;
  background: transparent !important;
}
#content-wrapper1 > .container-fluid,
#content-wrapper > .container-fluid { max-width: 1500px; margin: 0 auto; }
.breadcrumb {
  align-items: center;
  padding: .8rem 1rem;
  background: rgba(255,255,255,.86);
  border: 1px solid var(--it-line);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(10, 70, 43, .035);
}
.breadcrumb-item,
.breadcrumb-item.active { color: var(--it-muted); }
.breadcrumb-item a { color: var(--it-green-700); font-weight: 700; }
.breadcrumb-item a:hover { color: var(--it-green-900); text-decoration: none; }
h1, h2, h3, h4, h5, h6 { color: var(--it-ink); font-weight: 800; line-height: 1.65; }
hr { border-top-color: var(--it-line); }

.card,
.travian-container,
.registration-panel,
.panel-surface {
  overflow: hidden;
  border: 1px solid rgba(215, 235, 223, .95) !important;
  border-radius: 18px !important;
  background: rgba(255,255,255,.96);
  box-shadow: var(--it-shadow);
}
.card-header {
  padding: 1rem 1.35rem;
  color: var(--it-green-900);
  background: linear-gradient(110deg, #f3fbf6, #ffffff);
  border-bottom: 1px solid var(--it-line);
  font-weight: 800;
}
.card-body { padding: 1.4rem; }
.btn,
button,
input[type="submit"] {
  border-radius: 10px;
  font-weight: 700;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:hover,
button:hover,
input[type="submit"]:hover { transform: translateY(-1px); }
.btn-primary,
.btn-success,
input[type="submit"].btn-primary {
  color: #fff !important;
  border-color: var(--it-green-700) !important;
  background: linear-gradient(115deg, var(--it-green-700), var(--it-green-600)) !important;
  box-shadow: 0 7px 17px rgba(17, 148, 94, .18);
}
.btn-primary:hover,
.btn-success:hover,
input[type="submit"].btn-primary:hover {
  border-color: var(--it-green-800) !important;
  background: linear-gradient(115deg, var(--it-green-800), var(--it-green-700)) !important;
  box-shadow: 0 10px 23px rgba(17, 148, 94, .24);
}
.form-control,
input.text,
textarea {
  min-height: 44px;
  color: var(--it-ink);
  border: 1px solid #dbe9e0;
  border-radius: 10px;
  background: #fbfefc;
  box-shadow: none;
}
.form-control:focus,
input.text:focus,
textarea:focus {
  border-color: #52bd86;
  background: #fff;
  box-shadow: 0 0 0 .2rem rgba(17, 148, 94, .12);
  outline: 0;
}
.form-group label,
.form-field-label { margin-bottom: .55rem; color: #355847; font-weight: 700; }
.table { color: var(--it-ink); }
.table thead th { color: var(--it-green-900); background: var(--it-green-50); border-bottom: 1px solid var(--it-line); }
.table td, .table th { vertical-align: middle; border-color: var(--it-line); }
.alert { border-radius: 12px; border-width: 1px; }
.alert-success { border-color: #c3ead0; background: #effbf3; color: #17643c; }
.alert-danger { border-color: #f2cece; background: #fff5f5; color: #9d2c39; }
.panel-alert { box-shadow: 0 6px 20px rgba(10, 70, 43, .04); }
footer.sticky-footer {
  margin-top: 35px;
  padding: 18px 10px;
  background: transparent !important;
  border-top: 1px solid rgba(208, 230, 216, .75);
  color: #71877b;
}
footer.sticky-footer a { color: var(--it-green-700); font-weight: 700; }
.scroll-to-top { z-index: 100; color: #fff !important; background: var(--it-green-700); border-radius: 15px !important; box-shadow: 0 8px 22px rgba(8, 97, 62, .28); }
.scroll-to-top:hover { background: var(--it-green-900); }

/* Server selection */
.panel-enter { animation: itFadeUp .55s cubic-bezier(.2,.75,.25,1) both; }
.register-page-heading {
  display: flex;
  align-items: center;
  gap: 17px;
  margin: 14px 0 25px;
  padding: 22px 24px;
  border: 1px solid rgba(204, 233, 215, .88);
  border-radius: 20px;
  background: linear-gradient(110deg, rgba(255,255,255,.98), rgba(239,250,243,.9));
  box-shadow: 0 12px 32px rgba(8, 65, 43, .05);
}
.heading-mark {
  display: flex;
  flex: 0 0 62px;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  color: #fff;
  border-radius: 18px;
  background: linear-gradient(140deg, #0a7549, #2cc47d);
  box-shadow: 0 10px 22px rgba(17, 148, 94, .2);
  font-size: 1.4rem;
  animation: itFloat 4.5s ease-in-out infinite;
}
.eyebrow { display: block; margin-bottom: 2px; color: var(--it-green-700); font-size: .68rem; font-weight: 800; letter-spacing: 1.6px; }
.register-page-heading h1 { margin: 0; font-size: 1.55rem; }
.register-page-heading p { margin: 4px 0 0; color: var(--it-muted); font-size: .91rem; line-height: 1.9; }
.server-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.server-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 22px;
  overflow: hidden;
  border: 1px solid #dceee3;
  border-radius: 20px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 12px 32px rgba(7, 71, 43, .065);
  animation: itFadeUp .65s cubic-bezier(.2,.75,.25,1) both;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.server-card:nth-child(2) { animation-delay: .09s; }
.server-card:nth-child(3) { animation-delay: .18s; }
.server-card:before { position: absolute; top: 0; right: 0; left: 0; height: 4px; content: ""; background: linear-gradient(90deg, #0e6b43, #4cda8c); }
.server-card:hover { transform: translateY(-6px); border-color: #b8e3c9; box-shadow: 0 22px 48px rgba(7, 71, 43, .12); }
.server-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.server-icon { display: inline-flex; flex: 0 0 48px; align-items: center; justify-content: center; width: 48px; height: 48px; color: var(--it-green-700); border-radius: 15px; background: linear-gradient(135deg, #e5f8ed, #f4fcf7); font-size: 1.15rem; }
.server-prize { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; color: #946317; border: 1px solid #f2e4b7; border-radius: 999px; background: #fff9e7; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.server-card h2 { margin: 5px 0 0; font-size: 1.35rem; text-align: right; }
.server-card h2 a { color: var(--it-green-900); text-decoration: none; }
.server-card h2 a:hover { color: var(--it-green-600); }
.server-domain { margin: 1px 0 18px; color: #7e9187; font-size: .78rem; direction: ltr; text-align: right; }
.server-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.server-specs > div { display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: 12px; border: 1px solid #e5f0e9; border-radius: 12px; background: #f8fcf9; }
.server-specs span { color: #7b8e83; font-size: .73rem; }
.server-specs strong { color: #2b4b3a; font-size: .82rem; }
.server-specs .server-speed { color: var(--it-green-700); font-size: 1rem; font-weight: 900; }
.server-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: auto; }
.btn-server-primary,
.btn-server-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 43px; padding: .65rem .7rem; font-size: .79rem; text-decoration: none !important; white-space: nowrap; }
.btn-server-primary { color: #fff !important; border: 1px solid #0b8554; background: linear-gradient(115deg, #087247, #159c62); box-shadow: 0 7px 17px rgba(17, 148, 94, .15); }
.btn-server-primary:hover { color: #fff !important; background: linear-gradient(115deg, #065a3b, #0b8554); box-shadow: 0 10px 22px rgba(17, 148, 94, .25); }
.btn-server-secondary { color: #246547 !important; border: 1px solid #d5eade; background: #f8fcf9; }
.btn-server-secondary:hover { color: #06432f !important; border-color: #a8d9bb; background: #ecf9f1; }
.server-note { display: flex; align-items: center; gap: 7px; margin: 15px 0 0; color: #668276; font-size: .72rem; }
.server-note i { color: #1aa369; }
.register-help-row { display: flex; align-items: center; gap: 14px; margin-top: 22px; padding: 17px 20px; border: 1px solid #dceee3; border-radius: 16px; background: rgba(255,255,255,.82); }
.register-help-icon { display: inline-flex; flex: 0 0 42px; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 13px; color: var(--it-green-700); background: var(--it-green-100); }
.register-help-row strong { color: #234a34; font-size: .88rem; }
.register-help-row p { margin: 3px 0 0; color: var(--it-muted); font-size: .77rem; line-height: 1.8; }
.register-help-link { display: inline-flex; align-items: center; gap: 7px; margin-right: auto; padding: 9px 13px; border-radius: 10px; color: var(--it-green-800) !important; background: #eaf8ef; font-size: .8rem; font-weight: 800; white-space: nowrap; }
.register-help-link:hover { color: var(--it-green-950) !important; background: #ddf4e5; text-decoration: none; }

/* Registration form */
.registration-panel { max-width: 850px; margin: 0 auto; }
.registration-server-summary { display: flex; align-items: center; gap: 14px; padding: 20px 23px; border-bottom: 1px solid var(--it-line); background: linear-gradient(110deg, #f1fbf5, #ffffff); }
.registration-server-summary h2 { margin: 0; font-size: 1.2rem; }
.registration-server-summary p { margin: 3px 0 0; color: var(--it-muted); font-size: .82rem; }
.summary-label { color: #6b8b78; font-size: .75rem; }
.summary-world-link { margin-right: auto; color: var(--it-green-700) !important; font-size: .8rem; font-weight: 800; white-space: nowrap; }
.server-registration-form { padding: 25px; }
.server-registration-form .form-group { margin-bottom: 20px; }
.server-registration-form .form-control { height: 48px; }
.accept-roles-row { display: flex; align-items: center; gap: 10px; margin: 7px 0 22px; color: #456653; font-size: .85rem; cursor: pointer; }
.accept-roles-row input { width: 17px; height: 17px; accent-color: var(--it-green-700); }
.btn-submit-registration { width: 100%; min-height: 48px; font-size: .92rem; }
.panel-empty-state { max-width: 620px; margin: 60px auto; padding: 35px; text-align: center; border: 1px solid var(--it-line); border-radius: 18px; background: #fff; box-shadow: var(--it-shadow); }
.empty-state-icon { display: inline-flex; align-items: center; justify-content: center; width: 62px; height: 62px; margin-bottom: 10px; color: var(--it-green-700); border-radius: 20px; background: var(--it-green-100); font-size: 1.4rem; }
.panel-empty-state p { color: var(--it-muted); }

@keyframes itFadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes itFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@media (max-width: 1200px) {
  .server-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
  #wrapper { display: block; }
  .sidebar.navbar-nav { display: flex; flex-direction: row; flex-wrap: wrap; align-items: stretch; gap: 5px; width: 100% !important; min-height: 0; padding: 8px; overflow: visible; box-shadow: 0 7px 20px rgba(5, 46, 34, .09); }
  .sidebar .nav-item { flex: 0 1 auto; margin: 0; }
  .sidebar .nav-item .nav-link { min-height: 43px; gap: 7px; padding: .65rem .8rem; }
  .sidebar .nav-item .nav-link span { display: inline !important; font-size: .74rem !important; white-space: nowrap; }
  .sidebar .nav-item .nav-link i { width: 17px; font-size: .85rem; }
  .sidebar .nav-item-logout { margin: 0; padding: 0; }
  #content-wrapper,
  #content-wrapper1 { padding: 16px 12px 60px !important; }
  .register-page-heading { align-items: flex-start; gap: 12px; padding: 17px; }
  .heading-mark { flex-basis: 49px; width: 49px; height: 49px; border-radius: 14px; font-size: 1.1rem; }
  .register-page-heading h1 { font-size: 1.2rem; }
  .register-page-heading p { font-size: .8rem; }
  .server-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .server-card { padding: 18px; }
  .register-help-row { flex-wrap: wrap; padding: 14px; }
  .register-help-row > div:nth-child(2) { flex: 1 1 calc(100% - 60px); }
  .register-help-link { margin-right: 56px; }
  .registration-server-summary { flex-wrap: wrap; padding: 16px; }
  .summary-world-link { width: 100%; margin-right: 62px; }
  .server-registration-form { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (min-width: 768px) {
  .sidebar.navbar-nav.toggled {
    flex: 0 0 76px;
    width: 76px !important;
  }
  .sidebar.navbar-nav.toggled .nav-item .nav-link {
    justify-content: center;
    padding-right: .5rem;
    padding-left: .5rem;
  }
  .sidebar.navbar-nav.toggled .nav-item .nav-link span { display: none !important; }
}

/* Final logout control fix: direct link, transparent background, reliable click target. */
.sidebar.navbar-nav {
  z-index: 99999 !important;
}
.sidebar .nav-item-logout,
.sidebar .nav-item-logout > .logout-nav-button {
  position: relative !important;
  z-index: 100000 !important;
  width: 100% !important;
  pointer-events: auto !important;
}
.sidebar .nav-item-logout { margin-top: auto; padding-top: 15px; }
.sidebar .nav-item-logout > .logout-nav-button {
  display: flex !important;
  min-height: 44px;
  margin: 0 !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer !important;
  text-decoration: none !important;
  color: #ffd7d7 !important;
}
.sidebar .nav-item-logout > .logout-nav-button:hover,
.sidebar .nav-item-logout > .logout-nav-button:focus-visible {
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  border-color: transparent !important;
  color: #fff !important;
  outline: 2px solid rgba(255, 173, 173, .55);
  outline-offset: -2px;
}
.sidebar .nav-item-logout > .logout-nav-button span,
.sidebar .nav-item-logout > .logout-nav-button i { pointer-events: none; }
