/* =============================================
   1. :root - CSS Variables (Dark Party Theme)
   ============================================= */
:root {
  --primary-font: 'Poppins', sans-serif;
  --header-font: 'Bebas Neue', sans-serif;
  
  --primary-color: #E07A5F;
  --accent-color: #81B29A; 
  --action-color-hover: #E07A5F; 

  --background-dark: #3D405B;
  --panel-dark: #1e1e1e;
  --panel-border: #81B29A;
  
  --text-light: #F4F1DE;
  --text-medium: #8a8a8a;
  --text-dark: #1e1e1e;

  --spacing-md: 1rem;
  --spacing-sm: .5rem;
  --border-radius: .2rem;
}

/* =============================================
   2. Base & Typography Styles
   ============================================= */
body {
  font-family: var(--primary-font);
  margin: 1px;
  background-color: var(--background-dark);
  color: var(--text-light);
  overflow-x: hidden; /* Prevent horizontal scroll */
}

h1, h2, h3 {
  font-family: var(--header-font);
  color: var(--accent-color);
  font-weight: 300;
  letter-spacing: 1px;
  margin-block-start: .5em;
  margin-block-end: .5em;
}

h1 { font-size: 3rem; }

h2 { 
  font-size: 2.2rem; 
}
h3 {
  font-size: 1rem;
  margin: 0;
}

/* =============================================
   3. Layout & Screens
   ============================================= */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-sm) var(--spacing-md);
  background-color: var(--background-dark);
  border-bottom: 1px solid var(--panel-border);
  color: var(--text-light);
}

.party-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-sm) var(--spacing-md);
  background-color: var(--accent-color);
  border-bottom: 1px solid var(--panel-border);
}

.party-info h1, .party-info h2, .party-info h3 {
  margin: 0;
  color: var(--text-light);
  display: inline;
}

.party-code-display {
  font-weight: bold;
  color: var(--primary-color);
  background-color: #252525;
  padding: 5px 10px;
  letter-spacing:3px;
}

#login-screen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  text-align: center;
}

.app-container {
  padding-inline-start: var(--spacing-sm);
  padding-left: var(--spacing-md);
  padding-right: var(--spacing-md);
}

.panel { display: none; }
.panel.is-active { display: block; }

/* =============================================
   4. Component Styles
   ============================================= */

/* Buttons */
button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  background: var(--primary-color);
  color: white;
  font-family: var(--primary-font);
  font-weight: 500;
  font-size: 1rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

button:hover {
  background: var(--action-color-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--action-color-hover);
}

/* custom Google button styles */
.custom-google-button {
  background-color: white;
  color: #4285F4; /* Google Blue */
  padding: 10px 20px;
  border-radius: 5px;
  font-family: Arial, sans-serif;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  outline: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.custom-google-button:hover {
  background-color: #357ae8;
  color: white;
}

.google-icon {
     width: 18px;
     height: 18px;
     margin-right: 10px;
 }

/* Input Fields */
input {
  font-size: 1rem;
  padding: 10px;
  width: 300px;
  border: 1px solid var(--panel-border);
  border-radius: var(--border-radius);
  background-color: var(--panel-dark);
  color: var(--text-light);
}

/* Tab Buttons */
.tab-nav {
  display: flex;
  background-color: var(--panel-dark);
  padding: 0 var(--spacing-md);
  border-bottom: 1px solid var(--panel-border);
}

.tab-button {
  background-color: transparent;
  color: var(--text-medium);
  border-bottom: 3px solid transparent;
  border-radius: 0;
}
.tab-button:hover {
  background-color: var(--panel-dark);
  color: var(--action-color-hover);
  transform: none;
  box-shadow: none;
}
.tab-button.is-active {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}

/* Video Items */
.video-item {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
  padding: var(--spacing-sm);
  border-radius: var(--border-radius);
  border: 1px solid var(--panel-border);
  background-color: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease-in-out;
}
.video-item:hover {
  border-color: var(--accent-color);
  transform: scale(1.02);
}

.video-thumbnail img {
  width: 100px;
  height: 75px;
  object-fit: cover;
  border-radius: var(--border-radius);
}
.video-info { 
  flex-grow: 1; 
}
.video-info h3 { 
  font-family: var(--primary-font); 
  font-size: 1rem; 
  font-weight: 500; 
  color: var(--text-light); 
  margin: 0 0 5px 0; 
  border: none; 
}
.video-info p { 
  margin: 3px 0; 
  font-size: 0.9rem; 
  color: var(--text-light); 
  white-space: nowrap;
}
.video-actions {
  display: flex;
  white-space: nowrap;
}
.video-info em { 
  color: #6e6e6e; 
}

/* Other Components */
.user-avatar { 
  border-radius: 50%; 
  width: 40px; 
  height: 40px; 
}

.user-avatar-label {
  display: none; /* Hide by default */
}

.material-button  {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-size: 1.5rem;
  -webkit-font-feature-settings: 'liga';
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  
  /* Custom styles for the button */
  color: var(--action-color-hover);
  cursor: pointer;
  padding: 5px;
  transition: opacity 0.2s ease-in-out;
  vertical-align: top;
}

.material-button:active {
  cursor: pointer;
}

.display-toggle {
  display: none; /* Hide by default */
}

#status { 
  color: var(--text-medium); 
  font-style: italic; 
  min-height: 20px; 
}

.expando-content {
  display: none; /* Hide content by default */
  overflow: hidden; /* Prevent content from overflowing during transition */
  transition: max-height 0.3s ease-out; /* Smooth transition for expansion/collapse */
  max-height: 0; /* Set initial max-height for transition */
}

.expando-content.expanded {
  display: block; /* Show content when expanded */
  max-height: 500px; /* Adjust as needed to accommodate content */
}

.expando-trigger {
  cursor: pointer; /* Indicate clickable element */
}

/* =============================================
   5. State-Based Overrides
   ============================================= */
.display-mode .header,
.display-mode .tab-nav,
.display-mode .search-panel,
.display-mode .playlist-panel {
  display: none;
}
.display-mode .party-qr-code {
  display: block;
}
.display-mode .app-container { padding: 10; }
.display-mode .queue-panel { display: block; }


.host-view .user-avatar-container {
  position: relative;
  text-align: center;
  color: var(--primary-color);

}
.host-view .user-avatar-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
}
.host-view .display-toggle {
  display: inline-block;
  cursor: pointer;
}


/* =============================================
   6. Responsive Styles for Mobile
   ============================================= */
@media (max-width: 768px) {
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.4rem; }

  button {
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  .tab-button {
    font-size: 0.9rem;
  }

  .video-thumbnail img {
    display: none; /* Hide thumbnails on small screens */
    width: 80px;
    height: 60px;
  }

  .video-info h3 {
    font-size: 0.9rem;
  }

  .video-info p {
    font-size: 0.8rem;
  }
}

/* The drag handle icon for queue re-ordering feature */
.drag-handle {
  /* Custom styles for the handle */
  cursor: grab;
  transition: opacity 0.2s ease-in-out;
}

.drag-handle:active {
  cursor: grabbing;
}