/* Reset and base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: #fff;
  color: #0f0f0f;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header styles */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background-color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.menu-btn {
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
}

.logo {
  height: 30px;
  cursor: pointer;
}

.search-form {
  flex-grow: 1;
  max-width: 600px;
  position: relative;
  display: flex;
}

#searchInput {
  width: 100%;
  padding: 8px 15px;
  border: 1px solid #ddd;
  border-radius: 2px 0 0 2px;
  font-size: 16px;
  outline: none;
}

.search-form button {
  background-color: #f8f8f8;
  border: 1px solid #ddd;
  border-left: none;
  border-radius: 0 2px 2px 0;
  padding: 0 15px;
  cursor: pointer;
  font-size: 18px;
  color: #606060;
  transition: background-color 0.3s ease;
}

.search-form button:hover {
  background-color: #e8e8e8;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-right button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #606060;
  padding: 5px 10px;
  border-radius: 2px;
  transition: background-color 0.3s ease;
}

.header-right button:hover {
  background-color: #f0f0f0;
}

.sign-in-btn {
  background-color: #065fd4;
  color: white;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 2px;
  font-size: 14px;
}

.sign-in-btn:hover {
  background-color: #0041a8;
}

/* Container layout */
.container {
  display: flex;
  flex-grow: 1;
  min-height: calc(100vh - 56px - 40px); /* header + footer height */
}

/* Sidebar styles */
.sidebar {
  width: 240px;
  background-color: #f9f9f9;
  border-right: 1px solid #ddd;
  padding: 20px 0;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}

.sidebar nav ul {
  list-style: none;
}

.sidebar nav ul li {
  margin-bottom: 10px;
}

.sidebar nav ul li a {
  display: block;
  padding: 10px 24px;
  color: #606060;
  text-decoration: none;
  font-size: 14px;
  border-radius: 2px;
  transition: background-color 0.3s ease;
}

.sidebar nav ul li a:hover,
.sidebar nav ul li a.active {
  background-color: #e8e8e8;
  color: #000;
}

/* Main content styles */
.main-content {
  flex-grow: 1;
  padding: 20px;
  background-color: #fff;
  overflow-y: auto;
}

/* Video grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* Video card */
.video-card {
  background-color: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  cursor: pointer;
  outline: none;
  transition: box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.video-card:focus,
.video-card:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.thumbnail {
  width: 100%;
  height: auto;
  border-radius: 4px 4px 0 0;
  object-fit: cover;
}

.video-info {
  padding: 10px 12px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.video-title {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #030303;
}

.channel-name,
.video-meta {
  font-size: 13px;
  color: #606060;
  margin: 0;
}

/* Footer styles */
footer {
  height: 40px;
  background-color: #f9f9f9;
  border-top: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #606060;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .container {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid #ddd;
  }
  .main-content {
    padding: 10px;
  }
  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (max-width: 480px) {
  header {
    flex-wrap: wrap;
    gap: 10px;
  }
  .header-left {
    flex-grow: 1;
  }
  .search-form {
    max-width: 100%;
    flex-grow: 1;
  }
  .header-right {
    flex-grow: 0;
  }
  .video-grid {
    grid-template-columns: 1fr;
  }
}
