:root {
  --yt-red: #ff0000;
  --yt-dark: #0f0f0f;
  --yt-text: #f1f1f1;
  --yt-gray: #272727;
  --yt-button: #3ea6ff;
}

body {
  margin: 0;
  font-family: "Roboto", sans-serif;
  background: var(--yt-dark);
  color: var(--yt-text);
  min-height: 100vh;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  background: rgba(15, 15, 15, 0.95);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 100;
  box-sizing: border-box;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  backdrop-filter: blur(10px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--yt-text);
  min-width: 90px;
}

.logo svg {
  height: 20px;
}

@media (max-width: 640px) {
  .logo span {
    display: none;
  }
  
  .logo {
    min-width: unset;
  }
}

.search-container {
  display: flex;
  align-items: center;
  max-width: 600px;
  width: 50%;
  margin: 0 auto;
  position: relative;
}

@media (max-width: 768px) {
  .search-container {
    width: 60%;
  }
}

@media (max-width: 480px) {
  .search-container {
    width: 50%;
  }
  
  .search-bar {
    font-size: 14px !important;
  }
}

.search-bar {
  width: 100%;
  padding: 0.5rem 1rem;
  border: 1px solid var(--yt-gray);
  border-radius: 20px 0 0 20px;
  background: var(--yt-dark);
  color: var(--yt-text);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.search-bar:focus {
  border-color: #1c62b9;
}

.search-button {
  padding: 0.5rem;
  width: 50px;
  background: var(--yt-gray);
  border: 1px solid var(--yt-gray);
  border-radius: 0 20px 20px 0;
  color: var(--yt-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.search-button:hover {
  background: #3d3d3d;
}

.sign-in-button {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--yt-button);
  color: var(--yt-button);
  padding: 6px 12px;
  border-radius: 18px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .sign-in-button span {
    display: none;
  }
}

.sign-in-button:hover {
  background: rgba(62, 166, 255, 0.1);
}

.sign-in-button svg {
  width: 24px;
  height: 24px;
  fill: var(--yt-button);
}

.create-button {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent; 
  padding: 6px 12px;
  border: none;
  color: var(--yt-text);
  cursor: pointer;
  transition: background 0.2s;
}

.create-button:hover {
  background: var(--yt-gray);
  border-radius: 50%;
}

.shorts-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  border: none;
  color: var(--yt-text);
  cursor: pointer;
  font-size: 14px;
  border-radius: 20px;
  transition: background 0.2s;
  margin-right: 12px;
}

.shorts-button:hover {
  background: var(--yt-gray);
}

.shorts-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.content {
  margin-top: 60px;
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

@media (max-width: 640px) {
  .content {
    grid-template-columns: 1fr;
    padding: 0.5rem;
  }
}

.video-card {
  background: var(--yt-gray);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  transform: translateY(0);
}

.video-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.thumbnail {
  width: 100%;
  aspect-ratio: 16/9;
  background: #333;
  position: relative;
  background-size: cover;
  background-position: center;
  transition: transform 0.3s ease;
  border-radius: 12px 12px 0 0;
}

.video-card:hover .thumbnail {
  transform: scale(1.02);
}

.duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  backdrop-filter: blur(4px);
}

.video-info {
  padding: 12px;
}

.video-title {
  font-weight: 500;
  margin-bottom: 8px;
  font-size: 0.95rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.channel-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: #aaa;
  margin-bottom: 4px;
}

.channel-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #555;
  background-size: cover;
  cursor: pointer;
}

.stats {
  display: flex;
  gap: 0.5rem;
  color: #aaa;
  font-size: 0.75rem;
}

@keyframes pulse {
  0% { background-position: -100% 0; }
  100% { background-position: 200% 0; }
}

.loading {
  background: linear-gradient(90deg, var(--yt-gray) 25%, #333 50%, var(--yt-gray) 75%);
  background-size: 200% 100%;
  animation: pulse 1.5s infinite;
}

.shorts-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  display: none;
  z-index: 2000;
  flex-direction: column;
}

.shorts-container.active {
  display: flex;
}

.shorts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: transparent;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2001;
}

.shorts-title {
  color: white;
  font-size: 20px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.shorts-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shorts-player {
  width: 100%;
  max-width: 400px;
  height: calc(100vh - 100px);
  background: #000;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}

@media (max-width: 768px) {
  .shorts-player {
    max-width: 100%;
    height: 100vh;
    border-radius: 0;
  }
}

.shorts-controls {
  position: absolute;
  right: 16px;
  bottom: 100px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  color: white;
  z-index: 2002;
}

.shorts-control-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.2s;
}

.shorts-control-button:hover {
  transform: scale(1.1);
}

.shorts-control-button svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.shorts-control-button span {
  font-size: 12px;
}

.video-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.98);
  display: none;
  z-index: 1000;
  padding: 20px;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-modal.active {
  display: flex;
  flex-direction: column;
  opacity: 1;
}

.video-player-container {
  position: relative;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  aspect-ratio: 16/9;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.9);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  height: 70vh;
  max-height: 800px;
}

.video-player {
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}

.close-modal {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  z-index: 1001;
  padding: 8px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}

.close-modal:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.video-details {
  max-width: 1440px;
  margin: 16px auto 0;
  color: white;
  width: 100%;
  background: rgba(20, 20, 20, 0.95);
  padding: 24px 32px;
  border-radius: 16px;
  backdrop-filter: blur(20px);
  transition: all 0.3s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.video-title-modal {
  font-size: 2rem;
  margin-bottom: 16px;
  line-height: 1.3;
  font-weight: 500;
}

.video-channel {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.video-channel .channel-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #555;
  background-size: cover;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: border-color 0.2s ease;
}

.video-channel .channel-avatar:hover {
  border-color: var(--yt-button);
}

.video-description {
  color: #ddd;
  white-space: pre-wrap;
  line-height: 1.5;
  font-size: 15px;
}

@media (max-width: 768px) {
  .video-modal {
    padding: 10px;
  }
  
  .video-title-modal {
    font-size: 1.5rem;
  }
  
  .video-details {
    padding: 16px;
    margin-top: 12px;
  }
  
  .close-modal {
    top: 10px;
    right: 10px;
  }
}

@media (max-width: 480px) {
  .video-modal {
    padding: 0;
  }
  
  .video-details {
    padding: 12px;
  }
  
  .video-title-modal {
    font-size: 1.2rem;
  }
  
  .video-channel .channel-avatar {
    width: 36px;
    height: 36px;
  }
}

.video-actions {
  display: flex;
  gap: 16px;
  margin: 20px 0;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
}

.video-action-button {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  padding: 10px 20px;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 15px;
}

.video-action-button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.video-action-button.active {
  background: rgba(62, 166, 255, 0.3);
  color: var(--yt-button);
}

.video-action-button svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.subscribe-button {
  background: var(--yt-red);
  color: white;
  font-weight: 500;
  margin-left: auto;
  padding: 10px 24px;
  font-size: 16px;
}

.subscribe-button:hover {
  background: #e60000;
  transform: translateY(-2px);
}

.subscribe-button.subscribed {
  background: #333;
}

.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--yt-dark);
  padding: 8px 0;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.bottom-nav-buttons {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.bottom-nav-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  color: var(--yt-text);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 12px;
}

.bottom-nav-button svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.bottom-nav-button:hover {
  color: var(--yt-button);
}

@media (max-width: 768px) {
  .bottom-nav {
    display: block;
  }

  .content {
    margin-bottom: 80px;
  }

  .header .create-button,
  .header .shorts-button {
    display: none;
  }
}

/* Profile page styles */
.profile-page {
  display: none;
  margin-top: 60px;
  padding: 20px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.profile-header {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.profile-avatar-container {
  position: relative;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #555;
  background-size: cover;
  background-position: center;
}

.profile-pic-input {
  display: none;
}

.profile-pic-label {
  position: absolute;
  bottom: 0;
  right: 0;
  background: var(--yt-button);
  color: white;
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 12px;
  cursor: pointer;
}

.profile-info {
  flex: 1;
  min-width: 300px;
}

.profile-input {
  display: block;
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  background: var(--yt-gray);
  border: 1px solid #444;
  border-radius: 8px;
  color: white;
  font-size: 16px;
}

.bio-input {
  height: 100px;
  resize: none;
}

.profile-stats {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  color: #aaa;
  font-size: 14px;
}

.profile-done-btn {
  background: var(--yt-button);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 500;
  font-size: 16px;
}

/* Create page styles */
.create-page {
  display: none;
  margin-top: 60px;
  padding: 20px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.create-form {
  background: var(--yt-gray);
  padding: 20px;
  border-radius: 12px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.form-group input, 
.form-group textarea {
  width: 100%;
  padding: 10px;
  background: #333;
  border: 1px solid #444;
  border-radius: 8px;
  color: white;
  font-size: 16px;
}

.form-group textarea {
  resize: vertical;
}

.upload-button {
  background: var(--yt-red);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 500;
  font-size: 16px;
  display: block;
  margin: 0 auto;
}