@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 100;
  src: url("../webfonts/Vazirmatn-Thin.woff2") format("woff2");
}
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 400;
  src: url("../webfonts/Vazirmatn-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 700;
  src: url("../webfonts/Vazirmatn-Bold.woff2") format("woff2");
}
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 900;
  src: url("../webfonts/Vazirmatn-Black.woff2") format("woff2");
}

:root {
  --bg-color: #0e0e10;
  --surface-color: #18181b;
  --surface-hover: #26262c;
  --nav-bg: #18181b;
  --text-primary: #efeff1;
  --text-secondary: #adadb8;
  --fire-main: #ff5722;
  --fire-hover: #ff7043;
  --border-color: #2f2f35;
  --transition: all 0.2s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Vazirmatn", sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

.highlight {
  color: var(--fire-main);
}
.mt-3 {
  margin-top: 1rem;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem;
  height: 50px;
  background-color: var(--nav-bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 0px 2px rgba(0, 0, 0, 0.4);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.navbar-center {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  padding: 0 2rem;
}
.navbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-img {
  height: 28px;
}
.logo-text {
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 0px;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  height: 50px;
}
.nav-links a {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  position: relative;
}
.nav-links a:hover {
  color: var(--fire-hover);
}
.nav-links a.active {
  color: var(--fire-main);
}
.nav-links a.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--fire-main);
}

.search-bar {
  display: flex;
  width: 100%;
  max-width: 400px;
  background: #000;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.search-bar:focus-within {
  border-color: var(--fire-main);
  box-shadow: 0 0 0 2px rgba(255, 87, 34, 0.2);
}
.search-bar input {
  flex-grow: 1;
  background: transparent;
  border: none;
  color: white;
  padding: 0.4rem 0.8rem;
  outline: none;
}
.search-btn {
  background: var(--surface-hover);
  border: none;
  color: white;
  padding: 0 10px;
  cursor: pointer;
}
.search-btn:hover {
  background: #35353b;
}

/* Buttons */
.btn {
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-login {
  background: var(--surface-hover);
  color: var(--text-primary);
}
.btn-login:hover {
  background: #35353b;
}
.btn-primary {
  background: var(--fire-main);
  color: #fff;
}
.btn-primary:hover {
  background: var(--fire-hover);
}
.btn-secondary {
  background: #35353b;
  color: #fff;
}

/* Layout System */
.layout-wrapper {
  display: flex;
  margin-top: 50px;
  height: calc(100vh - 50px);
}

/* Sidebar */
.sidebar {
  width: 240px;
  background-color: var(--surface-color);
  height: 100%;
  position: fixed;
  right: 0;
  top: 50px;
  overflow-y: auto;
  z-index: 100;
  border-left: 1px solid var(--border-color);
}
.sidebar::-webkit-scrollbar {
  width: 6px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: #35353b;
  border-radius: 4px;
}

.sidebar-header {
  padding: 1rem 0.8rem 0.5rem;
}
.sidebar-header h2 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.sidebar-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.8rem;
  transition: background 0.1s;
}
.sidebar-item:hover {
  background-color: var(--surface-hover);
}
.sidebar-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}
.sidebar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: #333;
}
.sidebar-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-username {
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.sidebar-category {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.sidebar-viewers {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
}
.viewer-dot {
  width: 8px;
  height: 8px;
  background-color: #eb0400;
  border-radius: 50%;
  display: inline-block;
}

/* Main Content */
.main-content {
  flex-grow: 1;
  margin-right: 240px; /* Sidebar width */
  overflow-y: auto;
  background: var(--bg-color);
  min-height: 100%;
}

/* Featured / Top Streams Background */
.top-streams {
  background: #111114;
  padding: 2rem;
  border-bottom: 1px solid var(--border-color);
}
.top-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}
.top-card .stream-thumbnail-wrapper {
  aspect-ratio: 16/9;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.content-padding {
  padding: 2rem;
  max-width: 1600px;
  margin: 0 auto;
}

.section-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.divider {
  height: 1px;
  background: var(--border-color);
  margin: 2rem 0;
}

/* Cards Grid */
.streams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem 1.5rem;
}

.stream-card {
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  cursor: pointer;
}

.stream-thumbnail-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111;
  overflow: hidden;
  margin-bottom: 0.8rem;
  transition: transform 0.2s;
}

/* Hover Effect like Twitch (border offset) */
.stream-thumbnail-wrapper::before,
.stream-thumbnail-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transition: all 0.2s;
  pointer-events: none;
}
.stream-card:hover .stream-thumbnail-wrapper {
  transform: translate(-4px, -4px);
}
.stream-card:hover .stream-thumbnail-wrapper::after {
  box-shadow: inset 0 0 0 3px var(--fire-main);
  z-index: 10;
}
.stream-card:hover .stream-thumbnail-wrapper::before {
  background: var(--fire-main);
  transform: translate(6px, 6px);
  z-index: -1;
}

.stream-thumbnail {
  width: 100%;
  height: 100%;
}
.stream-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.live-badge {
  position: absolute;
  top: 8px;
  left: 8px; /* RTL fix -> Right in original, now left top */
  background: #eb0400;
  color: #fff;
  padding: 0px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  z-index: 2;
}

.viewer-count {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 0px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
}

.stream-info {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.streamer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-color);
  margin-top: 4px;
}

.stream-details {
  overflow: hidden;
}

.stream-title {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.stream-title:hover {
  color: var(--fire-main);
}

.streamer-name {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}
.streamer-name:hover {
  color: var(--fire-main);
}

.stream-category {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--surface-hover);
  padding: 1px 8px;
  border-radius: 12px;
  display: inline-block;
  cursor: pointer;
}
.stream-category:hover {
  background: #35353b;
}

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  padding: 3rem 0;
  border-top: 1px solid var(--border-color);
  margin-top: 2rem;
}
.feature-card {
  background: var(--surface-color);
  padding: 1.5rem;
  border-radius: 8px;
  text-align: right;
  transition: transform 0.2s;
}
.feature-card:hover {
  transform: translateY(-3px);
}
.feature-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #fff;
}
.feature-card p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.6;
}

/* Support */
.support {
  padding: 2rem 0;
  display: flex;
  justify-content: center;
}
.support-box {
  background: var(--surface-color);
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
  max-width: 450px;
  width: 100%;
}
.support-box h2 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}
.support-box p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}
.support-id {
  background: #000;
  padding: 8px;
  border-radius: 4px;
  font-weight: bold;
  color: var(--fire-main);
  margin-bottom: 1.5rem;
  display: inline-block;
}
.ts-box {
  padding: 4px 10px;
  background: #2f2f35;
  border-radius: 4px;
  font-size: 0.85rem;
  display: inline-block;
}
.ts-box span {
  font-weight: bold;
  color: #fff;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: var(--transition);
}
.modal-box {
  background: var(--surface-color);
  width: 90%;
  max-width: 400px;
  border-radius: 8px;
  padding: 2rem;
}
.modal-title {
  margin-bottom: 1rem;
  font-size: 1.2rem;
}
.modal-text {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}
.modal-text ul {
  padding-right: 1.2rem;
  margin-top: 0.5rem;
}
.modal-btn-confirm {
  width: 100%;
  background: var(--fire-main);
  color: #fff;
  border: none;
  padding: 0.6rem;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
}
.modal-hidden {
  opacity: 0;
  visibility: hidden;
}

/* Empty State */
.no-stream-msg {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem;
  background: var(--surface-color);
  border-radius: 8px;
}
.no-stream-icon {
  font-size: 3rem;
  margin-bottom: 10px;
  opacity: 0.5;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.namads-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 1rem;
}
.namads-container img {
  height: 50px;
  border-radius: 4px;
  padding: 2px;
}
.namads-container a {
  display: flex;
}

html {
  scroll-behavior: smooth;
}

section {
  scroll-margin-top: 60px;
}

/* Contact Badge Styles */
.contact-badge {
  position: fixed;
  bottom: 0;
  left: 20px;
  background: #1f1f2e;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  min-width: 280px;
  border-right: 3px solid #ff5722;
  font-family: "Vazirmatn", sans-serif;
}

.contact-badge-header {
  background: #2a2a3a;
  padding: 12px 15px;
  border-radius: 12px 12px 0 0;
  cursor: pointer;
  font-weight: bold;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.contact-badge-header span:first-child {
  font-size: 1.1rem;
}

.contact-badge-toggle {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 12px;
  padding: 0 5px;
  transition: transform 0.2s;
}

.contact-badge-toggle:hover {
  color: #ff5722;
}

.contact-badge-content {
  padding: 12px 15px;
  background: #1f1f2e;
  border-radius: 0 0 12px 12px;
  display: none;
  font-size: 13px;
}

.contact-badge-content.show {
  display: block;
}

.contact-item {
  margin: 10px 0;
  color: #ccc;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 12px;
  line-height: 1.5;
  padding: 4px 0;
  border-bottom: 1px solid #2f2f35;
}

.contact-item:last-child {
  border-bottom: none;
}

.contact-item span:first-child {
  min-width: 30px;
  font-size: 16px;
}

.contact-item span:last-child {
  color: #fff;
  word-break: break-word;
}

@media (max-width: 1024px) {
  .sidebar {
    width: 60px;
  }
  .sidebar-header,
  .sidebar-info,
  .sidebar-viewers {
    display: none;
  }
  .sidebar-item-left {
    justify-content: center;
    width: 100%;
    margin: 0;
  }
  .main-content {
    margin-right: 60px;
  }
}

@media (max-width: 768px) {
  .navbar-center,
  .nav-links {
    display: none;
  }
  .sidebar {
    display: none;
  }
  .main-content {
    margin-right: 0;
  }
  .top-streams {
    padding: 1rem;
  }
}
