@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;800&display=swap');

:root {
  --primary-color: #2A4365;    /* Deep Blue de la Landing */
  --secondary-color: #4299E1;  /* Modern Blue */
  --accent-gold: #F6AD55;      /* Warm Gold de la Landing */
  --bg-dark: #1A2639;          /* Fondo oscuro azulado templado */
  --bg-card: rgba(255, 255, 255, 0.04);
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-family: 'Inter', sans-serif;
}

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

body {
  background: linear-gradient(135deg, var(--primary-color) 0%, #1A202C 100%);
  font-family: var(--font-family);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

header {
  padding: 1rem 1.5rem;
  background: rgba(42, 67, 101, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 20;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-logo {
  height: 50px;
  width: auto;
}

.btn-back {
  background: transparent;
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.btn-back:hover {
  background: var(--accent-gold);
  color: var(--primary-color);
  transform: translateY(-2px);
}

.portal-container {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Authentication Card */
.auth-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem;
}

.auth-card {
  background: rgba(26, 32, 44, 0.85);
  border: 1px solid rgba(246, 173, 85, 0.2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  border-radius: 20px;
  padding: 3rem 2rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.auth-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.form-group {
  display: flex;
  flex-direction: column;
  text-align: left;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-family: var(--font-family);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(246, 173, 85, 0.2);
}

.btn-primary {
  background: var(--accent-gold);
  color: var(--primary-color);
  border: none;
  padding: 0.9rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(246, 173, 85, 0.2);
  transition: var(--transition-smooth);
}

.btn-primary:hover {
  background: #fff;
  color: var(--primary-color);
  transform: translateY(-2px);
}

/* Facebook-Style Dashboard Cover Banner */
.facebook-profile-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.fb-cover-photo {
  height: 80px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  position: relative;
}

.fb-profile-content {
  padding: 1rem 1.5rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-top: -32px;
  position: relative;
  z-index: 10;
  flex-wrap: wrap;
}

.avatar-container-fb {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.student-avatar-img-fb {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #1A202C;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.upload-avatar-overlay {
  position: absolute;
  bottom: 0;
  right: 0;
  background: var(--accent-gold);
  color: #000;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  cursor: pointer;
  border: 2px solid #1A202C;
}

.fb-user-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 250px;
}

.student-name-fb {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fb-instrument-badges {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.fb-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  padding: 1.2rem;
  background: rgba(0,0,0,0.15);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.fb-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fb-meta-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.fb-meta-value {
  font-size: 0.9rem;
  color: #fff;
  font-weight: 600;
}

.fb-meta-value.status-success {
  color: #4ade80;
}

.fb-meta-value.status-warning {
  color: var(--accent-gold);
}

.profile-actions-fb {
  display: flex;
  gap: 10px;
  align-self: center;
  margin-left: auto;
}

/* Accordion Classes Styles */
.history-container {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.accordion-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.accordion-header {
  padding: 1.2rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  font-weight: 700;
}

.accordion-header:hover {
  background: rgba(255, 255, 255, 0.04);
}

.accordion-icon {
  font-size: 0.9rem;
  color: var(--accent-gold);
  transition: transform 0.3s ease;
}

.accordion-item.active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
  background: rgba(0, 0, 0, 0.15);
}

.accordion-item.active .accordion-body {
  max-height: 1000px;
  transition: max-height 0.3s cubic-bezier(1, 0, 1, 0);
}

.accordion-content-inner {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Navigation Tabs */
.portal-tabs {
  display: flex;
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
  gap: 1.5rem;
  margin-top: 1rem;
}

.portal-tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 700;
  padding: 0.8rem 0.2rem;
  cursor: pointer;
  position: relative;
  transition: var(--transition-smooth);
}

.portal-tab-btn:hover {
  color: #fff;
}

.portal-tab-btn.active {
  color: var(--accent-gold);
}

.portal-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gold);
  box-shadow: 0 0 8px var(--accent-gold);
}

.history-detail-item {
  font-size: 0.95rem;
  color: #e2e8f0;
  line-height: 1.6;
  padding-left: 1.2rem;
  position: relative;
}

.history-detail-item::before {
  content: "•";
  color: var(--accent-gold);
  position: absolute;
  left: 0;
}

/* PDF Links & buttons inside details */
.pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(246, 173, 85, 0.12);
  color: var(--accent-gold);
  border: 1px solid rgba(246, 173, 85, 0.25);
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition-smooth);
  margin-left: 8px;
}

.pdf-btn:hover {
  background: var(--accent-gold);
  color: var(--primary-color);
}

/* Teacher Banner */
.teacher-banner {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 1.2rem;
}

.teacher-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--accent-gold);
  object-fit: cover;
}

.teacher-bubble {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.teacher-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-gold);
}

.teacher-quote {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ====== Tutorial Cards Grid ====== */
.tutorials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.2rem;
}

.tutorial-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

.tutorial-card:hover {
  border-color: rgba(246, 173, 85, 0.35);
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

.tutorial-thumb {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.tutorial-thumb img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.tutorial-card:hover .tutorial-thumb img {
  transform: scale(1.05);
}

.thumb-placeholder {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: rgba(246, 173, 85, 0.6);
}

.tutorial-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition-smooth);
}

.tutorial-card:hover .tutorial-play-overlay {
  opacity: 1;
}

.tutorial-play-overlay i {
  color: #fff;
  font-size: 2rem;
  background: rgba(246, 173, 85, 0.85);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 4px;
}

.tutorial-card-info {
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.tutorial-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  text-transform: capitalize;
  line-height: 1.3;
}

.tutorial-card-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Practice Note Section */
.practice-note-section {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.practice-note-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-gold);
  text-transform: uppercase;
}

.practice-note-textarea {
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: #fff;
  padding: 0.8rem;
  font-family: var(--font-family);
  font-size: 0.9rem;
  resize: vertical;
  min-height: 80px;
}

.practice-note-textarea:focus {
  outline: none;
  border-color: var(--accent-gold);
}

.btn-save-note {
  align-self: flex-end;
  background: rgba(246, 173, 85, 0.1);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-save-note:hover {
  background: var(--accent-gold);
  color: var(--primary-color);
}

/* Toast Message */
.toast-msg {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--primary-color);
  border: 1px solid var(--accent-gold);
  color: #fff;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  display: none;
}


/* ====== Video Modal Overlay ====== */
.video-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 25, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.video-modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.video-modal-card {
  background: #1a2332;
  border: 1px solid rgba(246, 173, 85, 0.2);
  border-radius: 20px;
  width: 100%;
  max-width: 960px;
  max-height: 90dvh;
  overflow-y: auto;
  position: relative;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 25px 50px rgba(0,0,0,0.6);
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255,255,255,0.08);
  border: none;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.modal-close-btn:hover {
  background: rgba(252, 129, 129, 0.2);
  color: #fc8181;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  text-transform: capitalize;
  padding-right: 2rem;
}

.modal-body {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
  align-items: start;
}

.modal-player-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}

.modal-player-wrapper iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

.modal-note-col {
  display: flex;
  flex-direction: column;
}

.modal-note-inner {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Responsive modal: stack on mobile */
@media (max-width: 720px) {
  .modal-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .teacher-banner {
    flex-direction: column;
    text-align: center;
  }
  .tutorials-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
