/* Storytime - YouTube Music Inspired Dark Theme */

/* ===== Custom Properties ===== */
:root {
    --color-bg-dark: #1a1a1a;
    --color-bg-darker: #0f0f0f;
    --color-bg-card: #252525;
    --color-bg-hover: #2d2d2d;
    --color-primary: #ec4899;
    --color-primary-dark: #db2777;
    --color-primary-light: #f472b6;
    --color-pink: #ec4899;
    --color-pink-dark: #db2777;
    --color-pink-light: #f472b6;
    --color-gray: #4a5568;
    --color-gray-light: #a0aec0;
    --color-text-primary: #f7fafc;
    --color-text-secondary: #cbd5e0;
    --color-border: #374151;
    --top-bar-height: 56px;
    --bottom-nav-height: 64px;
}

* {
    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-dark);
    color: var(--color-text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===== TOP BAR ===== */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--color-bg-darker);
    border-bottom: 1px solid var(--color-border);
    height: var(--top-bar-height);
}

.top-bar-inner {
    display: flex;
    align-items: center;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    gap: 1rem;
}

.top-bar-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--color-text-primary);
    font-weight: 700;
    font-size: 1.125rem;
    flex-shrink: 0;
    min-height: 44px;
}

.logo-icon {
    display: flex;
    align-items: center;
    color: var(--color-primary);
}

.top-bar-search {
    flex: 1;
    max-width: 480px;
    display: none;
    align-items: center;
    background-color: var(--color-bg-card);
    border-radius: 8px;
    border: 1px solid var(--color-border);
    overflow: hidden;
    transition: border-color 0.2s;
}

.top-bar-inner.search-open .top-bar-search {
    display: flex;
    margin-left: auto;
}

.top-bar-inner.search-open .top-bar-logo .logo-text {
    display: none;
}

.top-bar-inner.search-open .search-toggle-btn {
    display: none;
}

.top-bar-search:focus-within {
    border-color: var(--color-primary);
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--color-text-primary);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    outline: none;
}

.search-input::placeholder {
    color: var(--color-gray-light);
}

.search-btn {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.search-btn:hover {
    color: var(--color-primary);
}

.search-close-btn {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.search-close-btn:hover {
    color: var(--color-primary);
}

.search-toggle-btn {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0.5rem;
    margin-left: auto;
    transition: color 0.2s;
}

.search-toggle-btn:hover {
    color: var(--color-primary);
}

.top-bar-user {
    flex-shrink: 0;
    text-decoration: none;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--color-primary);
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
    transition: opacity 0.2s;
}

.user-avatar:hover {
    opacity: 0.85;
}

/* Auth-only header (centered logo, no search/avatar) */
.top-bar-auth {
    justify-content: center;
}

.top-bar-auth .top-bar-logo {
    font-size: 1.5rem;
}

.top-bar-auth .logo-icon svg {
    width: 28px;
    height: 28px;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background-color: var(--color-bg-darker);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: var(--bottom-nav-height);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--color-text-secondary);
    gap: 0.2rem;
    padding: 0.5rem;
    min-width: 64px;
    min-height: 48px;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item:hover {
    color: var(--color-text-primary);
}

.bottom-nav-item.active {
    color: var(--color-primary);
}

.bottom-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.bottom-nav-icon svg {
    display: block;
}

.bottom-nav-label {
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    min-height: calc(100vh - var(--top-bar-height));
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.main-content.has-bottom-nav {
    padding-bottom: calc(var(--bottom-nav-height) + 1rem);
}

/* ===== CONTAINER ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.container-sm {
    max-width: 600px;
}

/* ===== HOME PAGE ===== */
.home-greeting {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.home-section {
    margin-bottom: 2rem;
}

.home-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.home-section-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.home-section-link {
    font-size: 0.8125rem;
    color: var(--color-primary-light);
    text-decoration: none;
    font-weight: 500;
}

.home-section-link:hover {
    color: var(--color-primary);
}

.horizontal-scroll {
    display: flex;
    gap: 0.875rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

.horizontal-scroll::-webkit-scrollbar {
    height: 0;
    display: none;
}

.horizontal-scroll .card {
    flex-shrink: 0;
    width: 150px;
    scroll-snap-align: start;
}

.horizontal-scroll .card-image {
    aspect-ratio: 1/1;
    border-radius: 0.5rem;
}

.horizontal-scroll .card-body {
    padding: 0rem 0.25rem 0.35rem;
}

.horizontal-scroll .card-title {
    font-size: 0.8125rem;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.horizontal-scroll .card-text {
    font-size: 0.6875rem;
    margin-bottom: 0;
}

/* Continue listening row item */
.continue-item {
    display: flex;
    align-items: center;
    padding: 0.625rem 0.75rem;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.continue-item:hover {
    background-color: var(--color-bg-hover);
}

.continue-item-image {
    width: 56px;
    height: 56px;
    border-radius: 0.375rem;
    object-fit: cover;
    flex-shrink: 0;
}

.continue-item-info {
    flex: 1;
    min-width: 0;
}

.continue-item-title {
    font-size: 0.9375rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.continue-item-subtitle {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-size: 0.9375rem;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
}

.btn-secondary {
    background-color: var(--color-gray);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--color-gray-light);
}

.btn-pink {
    background-color: var(--color-pink);
    color: white;
}

.btn-pink:hover {
    background-color: var(--color-pink-dark);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.5rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    color: var(--color-pink);
}

.btn-icon.active {
    color: var(--color-pink);
}

/* ===== CARDS ===== */
.card {
    background-color: var(--color-bg-card);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: transform 0.2s, background-color 0.2s;
}

.card:hover {
    transform: translateY(-2px);
}

.card-image {
    width: 100%;
    aspect-ratio: 4/5;
    object-fit: cover;
}

.card-body {
    padding: 0.75rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-text-primary);
}

.card-text {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.5rem;
}

/* Flat card (no hover lift, for list items) */
.card-flat {
    border-radius: 0.5rem;
}

.card-flat:hover {
    transform: none;
    background-color: var(--color-bg-hover);
}

/* ===== GRID ===== */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.grid-1 {
    grid-template-columns: 1fr;
}

/* ===== LIST ITEM (for story rows) ===== */
.list-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    background-color: var(--color-bg-card);
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.list-item:hover {
    background-color: var(--color-bg-hover);
}

.list-item-image {
    width: 56px;
    height: 56px;
    border-radius: 0.375rem;
    object-fit: cover;
    flex-shrink: 0;
}

.list-item-info {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-subtitle {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.25rem;
}

.list-item-trailing {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    color: var(--color-pink);
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--color-text-primary);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background-color: var(--color-bg-darker);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    color: var(--color-text-primary);
    font-size: 1rem;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-file {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background-color: var(--color-bg-darker);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    color: var(--color-text-primary);
    cursor: pointer;
}

.form-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

/* ===== DROP ZONES ===== */
.drop-zone {
    border: 2px dashed var(--color-border);
    border-radius: 0.75rem;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.drop-zone:hover {
    border-color: var(--color-primary);
    background-color: rgba(236, 72, 153, 0.05);
}

.drop-zone.drag-over {
    border-color: var(--color-primary);
    background-color: rgba(236, 72, 153, 0.1);
}

.drop-zone.has-file {
    border-color: var(--color-primary);
    border-style: solid;
}

.drop-zone input[type="file"] {
    display: none;
}

.drop-zone-icon {
    margin-bottom: 0.5rem;
    color: var(--color-gray-light);
}

.drop-zone.has-file .drop-zone-icon {
    color: var(--color-primary);
}

.drop-zone-text {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.drop-zone-text strong {
    color: var(--color-primary);
}

.drop-zone-filename {
    margin-top: 0.5rem;
    color: var(--color-primary-light);
    font-weight: 500;
    font-size: 0.9rem;
    word-break: break-all;
}

.drop-zone-preview {
    margin-top: 0.75rem;
    max-width: 200px;
    max-height: 150px;
    border-radius: 0.5rem;
    display: none;
}

.drop-zone.has-file .drop-zone-preview {
    display: inline-block;
}

/* ===== ALERTS ===== */
.alert {
    padding: 0.875rem 1.25rem;
    border-radius: 0.5rem;
    margin-bottom: 1.25rem;
}

.alert-success {
    background-color: rgba(72, 187, 120, 0.1);
    border: 1px solid rgba(72, 187, 120, 0.3);
    color: #9ae6b4;
}

.alert-error {
    background-color: rgba(245, 101, 101, 0.1);
    border: 1px solid rgba(245, 101, 101, 0.3);
    color: #fc8181;
}

/* ===== PLAYER ===== */
.player-container {
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 1rem;
}

.player-image-container {
    width: 100%;
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.player-image {
    width: 100%;
    aspect-ratio: 4/5;
    object-fit: cover;
    display: block;
}

.player-info {
    padding: 0 0.25rem;
    margin-bottom: 0.75rem;
}

.player-info-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.player-info-text {
    flex: 1;
    min-width: 0;
}

.player-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.125rem;
    color: var(--color-text-primary);
    line-height: 1.3;
}

.player-series {
    font-size: 0.875rem;
    color: var(--color-primary-light);
    margin-bottom: 0;
}

.player-controls {
    background: linear-gradient(180deg, rgba(37, 37, 37, 0.8) 0%, rgba(26, 26, 26, 0.95) 100%);
    border-radius: 1.25rem;
    padding: 1.25rem 1.25rem 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Progress Bar */
.progress-bar-container {
    padding: 0.75rem 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
}

.progress-bar-track {
    position: relative;
    width: 100%;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    transition: height 0.15s;
}

.progress-bar-container:hover .progress-bar-track,
.progress-bar-container.active .progress-bar-track {
    height: 5px;
}

/* Bookmark dot - shows where you last left off */
.progress-bar-bookmark {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 8px;
    height: 8px;
    background-color: rgba(236, 72, 153, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    display: none;
    z-index: 1;
}

.progress-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background-color: var(--color-primary);
    border-radius: 2px;
    transition: background-color 0.15s;
}

.progress-bar-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 0;
    height: 0;
    background-color: var(--color-primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.15s, height 0.15s;
    box-shadow: 0 0 6px rgba(236, 72, 153, 0.5);
}

.progress-bar-container:hover .progress-bar-thumb,
.progress-bar-container.active .progress-bar-thumb {
    width: 14px;
    height: 14px;
}

/* Time Display */
.player-time {
    display: flex;
    justify-content: space-between;
    padding: 0.125rem 0 0.75rem;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    font-variant-numeric: tabular-nums;
}

/* Transport Controls */
.transport-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.transport-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--color-text-primary);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.transport-btn:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.08);
}

.transport-btn:active {
    transform: scale(0.92);
}

.transport-btn:disabled {
    color: var(--color-gray);
    cursor: not-allowed;
    opacity: 0.4;
}

.transport-btn:disabled:hover {
    background: none;
    transform: none;
}

.transport-btn svg {
    display: block;
}

/* Play/Pause - large center button */
.transport-btn-play {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--color-pink) 0%, var(--color-pink-dark) 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(236, 72, 153, 0.35);
    margin: 0 0.5rem;
}

.transport-btn-play:hover {
    background: linear-gradient(135deg, var(--color-pink-light) 0%, var(--color-pink) 100%);
    color: white;
    box-shadow: 0 6px 28px rgba(236, 72, 153, 0.45);
    transform: scale(1.05);
}

.transport-btn-play:active {
    transform: scale(0.95);
}

/* Skip (prev/next story) buttons */
.transport-btn-skip {
    width: 44px;
    height: 44px;
    color: var(--color-text-secondary);
}

.transport-btn-skip:hover {
    color: var(--color-text-primary);
}

/* Rewind/Forward buttons */
.transport-btn-rewind,
.transport-btn-forward {
    width: 48px;
    height: 48px;
    flex-direction: column;
    gap: 0;
}

.skip-label {
    font-size: 0.5625rem;
    font-weight: 700;
    margin-top: -2px;
    line-height: 1;
}

.story-text-container {
    background-color: var(--color-bg-card);
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 1rem;
}

.story-text-toggle {
    width: 100%;
    padding: 1rem;
    background-color: var(--color-bg-card);
    border: none;
    color: var(--color-text-primary);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.story-text-toggle:hover {
    background-color: var(--color-bg-hover);
}

.story-text-content {
    padding: 0 1rem 1rem 1rem;
    color: var(--color-text-secondary);
    line-height: 1.8;
    display: none;
}

.story-text-content.show {
    display: block;
}

/* ===== TOGGLE SWITCH ===== */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--color-gray);
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--color-primary);
}

input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* Small toggle variant */
.toggle-switch-sm {
    width: 36px;
    height: 20px;
}

.toggle-switch-sm .toggle-slider:before {
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
}

.toggle-switch-sm input:checked + .toggle-slider:before {
    transform: translateX(16px);
}

/* Player toggles row */
.player-toggles {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.875rem;
    padding-top: 0.625rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ===== ACCOUNT PAGE ===== */
.account-page {
    max-width: 600px;
    margin: 0 auto;
}

.account-avatar {
    width: 72px;
    height: 72px;
    font-size: 2rem;
    margin: 0 auto 1rem;
}

.account-section {
    margin-bottom: 1.5rem;
}

.account-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
}

.account-menu-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    color: var(--color-text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.2s;
    gap: 0.75rem;
    font-size: 0.9375rem;
}

.account-menu-item:last-child {
    border-bottom: none;
}

.account-menu-item:hover {
    background-color: var(--color-bg-hover);
}

.account-menu-icon {
    width: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--color-text-secondary);
}

.account-menu-arrow {
    margin-left: auto;
    color: var(--color-text-secondary);
    font-size: 0.75rem;
}

/* ===== TABLE (Admin) ===== */
.table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--color-bg-card);
    border-radius: 0.75rem;
    overflow: hidden;
}

.table th,
.table td {
    padding: 0.875rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.table th {
    background-color: var(--color-bg-darker);
    font-weight: 600;
    color: var(--color-text-primary);
}

.table td {
    color: var(--color-text-secondary);
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover {
    background-color: var(--color-bg-hover);
}

.table-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-icon-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 0.375rem;
    background: none;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon-danger:hover {
    background-color: var(--color-pink);
    border-color: var(--color-pink);
    color: white;
}

/* ===== BADGE ===== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-purple {
    background-color: rgba(236, 72, 153, 0.2);
    color: var(--color-primary-light);
}

.badge-pink {
    background-color: rgba(236, 72, 153, 0.2);
    color: var(--color-pink-light);
}

/* ===== SPINNER ===== */
.spinner {
    border: 3px solid var(--color-bg-card);
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.py-1 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2 { padding-top: 1rem; padding-bottom: 1rem; }
.py-3 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-4 { padding-top: 2rem; padding-bottom: 2rem; }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }

.text-gray { color: var(--color-text-secondary); }
.text-purple { color: var(--color-primary-light); }
.text-pink { color: var(--color-pink); }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    body {
        font-size: 0.9375rem;
    }

    .container {
        padding: 0 0.875rem;
    }

    .top-bar-inner.search-open .top-bar-search {
        max-width: none;
    }

    .player-title {
        font-size: 1.125rem;
    }

    .player-image-container {
        margin-bottom: 0.5rem;
    }

    .player-controls {
        padding: 1rem 1rem 0.75rem;
    }

    .grid-2 {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }

    .card-title {
        font-size: 1rem;
    }

    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .form-input,
    .form-textarea,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .table-actions {
        flex-direction: column;
        gap: 0.375rem;
    }

    .table-actions .btn {
        width: 100%;
    }

    .table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .btn-icon {
        min-width: 44px;
        min-height: 44px;
    }

    .transport-btn-play {
        width: 56px;
        height: 56px;
    }

    .transport-btn-play svg {
        width: 30px;
        height: 30px;
    }

    h1 {
        font-size: 1.75rem;
    }

    .home-greeting {
        font-size: 1.25rem;
    }

    .horizontal-scroll .card {
        width: 130px;
    }
}

/* ===== Mini Player ===== */
.mini-player {
    position: fixed;
    bottom: var(--bottom-nav-height);
    left: 0;
    right: 0;
    z-index: 99;
    background-color: var(--color-bg-card);
    border-top: 1px solid var(--color-border);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.mini-player-progress {
    height: 2px;
    background-color: var(--color-border);
}

.mini-player-progress-fill {
    height: 100%;
    background-color: var(--color-primary);
    width: 0%;
    transition: width 0.25s linear;
}

.mini-player-content {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 12px;
    cursor: pointer;
}

.mini-player-image {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.mini-player-info {
    flex: 1;
    min-width: 0;
}

.mini-player-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-player-series {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-player-btn {
    background: none;
    border: none;
    color: var(--color-text-primary);
    padding: 8px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-player-btn:active {
    opacity: 0.7;
}

/* Adjust main content padding when mini-player is visible */
body.has-mini-player .main-content.has-bottom-nav {
    padding-bottom: calc(var(--bottom-nav-height) + 58px + 1rem);
}

