/* =========================================
   MEDIA PAGE SPECIFIC STYLES
   ========================================= */

.media-page {
    /* Page-specific overrides */
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

/* Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.page-title p {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    margin: 0;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.account-select {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    padding: 10px 36px 10px 14px;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23a1a7b3' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    transition: all 0.2s;
}

.account-select:hover {
    border-color: var(--border-strong);
    background-color: var(--bg-elevated);
}

.account-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.btn-sync {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, #7c3aed 100%);
    border: none;
    border-radius: 10px;
    color: white !important;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-sync i {
    color: white !important;
    transition: transform 0.5s;
}

.btn-sync:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 4px 24px var(--accent-primary-glow);
}

.btn-sync i {
    transition: transform 0.5s;
}

.btn-sync:hover i {
    transform: rotate(180deg);
}

.btn-global {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 10px;
    color: var(--primary-200) !important;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.btn-global:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.15);
    color: white;
}

.btn-global i {
    color: #a78bfa;
    filter: drop-shadow(0 0 5px rgba(167, 139, 250, 0.5));
}

.btn-global:hover i {
    color: white;
    filter: drop-shadow(0 0 8px rgba(167, 139, 250, 0.8));
}

/* Tabs */
.tabs-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 4px;
    background: var(--glass-subtle);
    border-radius: 14px;
    border: 1px solid var(--border-subtle);
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.75rem 1.25rem;
    color: var(--text-tertiary);
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.25s ease;
}

.tab-btn:hover {
    color: var(--text-secondary);
    background: var(--glass-light);
}

.tab-btn.active {
    color: var(--text-primary);
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
}

.tab-btn.active i {
    color: var(--accent-primary);
}

.tab-btn i {
    font-size: 1em;
    transition: color 0.25s;
}

/* Media Grid Styles */
.media-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding: 0.875rem 1.25rem;
    background: var(--bg-surface);
    border-radius: 14px;
    border: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    /* Added for mobile */
    gap: 1rem;
}

.media-stats {
    display: flex;
    gap: 1.25rem;
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.media-stats .count {
    color: var(--text-primary);
    font-weight: 700;
}

.view-toggles {
    display: flex;
    gap: 4px;
}

.view-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.view-btn:hover {
    background: var(--glass-medium);
    color: var(--text-secondary);
}

.view-btn.active {
    background: var(--accent-primary-glow);
    color: var(--accent-primary);
}

.media-grid {
    display: grid;
    gap: 16px;
    justify-content: start;
}

.media-grid.small {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    justify-content: center;
}

.media-grid.medium {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.media-item {
    position: relative;
    border-radius: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.media-item:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: var(--border-strong);
}

.media-thumb {
    position: relative;
    aspect-ratio: 1;
    width: 100%;
    background: var(--bg-deep);
    overflow: hidden;
}

.media-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.01);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.media-item:hover .media-thumb img {
    transform: scale(1.08);
}

.status-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    z-index: 20;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.95);
    /* Green - active */
}

.status-badge.inactive {
    background: rgba(239, 68, 68, 0.9);
    /* Red - inactive/paused */
    color: rgba(255, 255, 255, 0.9);
}

.hover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

.media-item:hover .hover-overlay {
    opacity: 1;
}

.setup-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.media-item:hover .setup-btn {
    transform: translateY(0);
    opacity: 1;
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    box-shadow: 0 4px 15px rgba(167, 139, 250, 0.4);
}

.media-info {
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.2);
}

.media-info span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    color: #94a3b8;
}

.page-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-glass);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
}

.page-btn:hover {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
}

.media-page-wrapper {
    background: linear-gradient(180deg, var(--bg-base) 0%, var(--bg-surface) 100%) !important;
    min-height: 100vh;
    margin: -1rem -1.5rem;
    padding: 1rem 1.5rem;
}

/* Table Styles (Shared) */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-primary);
    white-space: nowrap;
    /* Prevent wrapping causing weird heights */
}

.table th {
    padding: 1rem;
    text-align: left;
    color: var(--text-tertiary);
    font-weight: 600;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.text-accent {
    color: var(--accent-secondary);
}

.text-accent:hover {
    text-decoration: underline;
}