* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Montserrat', Arial, sans-serif;
  background: #f5f5f5;
  color: #222;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: linear-gradient(135deg, #FFD700 0%, #FF6B00 50%, #FF0080 100%);
  color: white;
  padding: 1.5rem 2rem;
  box-shadow: 0 4px 16px rgba(255, 107, 0, 0.3);
}

.header-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid white;
}

header h1 {
  font-family: 'Oswald', sans-serif;
  font-size: 2rem;
  margin: 0;
  letter-spacing: 2px;
}

header p {
  margin: 0.25rem 0 0 0;
  font-size: 0.9rem;
  opacity: 0.8;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  align-items: center;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: background 0.2s, transform 0.2s;
  font-size: 0.95rem;
  white-space: nowrap;
}

nav a:hover, nav a.active {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  nav {
    justify-content: center;
    gap: 0.5rem;
  }
  nav a {
    font-weight: 400;
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
  }
}

main {
  flex: 1;
  padding: 2rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.search-section {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

#searchInput {
  flex: 1;
  min-width: 250px;
  padding: 0.75rem 1rem;
  border: 2px solid #ddd;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-family: 'Montserrat', sans-serif;
}

#filterCategory {
  padding: 0.75rem 1rem;
  border: 2px solid #ddd;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-family: 'Montserrat', sans-serif;
  background: white;
  cursor: pointer;
}

#sortOrder {
  padding: 0.75rem 1rem;
  border: 2px solid #ddd;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-family: 'Montserrat', sans-serif;
  background: white;
  cursor: pointer;
}

#filterState {
  padding: 0.75rem 1rem;
  border: 2px solid #ddd;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-family: 'Montserrat', sans-serif;
  background: white;
  cursor: pointer;
}

#filterCity {
  padding: 0.75rem 1rem;
  border: 2px solid #ddd;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-family: 'Montserrat', sans-serif;
  min-width: 150px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.video-card {
  background: white;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.video-thumbnail {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #222;
}

.video-card-content {
  padding: 1rem;
}

.video-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  color: #222;
}

.video-card p {
  margin: 0;
  font-size: 0.9rem;
  color: #666;
  line-height: 1.4;
}

.video-meta {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: #999;
}

.category-badge {
  display: inline-block;
  background: linear-gradient(135deg, #FFD700 0%, #FF6B00 100%);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-top: 0.5rem;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: #999;
}

.empty-state a {
  color: #222;
  font-weight: 600;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  overflow: auto;
}

.modal-content {
  position: relative;
  margin: 2rem auto;
  max-width: 900px;
  background: white;
  border-radius: 1rem;
  overflow: hidden;
}

.close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: white;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001;
  background: rgba(0,0,0,0.5);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.close:hover {
  background: rgba(0,0,0,0.8);
}

#modalVideo {
  width: 100%;
  max-height: 500px;
  background: #000;
}

.video-info {
  padding: 1.5rem;
}

.video-info h2 {
  margin: 0 0 0.5rem 0;
  color: #222;
}

.video-info p {
  margin: 0.5rem 0;
  color: #666;
}

.delete-btn {
  margin-top: 1rem;
  padding: 0.5rem 1.5rem;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
}

.delete-btn:hover {
  background: #c82333;
}

.upload-section {
  max-width: 600px;
  margin: 0 auto;
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.upload-section h2 {
  margin: 0 0 1.5rem 0;
  color: #222;
  font-family: 'Oswald', sans-serif;
  letter-spacing: 1px;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #222;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #ddd;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-family: 'Montserrat', sans-serif;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #FF6B00;
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
}

.form-group small {
  display: block;
  margin-top: 0.25rem;
  color: #999;
  font-size: 0.85rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.btn-primary {
  flex: 1;
  padding: 1rem;
  background: linear-gradient(135deg, #FFD700 0%, #FF6B00 50%, #FF0080 100%);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Oswald', sans-serif;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  letter-spacing: 1px;
  box-shadow: 0 4px 12px rgba(255, 107, 0, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 0, 0.4);
}

.btn-secondary {
  padding: 1rem 2rem;
  background: #ddd;
  color: #222;
  text-decoration: none;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: background 0.2s;
  display: flex;
  align-items: center;
}

.btn-secondary:hover {
  background: #ccc;
}

.upload-progress {
  margin-top: 2rem;
  text-align: center;
}

.progress-bar {
  width: 100%;
  height: 30px;
  background: #ddd;
  border-radius: 1rem;
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #FFD700 0%, #FF6B00 50%, #FF0080 100%);
  width: 0%;
  transition: width 0.3s;
}

footer {
  text-align: center;
  padding: 2rem;
  background: linear-gradient(135deg, #222 0%, #1a1a1a 100%);
  color: #FFD700;
  font-size: 0.9rem;
  margin-top: auto;
  border-top: 3px solid #FF6B00;
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    text-align: center;
  }
  
  nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
  
  nav a {
    font-weight: 400;
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
  }

  #authSection, #userSection {
    width: auto;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-left: 0;
  }
  
  .video-grid {
    grid-template-columns: 1fr;
  }
  
  .search-section {
    flex-direction: column;
  }
  
  #searchInput {
    min-width: 100%;
  }
}

/* Auth UI */
#authSection, #userSection {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

#userSection {
  font-size: 0.9rem;
}

#userEmail {
  font-weight: 600;
}

#signOutBtn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  margin: 0;
  white-space: nowrap;
}

.loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  color: #999;
}

/* Favorite Feature Styles */
.video-thumbnail-wrapper {
    position: relative;
}

.favorite-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10;
}

.favorite-icon:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.favorite-icon.favorited {
    color: #FF0080;
}

.favorite-section {
    margin: 0.5rem 0 0.25rem;
}

.btn-favorite {
    padding: 0.35rem 0.9rem;
    background: white;
    border: 1.5px solid #ddd;
    border-radius: 16px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-family: 'Montserrat', sans-serif;
    color: #555;
}

.btn-favorite:hover {
    border-color: #FF0080;
    color: #FF0080;
}

.btn-favorite.favorited {
    background: linear-gradient(135deg, #FF0080, #FF6B00);
    color: white;
    border-color: #FF0080;
}

.btn-favorite .heart {
    font-size: 1rem;
    line-height: 1;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.empty-state a {
    color: #FF0080;
    text-decoration: none;
    font-weight: 600;
}

.empty-state a:hover {
    text-decoration: underline;
}

/* Tags Section */
.tags-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.tags-section h3 {
    margin-bottom: 1rem;
    color: #333;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    min-height: 40px;
}

.tag {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.add-tag {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.add-tag input {
    flex: 1;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
}

.no-data {
    color: #999;
    font-style: italic;
}

/* Reviews Section */
.reviews-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.reviews-section h3, .reviews-section h4 {
    margin-bottom: 1rem;
    color: #333;
}

.reviews-list {
    margin-bottom: 2rem;
    max-height: 300px;
    overflow-y: auto;
}

.review {
    padding: 1rem;
    background: white;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.review-rating {
    color: #FFD700;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.review-comment {
    color: #555;
    margin: 0.5rem 0;
    line-height: 1.5;
}

.review-date {
    color: #999;
    font-size: 0.85rem;
    margin: 0;
}

.add-review {
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
}

.rating-input {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
    font-size: 2rem;
}

.star {
    cursor: pointer;
    color: #ddd;
    transition: color 0.2s;
    user-select: none;
}

.star:hover {
    color: #FFD700;
}

.add-review textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 1rem;
}

.error {
    color: #e74c3c;
}

/* Live Events Section */
.live-events-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.live-events-section h3, .live-events-section h4 {
    margin-bottom: 1rem;
    color: #333;
}

.events-list {
    margin-bottom: 2rem;
}

.event-card {
    padding: 1rem;
    background: white;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #ffc107;
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.event-header strong {
    color: #333;
    font-size: 1rem;
}

.event-details {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.8;
}

.event-details div {
    margin-bottom: 0.25rem;
}

.add-event {
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

.add-event h4 {
    margin-top: 0;
    color: #333;
}

.delete-event-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.delete-event-btn:hover {
    background: #c0392b;
}

/* Event Registration Styles */
.btn-register {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s;
    width: 100%;
}

.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-unregister {
    padding: 0.75rem 1.5rem;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s;
    width: 100%;
}

.btn-unregister:hover {
    background: #5a6268;
}

.registered-badge {
    background: #28a745;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.event-card.registered {
    border-left-color: #28a745;
    background: #f8fff9;
}
