/* ===== RESET ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== VARIABLES ===== */
:root {
  --bg: #f9f9f9;
  --card: #ffffff;
  --text: #0f0f0f;
  --border: #e5e5e5;
}

body.dark {
  --bg: #0f0f0f;
  --card: #1a1a1a;
  --text: #ffffff;
  --border: #333;
}

/* ===== BODY ===== */
body {
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ===== HEADER ===== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  background: #2f3f64;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  color:#fff;
}

.logo {
  font-weight: 600;
  font-size: 18px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* SEARCH */
#search {
  padding: 8px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  outline: none;
  width: 220px;
}

/* BUTTONS */
button {
  padding: 7px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: #fff;
  color: #000;
}

body.dark button {
  background: #fff;
  color: #000;
}

/* ===== LAYOUT ===== */
.layout {
  display: flex;
  width: 100%;
  min-height: calc(100vh - 60px);
}

/* ===== SIDEBAR ===== */
aside {
  width: 240px;
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 12px;
  overflow-y: auto;
  transition: 0.3s;
}

aside div {
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
}

aside div:hover {
  background: rgba(0,0,0,0.05);
}

body.dark aside div:hover {
  background: rgba(255,255,255,0.1);
}

/* ===== MAIN ===== */
main {
  flex: 1;
  padding: 20px;
  max-width: 100%;
  
}

/* ===== GRID (KEY FIX) ===== */
.grid {
  display: grid;

  /* AUTO RESPONSIVE GRID */
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));

  gap: 20px;
}

/* ===== CARD ===== */
.card {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: 0.2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.15);
}

body.dark .card {
  box-shadow: 0 2px 10px rgba(255,255,255,0.05);
}

/* THUMBNAIL */
.card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

/* TITLE */
.card p {
  padding: 10px;
  font-size: 14px;
  font-weight: 500;
}

/* ===== MODAL ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 900px;
  margin: 5% auto;
}

.modal iframe {
  width: 100%;
  height: 500px;
  border: none;
}

#close {
  position: absolute;
  top: -30px;
  right: 10px;
  font-size: 30px;
  color: #fff;
  cursor: pointer;
}

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 12px;
  background: var(--card);
  border-top: 1px solid var(--border);
  font-size: 14px;
}

/* ===== SCROLLBAR ===== */
aside::-webkit-scrollbar {
  width: 6px;
}

aside::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 10px;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {

  .layout {
    flex-direction: column;
  }

  aside {
    position: fixed;
    left: -240px;
    top: 60px;
    height: 100%;
    z-index: 1000;
  }

  aside.active {
    left: 0;
  }

  main {
    padding: 15px;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .modal iframe {
    height: 250px;
  }

  #search {
    width: 140px;
  }
}

#videos {
  padding-top:15px;
}

#sidebar {
  background-color: #2f3f64;
  color: #fff;
}

#sidebar div{
  border-bottom: 1px solid #878787; 
}