/**
 * ═══════════════════════════════════════════════════════════════
 * VEAM MUSIC - BASE STYLES
 * ═══════════════════════════════════════════════════════════════
 *
 * Reset, base typography, and global styles
 */

/* ── CSS RESET ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html,
body {
  height: 100%;
  height: 100dvh; /* Dynamic viewport height for mobile */
  overflow: hidden;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.5;
}

/* ── SCROLLBAR STYLING ── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--surface-secondary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  color: var(--text-primary);
}

h1 {
  font-size: var(--text-display-medium);
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: var(--text-body-large);
}

h4 {
  font-size: var(--text-body-medium);
}

p {
  margin: 0;
  color: var(--text-secondary);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-light);
}

/* ── BUTTONS ── */
button {
  font-family: var(--font-primary);
  font-size: var(--text-body-medium);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  transition: all var(--transition-fast);
}

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

/* ── INPUTS ── */
input,
textarea,
select {
  font-family: var(--font-primary);
  font-size: var(--text-body-medium);
  color: var(--text-primary);
  background-color: var(--surface-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  outline: none;
  transition: border-color var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-tertiary);
}

/* ── IMAGES ── */
img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ── LISTS ── */
ul, ol {
  list-style: none;
}

/* ── APP CONTAINER ── */
#app {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── PAGE CONTAINER ── */
.page {
  position: absolute;
  top: var(--appbar-height);
  left: 0;
  right: 0;
  bottom: var(--bottom-nav-height);
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: calc(var(--mini-player-height) + 16px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.page.active {
  opacity: 1;
  visibility: visible;
  z-index: var(--z-base);
}

/* ── MATERIAL SYMBOLS ICONS ── */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  user-select: none;
  vertical-align: middle;
}

/* ── SAFE AREA INSETS (for mobile notches) ── */
@supports (padding-top: env(safe-area-inset-top)) {
  .safe-top {
    padding-top: env(safe-area-inset-top);
  }

  .safe-bottom {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .safe-left {
    padding-left: env(safe-area-inset-left);
  }

  .safe-right {
    padding-right: env(safe-area-inset-right);
  }
}

/* ── LOADING SPINNER ── */
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--surface-secondary);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── SKELETON LOADING ── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-primary) 25%,
    var(--surface-secondary) 50%,
    var(--surface-primary) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

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

/* ── UTILITY ANIMATIONS ── */
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slide-up {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slide-down {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.fade-in {
  animation: fade-in var(--transition-normal) var(--ease-out);
}

.slide-up {
  animation: slide-up var(--transition-normal) var(--ease-out);
}

.slide-down {
  animation: slide-down var(--transition-normal) var(--ease-out);
}

/* ── RESPONSIVE UTILITIES ── */
@media (min-width: 768px) {
  .mobile-only {
    display: none !important;
  }
}

@media (max-width: 767px) {
  .desktop-only {
    display: none !important;
  }
}
