/* Shadcn-inspired design with warm earth tones */

:root {
  /* Warm Earth Tone Palette */
  --color-bg: #FEFCF8;
  --color-surface: #FFFFFF;
  --color-border: #E8E3DB;
  --color-text: #3D3935;
  --color-text-muted: #857A70;
  --color-primary: #A0826D;
  --color-primary-hover: #8B6F5C;
  --color-accent: #C9A88A;
  --color-error: #C86B5F;

  /* Spacing (Shadcn-style) */
  --radius: 0.5rem;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Auth Page Layout */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 3rem;
  width: 100%;
  max-width: 420px;
}

.auth-card h1 {
  font-size: 1.875rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.auth-card p {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

/* Form Elements */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

input[type="email"],
input[type="text"] {
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  transition: all 0.2s;
}

input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(160, 130, 109, 0.1);
}

input::placeholder {
  color: var(--color-text-muted);
}

/* Buttons */
button {
  width: 100%;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: white;
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

button:hover {
  background: var(--color-primary-hover);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

button.secondary:hover {
  background: var(--color-bg);
}

/* Alert Messages */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.alert-error {
  background: rgba(200, 107, 95, 0.1);
  color: var(--color-error);
  border: 1px solid rgba(200, 107, 95, 0.2);
}

.alert-success {
  background: rgba(160, 130, 109, 0.1);
  color: var(--color-primary);
  border: 1px solid rgba(160, 130, 109, 0.2);
}

/* Library Page */
.header {
  padding: 2rem 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 {
  font-size: 1.875rem;
  font-weight: 600;
  color: var(--color-text);
}

.logout-btn {
  width: auto;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Section */
.section {
  margin-bottom: 4rem;
}

.section-header {
  margin-bottom: 2rem;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

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

.video-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s;
  cursor: pointer;
}

.video-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--color-primary);
}

.video-thumbnail {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 3rem;
}

.video-info {
  padding: 1rem;
}

.video-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.video-duration {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Video Player Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  padding: 2rem;
  overflow-y: auto;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--color-surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 1000px;
  overflow: hidden;
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
  width: auto;
  height: auto;
  line-height: 1;
}

.close-btn:hover {
  color: var(--color-text);
}

.modal-body {
  padding: 0;
}

.video-player {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
}

/* Loading State */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--color-text-muted);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--color-text-muted);
}

.empty-state svg {
  width: 4rem;
  height: 4rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .auth-card {
    padding: 2rem;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .logout-btn {
    width: 100%;
  }

  .modal {
    padding: 0;
  }

  .modal-content {
    border-radius: 0;
    max-width: 100%;
    height: 100%;
  }
}

/* Utility Classes */
.hidden {
  display: none;
}

.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: 1rem;
}
