/* ============================================================================
   COMPONENT STYLES - Buttons, Forms, Modals, Cards, Tables, Badges
   ============================================================================ */

/* ============================================================================
   MODALS
   ============================================================================ */

.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
    animation: fadeIn var(--transition-base);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(145deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    margin: auto;
    padding: var(--spacing-xl);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: slideUp var(--transition-base);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    color: var(--text-secondary);
    float: right;
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover,
.modal-close:focus {
    color: var(--text-primary);
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
    display: inline-block;
    padding: var(--spacing-md) var(--spacing-xl);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width var(--transition-base), height var(--transition-base);
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--purple) 0%, var(--purple-hover) 100%);
    color: white;
    padding: var(--spacing-md) var(--spacing-xl);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: var(--spacing-md) var(--spacing-xl);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
    display: inline-block;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--purple);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-approve {
    background: linear-gradient(135deg, var(--green) 0%, #0d9668 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-approve:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(16, 185, 129, 0.3);
}

.btn-approve:active {
    transform: translateY(0);
}

.btn-reject {
    background: linear-gradient(135deg, var(--red) 0%, #dc2626 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-reject:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(239, 68, 68, 0.3);
}

.btn-reject:active {
    transform: translateY(0);
}

.btn-delete {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.btn-delete:hover {
    background: var(--red);
    color: white;
    border-color: var(--red);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-delete:active {
    transform: translateY(0);
}

.btn-login {
    width: 100%;
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, var(--purple) 0%, var(--purple-hover) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-md);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-login:active {
    transform: translateY(0);
}

/* ============================================================================
   FORMS
   ============================================================================ */

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

textarea {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    resize: vertical;
    background: var(--bg-primary);
    color: var(--text-primary);
}

textarea:focus {
    outline: none;
    border-color: var(--purple);
}

input[type="text"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all var(--transition-fast);
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    transform: translateY(-1px);
}

input:hover,
select:hover {
    border-color: var(--purple-light);
}

input[type="number"]::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Checkbox Styles */
.tag-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.favorite-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    border: 2px solid var(--yellow);
}

.favorite-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--yellow);
}

.favorite-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--yellow);
}

.favorite-star {
    font-size: 1.2rem;
    margin-right: 0.25rem;
}

/* Tag Selection */
.tag-select {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

/* ============================================================================
   CARDS
   ============================================================================ */

/* Generic Card */
.card {
    background: linear-gradient(145deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Clip Cards */
.clip-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
    position: relative;
}

.clip-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--radius-lg);
    padding: 2px;
    background: linear-gradient(135deg, var(--purple) 0%, var(--orange) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.clip-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.clip-card:hover::before {
    opacity: 1;
}

.clip-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    background: #000;
}

.clip-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.clip-thumbnail .no-thumbnail {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-secondary);
}

.duration {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.clip-info {
    padding: 1rem;
}

.clip-info h3 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.clip-info h3 a {
    color: var(--text-primary);
    text-decoration: none;
}

.clip-info h3 a:hover {
    color: var(--purple);
}

.broadcaster {
    color: var(--purple);
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.haus-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.haus-badge.haus-menschen { background: rgba(74, 144, 217, 0.25); color: #4a90d9; }
.haus-badge.haus-zwerge { background: rgba(201, 162, 39, 0.25); color: #c9a227; }
.haus-badge.haus-nachtelfen { background: rgba(123, 104, 238, 0.25); color: #7b68ee; }
.haus-badge.haus-gnome { background: rgba(231, 76, 60, 0.25); color: #e74c3c; }
.haus-badge.haus-unassigned { background: rgba(100, 100, 100, 0.25); color: #888; }

.meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.clip-card-notes {
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-left: 3px solid var(--orange);
    border-radius: 4px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--orange);
}

.clip-card-notes strong {
    margin-right: 0.25rem;
}

/* Stat Cards */
.stat-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
}

.stat-card h3 {
    margin-bottom: 1rem;
    color: var(--purple);
}

.stat-list {
    list-style: none;
}

.stat-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.stat-list li:last-child {
    border-bottom: none;
}

/* ============================================================================
   TABLES
   ============================================================================ */

.data-table {
    width: 100%;
    background: var(--bg-secondary);
    border-collapse: collapse;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.data-table th {
    background: linear-gradient(135deg, var(--purple) 0%, var(--purple-hover) 100%);
    color: white;
    padding: var(--spacing-lg) var(--spacing-md);
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: var(--spacing-lg) var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

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

.data-table tbody tr {
    transition: all var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-tertiary);
    transform: scale(1.01);
    box-shadow: var(--shadow-sm);
}

/* ============================================================================
   TAGS & BADGES
   ============================================================================ */

.tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.tag {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.status-badge:hover {
    transform: scale(1.05);
}

.status-new {
    background: var(--blue);
    color: white;
}

.status-approved {
    background: var(--green);
    color: white;
}

.status-rejected {
    background: var(--red);
    color: white;
}

.status-used {
    background: var(--purple);
    color: white;
}

.status-in_bearbeitung {
    background: #ffd700;
    color: #333;
}

.status-archive {
    background: linear-gradient(135deg, #6441a5 0%, #7c3aed 100%);
    color: white;
}

.status-manual_archive {
    background: #6c757d;
    color: white;
}

.status-pending {
    background: var(--orange);
    color: white;
}

.status-completed {
    background: var(--green);
    color: white;
}

.status-uploaded {
    background: var(--blue);
    color: white;
}

.reviewer-badge {
    background: var(--purple);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

/* ============================================================================
   TABS
   ============================================================================ */

.status-tabs {
    display: flex;
    gap: var(--spacing-sm);
    border-bottom: 2px solid var(--border-color);
}

.tab {
    padding: var(--spacing-md) var(--spacing-xl);
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-bottom: none;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    transition: all var(--transition-fast);
    font-weight: 600;
    position: relative;
}

.tab::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: transparent;
    transition: background var(--transition-fast);
}

.tab:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.tab.active {
    background: linear-gradient(145deg, var(--purple) 0%, var(--purple-hover) 100%);
    color: white;
    border-color: var(--purple);
    box-shadow: var(--shadow-md);
}

.tab.active::after {
    background: var(--purple);
}

/* ============================================================================
   FILTER SECTION
   ============================================================================ */

.filter-section {
    background: linear-gradient(145deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-xl);
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
}

.filter-section:hover {
    box-shadow: var(--shadow-lg);
}

.filter-section h3 {
    margin-bottom: 1rem;
    color: var(--purple);
    font-size: 1.125rem;
}

.filter-form {
    width: 100%;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    flex: 1 1 200px;
    min-width: 180px;
}

.filter-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.filter-group select,
.filter-group input[type="number"] {
    padding: 0.625rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9375rem;
    transition: border-color 0.2s;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.filter-group select:focus,
.filter-group input[type="number"]:focus {
    outline: none;
    border-color: var(--purple);
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex: 1 1 100%;
    flex-wrap: wrap;
}

/* ============================================================================
   ERROR MESSAGE
   ============================================================================ */

.error-message {
    background: var(--bg-tertiary);
    color: var(--red);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    border: 2px solid var(--red);
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.hidden {
    display: none !important;
}

.clip-checkbox {
    display: none;
}

.inline-form {
    display: inline-block;
}

.thumbnail-small {
    max-width: 100px;
}

/* ============================================================================
   RESPONSIVE COMPONENT STYLES
   ============================================================================ */

/* Tablets and smaller */
@media (max-width: 1024px) {
    .clip-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

/* Mobile devices */
@media (max-width: 768px) {
    /* Status Tabs - Horizontal scroll */
    .status-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
        gap: var(--spacing-sm);
        padding-bottom: var(--spacing-xs);
    }

    .status-tabs::-webkit-scrollbar {
        display: none;
    }

    .tab {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: 0.875rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Clip Grid - Single column for better mobile experience */
    .clip-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    /* Clip Cards - Optimized */
    .clip-card {
        border-radius: var(--radius-md);
    }

    .clip-card:hover {
        transform: translateY(-4px);
    }

    .clip-info {
        padding: var(--spacing-md);
    }

    .clip-info h3 {
        font-size: 1rem;
        margin-bottom: var(--spacing-sm);
    }

    /* Tag selection - Single column */
    .tag-select {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .tag-checkbox {
        padding: var(--spacing-md);
        background: var(--bg-tertiary);
        border-radius: var(--radius-md);
        border: 2px solid var(--border-color);
        transition: all var(--transition-fast);
    }

    .tag-checkbox:active {
        transform: scale(0.98);
    }

    /* Buttons - Smart width management */
    .btn {
        width: 100%;
        padding: var(--spacing-md);
        font-size: 1rem;
        text-align: center;
    }

    /* Action button groups */
    .btn-approve,
    .btn-reject,
    .btn-delete {
        width: 100%;
        margin-bottom: var(--spacing-sm);
    }

    /* Button groups side by side when space allows */
    .button-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-sm);
    }

    .button-group .btn {
        width: 100%;
    }

    /* Tables - Card layout on mobile */
    .data-table {
        font-size: 0.875rem;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table thead {
        display: none; /* Hide headers on mobile */
    }

    .data-table tbody {
        display: block;
    }

    .data-table tr {
        display: block;
        margin-bottom: var(--spacing-md);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: var(--spacing-md);
        background: var(--bg-secondary);
    }

    .data-table td {
        display: block;
        padding: var(--spacing-xs) 0;
        border: none;
        text-align: left;
    }

    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        display: inline-block;
        margin-right: var(--spacing-sm);
        color: var(--purple);
    }

    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .stat-card {
        padding: var(--spacing-lg);
    }

    /* Filter Section - Mobile optimized */
    .filter-section {
        padding: var(--spacing-md);
        border-radius: var(--radius-md);
    }

    .filter-row {
        gap: var(--spacing-md);
    }

    .filter-group {
        min-width: 100%;
    }

    .filter-actions {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .filter-actions .btn-primary,
    .filter-actions .btn-secondary {
        width: 100%;
    }

    /* Modal - Full screen on mobile */
    .modal-content {
        width: 95%;
        max-height: 85vh;
        padding: var(--spacing-lg);
        border-radius: var(--radius-lg);
    }

    /* Cards */
    .card {
        padding: var(--spacing-lg);
        border-radius: var(--radius-md);
    }

    /* Favorite Checkbox */
    .favorite-checkbox {
        padding: var(--spacing-md);
    }

    .favorite-label {
        font-size: 0.9375rem;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    /* Tab - More compact */
    .tab {
        padding: var(--spacing-xs) var(--spacing-md);
        font-size: 0.8125rem;
    }

    /* Clip Cards - Ultra compact */
    .clip-info {
        padding: var(--spacing-sm);
    }

    .clip-info h3 {
        font-size: 0.9375rem;
        line-height: 1.4;
    }

    .meta {
        font-size: 0.8125rem;
        flex-direction: column;
        gap: var(--spacing-xs);
    }

    .broadcaster {
        font-size: 0.875rem;
    }

    /* Duration badge */
    .duration {
        font-size: 0.75rem;
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    /* Tags - Smaller */
    .tag {
        font-size: 0.6875rem;
        padding: var(--spacing-xs);
        border-radius: var(--radius-sm);
    }

    .tags {
        gap: var(--spacing-xs);
    }

    /* Tag Checkbox - Compact */
    .tag-checkbox {
        padding: var(--spacing-sm);
        font-size: 0.875rem;
    }

    /* Buttons - Optimized padding */
    .btn {
        padding: var(--spacing-md);
        font-size: 0.9375rem;
    }

    .btn-primary,
    .btn-secondary,
    .btn-approve,
    .btn-reject,
    .btn-delete {
        font-size: 0.9375rem;
    }

    /* Filter Section - Compact */
    .filter-section {
        padding: var(--spacing-md);
    }

    .filter-section h3 {
        font-size: 1rem;
        margin-bottom: var(--spacing-sm);
    }

    .filter-group label {
        font-size: 0.8125rem;
    }

    .filter-group select,
    .filter-group input[type="number"] {
        padding: var(--spacing-sm);
        font-size: 0.875rem;
    }

    /* Tables - Card style remains */
    .data-table tr {
        padding: var(--spacing-sm);
    }

    .data-table td {
        font-size: 0.875rem;
    }

    .data-table td::before {
        font-size: 0.8125rem;
    }

    /* Stats - Compact */
    .stat-card {
        padding: var(--spacing-md);
    }

    .stat-card h3 {
        font-size: 1rem;
        margin-bottom: var(--spacing-sm);
    }

    .stat-list li {
        font-size: 0.875rem;
        padding: var(--spacing-xs) 0;
    }

    /* Status Badges - Compact */
    .status-badge {
        font-size: 0.75rem;
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .reviewer-badge {
        font-size: 0.75rem;
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    /* Modal - More space on small screens */
    .modal-content {
        width: 98%;
        max-height: 90vh;
        padding: var(--spacing-md);
    }

    /* Cards - Compact */
    .card {
        padding: var(--spacing-md);
    }

    /* Empty State - Compact */
    .empty-state {
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .empty-state p {
        font-size: 0.9375rem;
    }
}

/* Touch-friendly improvements for all mobile devices */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    /* Increase tap target sizes for touch devices */
    .btn,
    .tag-checkbox,
    .tab {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .tag-checkbox {
        padding: 0.75rem;
    }

    input[type="checkbox"] {
        min-width: 24px;
        min-height: 24px;
    }

    /* Better spacing for touch */
    .tag-select {
        gap: 1rem;
    }
}

/* ============================================================================
   COMPILATIONS GRID
   ============================================================================ */

.compilations-section {
    margin-bottom: var(--spacing-xl);
}

.compilations-section h3 {
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
}

.compilations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

/* Horizontal scroll for compilation clips modal */
.compilation-clips-modal-content #compilation-clips-container.clip-grid {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 1rem;
    padding: 1rem 0;
    -webkit-overflow-scrolling: touch;
}

/* Simplified clip cards for better performance */
.clip-card-simple {
    flex: 0 0 220px;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s ease;
}

.clip-card-simple:hover {
    border-color: var(--accent-primary);
}

.clip-simple-link {
    position: relative;
    display: block;
    text-decoration: none;
    margin-bottom: 0.5rem;
    overflow: hidden;
    border-radius: 8px;
}

.clip-simple-thumb {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.2s ease;
}

.clip-simple-link:hover .clip-simple-thumb {
    opacity: 0.9;
}

.clip-simple-title {
    font-size: 0.9rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    font-weight: 500;
    padding: 0 0.25rem;
}

.clip-simple-link .duration {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Optimize modal content size */
.compilation-clips-modal-content {
    max-width: 90vw;
    max-height: 80vh;
}

.compilation-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    position: relative;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.compilation-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 16px rgba(100, 65, 165, 0.15);
}

.compilation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--spacing-sm);
}

.compilation-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.compilation-menu {
    position: relative;
}

.menu-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
}

.menu-btn:hover {
    background: var(--bg-primary);
    color: var(--accent-primary);
}

.compilation-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 100;
    margin-top: 0.25rem;
}

.compilation-dropdown.show {
    display: block;
}

.compilation-dropdown a {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-base);
}

.compilation-dropdown a:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

.compilation-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.compilation-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.compilation-info strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Card System (Yellow/Red Cards) */
.card-system {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin: var(--spacing-md) 0;
    border: 2px solid var(--border-color);
}

.card-display {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: 1.1rem;
}

.card-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.yellow-cards {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(255, 193, 7, 0.2);
    border: 2px solid #ffc107;
    border-radius: var(--radius-sm);
    font-weight: 600;
    color: #ffc107;
}

.red-card-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(220, 53, 69, 0.2);
    border: 2px solid #dc3545;
    border-radius: var(--radius-sm);
    font-weight: 700;
    color: #dc3545;
    animation: pulse-red 1.5s ease-in-out infinite;
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(220, 53, 69, 0); }
}

.card-icon {
    font-size: 1.2em;
}

.card-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.btn-card {
    padding: 6px 12px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-base);
}

.btn-card.btn-yellow {
    background: rgba(255, 193, 7, 0.2);
    border: 2px solid #ffc107;
    color: #ffc107;
}

.btn-card.btn-yellow:hover {
    background: #ffc107;
    color: #000;
}

.btn-card.btn-red {
    background: rgba(220, 53, 69, 0.2);
    border: 2px solid #dc3545;
    color: #dc3545;
}

.btn-card.btn-red:hover {
    background: #dc3545;
    color: #fff;
}

.btn-card.btn-remove {
    background: rgba(108, 117, 125, 0.2);
    border: 2px solid #6c757d;
    color: #6c757d;
}

.btn-card.btn-remove:hover {
    background: #6c757d;
    color: #fff;
}

.btn-card.btn-share {
    background: rgba(138, 43, 226, 0.2);
    border: 2px solid var(--purple);
    color: var(--purple);
    margin-left: auto;
}

.btn-card.btn-share:hover {
    background: var(--purple);
    color: #fff;
}

.btn-card.btn-share.copied {
    background: rgba(74, 222, 128, 0.3);
    border-color: #4ade80;
    color: #4ade80;
}

/* ============================================================================
   VIDEO PLAYER / TWITCH EMBED
   ============================================================================ */

.video-player {
    margin-bottom: 1rem;
}

.embed-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.embed-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}
