/* ============================================
   PLEXFLIX - Reusable Components
   ============================================ */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-base);
    border: none;
    outline: none;
    text-decoration: none;
    user-select: none;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--text-primary);
}

.btn-primary:hover {
    background: var(--color-primary-light);
    transform: scale(1.02);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--color-gray-700);
}

.btn-icon {
    padding: var(--space-2);
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    width: 40px;
    height: 40px;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Content Card */
.content-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-base);
    background: var(--bg-tertiary);
    flex: 0 0 200px;
    /* Don't grow, don't shrink, base width 200px */
    width: 200px;
    min-width: 200px;
    aspect-ratio: 2 / 3;
    /* Standard poster ratio */
}

.content-card:hover {
    transform: scale(var(--card-hover-scale));
    box-shadow: var(--shadow-xl);
    z-index: 10;
}

/* Static Overlay (When Hover Cards are disabled) */
.card-overlay-static {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.content-card:hover .card-overlay-static {
    opacity: 1;
}

.card-overlay-static h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.card-info {
    z-index: 2;
}

.content-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.content-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-4);
    background: var(--gradient-card);
    opacity: 0;
    transition: var(--transition-base);
}

.content-card:hover .content-card-overlay {
    opacity: 1;
}

/* Card Action Buttons - Hidden by default, show on hover */
.card-actions {
    display: flex;
    gap: var(--space-2);
    opacity: 0;
    transform: translateY(10px);
    transition: all var(--duration-base) var(--ease-out);
}

.content-card:hover .card-actions {
    opacity: 1;
    transform: translateY(0);
}

/* Skeleton Loader */
.skeleton {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-shimmer);
    animation: shimmer 2s infinite;
}

.skeleton-text {
    height: 1em;
    margin-bottom: var(--space-2);
}

.skeleton-card {
    aspect-ratio: var(--card-aspect-ratio-poster);
    width: 100%;
}

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    z-index: var(--z-modal-backdrop);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: var(--z-modal);
}

/* Snackbar */
.snackbar {
    position: fixed;
    bottom: var(--space-8);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: var(--z-notification);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* Input */
.input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-base);
    transition: var(--transition-base);
}

.input:focus {
    border-color: var(--color-primary);
    background: var(--bg-elevated);
}

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

/* Glass Button */
.btn-glass {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Top 10 Badge */
.top-10-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #e50914;
    /* Netflix Red */
    color: white;
    padding: 6px 8px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    z-index: 5;
    transform: rotate(5deg);
}

.top-10-text {
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.top-10-rank {
    font-size: 1.4rem;
    font-weight: 900;
}