/* ============================================
   OTAKIROKU - CHARACTER & VOICE ACTOR PAGES
   Matching anime detail page design
   ============================================ */

/* === LOADING & ERROR STATES === */
.loading-state,
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 40px 20px;
    background: var(--bg-deep);
}

/* Spotlight effect for loading/error */
.loading-state::before,
.error-state::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    background: radial-gradient(ellipse 100% 80% at 50% 0%, rgba(var(--primary-rgb), 0.18), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.loading-state > *,
.error-state > * {
    position: relative;
    z-index: 1;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-state p {
    color: #9ca3af;
    margin-top: 20px;
    font-size: 0.95rem;
}

.error-state svg {
    width: 72px;
    height: 72px;
    color: var(--primary);
    opacity: 0.6;
    margin-bottom: 20px;
}

.error-state h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.error-state p {
    color: #9ca3af;
    margin-bottom: 24px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--primary-glow);
}

.btn-primary svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* === SEARCH VIEW === */
.search-view {
    min-height: 100vh;
    background: var(--bg-deep);
    padding: 80px 20px 60px;
}

/* Spotlight effect for search */
.search-view::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    background: radial-gradient(ellipse 100% 80% at 50% 0%, rgba(var(--primary-rgb), 0.18), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.search-view > * {
    position: relative;
    z-index: 1;
}

.search-view .search-container {
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 60px;
}

.search-header {
    text-align: center;
    margin-bottom: 40px;
}

.search-header h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 32px;
    transition: all 0.2s;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-subtle);
}

.search-box svg {
    width: 22px;
    height: 22px;
    color: #9ca3af;
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    background: none;
    border: none;
    font-size: 1.05rem;
    color: var(--text-primary);
    outline: none;
}

.search-box input::placeholder {
    color: #9ca3af;
}

/* Search clear button */
.search-clear-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--bg-surface);
    border: none;
    border-radius: 50%;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.search-clear-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.search-clear-btn svg {
    width: 14px;
    height: 14px;
}

/* Filter Bar - matches anime page layout */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

/* Results count display */
.results-count {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 16px;
}

.count-number {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.count-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 18px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

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

/* ===== Mobile Responsive - Filter Controls ===== */
@media (max-width: 768px) {
    .search-view {
        padding: 70px 0 60px;
    }

    .search-container {
        padding: 0 12px;
    }

    .search-view .search-container {
        padding-top: 10px;
    }

    .search-header {
        margin-bottom: 20px;
    }

    .search-header h1 {
        font-size: 1.75rem;
        line-height: 1.2;
        letter-spacing: normal;
        margin-bottom: 10px;
    }

    .search-box {
        padding: 12px 16px;
        margin-bottom: 16px;
        max-width: 100%;
    }

    .search-box input {
        font-size: 16px; /* Prevent iOS zoom */
    }

    .filter-bar {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 0;
        margin-bottom: 16px;
        border-bottom: none;
    }

    .filter-tabs {
        display: flex;
        gap: 6px;
        width: 100%;
    }

    .filter-btn {
        flex: 1;
        padding: 10px 8px;
        font-size: 0.75rem;
        border-radius: 8px;
        white-space: nowrap;
        min-height: 40px;
        text-align: center;
    }

    .filter-actions {
        display: flex;
        gap: 6px;
        align-items: center;
        width: 100%;
    }

    .sort-select {
        flex: 1;
        padding: 10px 32px 10px 12px;
        font-size: 0.8rem;
        border-radius: 8px;
        min-height: 40px;
        background-position: right 10px center;
        background-size: 12px;
    }
}

@media (max-width: 480px) {
    .search-header h1 {
        font-size: 1.4rem;
    }

    .filter-btn {
        padding: 8px 6px;
        font-size: 0.7rem;
        min-height: 36px;
    }

    .sort-select {
        padding: 8px 28px 8px 10px;
        font-size: 0.75rem;
        min-height: 36px;
    }
}

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

.sort-select:hover,
.sort-select:focus {
    border-color: var(--primary);
    outline: none;
}

/* Results Grid - card layout like anime page */
.results-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 16px;
}

@media (max-width: 1400px) { .results-grid { grid-template-columns: repeat(7, 1fr); } }
@media (max-width: 1200px) { .results-grid { grid-template-columns: repeat(6, 1fr); } }
@media (max-width: 1000px) { .results-grid { grid-template-columns: repeat(5, 1fr); gap: 14px; } }
@media (max-width: 800px) { .results-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; } }
@media (max-width: 600px) { .results-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; } }
@media (max-width: 400px) { .results-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; } }

/* Results Card - poster style with overlay */
.result-card {
    position: relative;
    text-decoration: none;
    display: block;
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
    border-radius: 8px;
    overflow: hidden;
}

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

.result-card:hover {
    z-index: 10;
}

.card-poster {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: var(--bg-surface);
}

.card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.result-card:hover .card-poster img {
    transform: scale(1.08);
}

/* Info overlay at bottom of card */
.card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 10px 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 50%, transparent 100%);
}

.card-name {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 2px;
}

.result-card:hover .card-name {
    color: var(--primary);
}

.card-meta {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.7);
}

.card-meta .role-badge {
    color: var(--primary);
    font-weight: 500;
}

/* Matched anime indicator */
.card-matched {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.5);
    margin-top: 2px;
    font-style: italic;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Skeleton loading cards */
.skeleton-card {
    opacity: 1 !important;
    animation: none !important;
}

.skeleton-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--bg-surface) 0%, var(--bg-card) 50%, var(--bg-surface) 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-text {
    background: linear-gradient(90deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.1) 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-name {
    width: 80%;
    height: 14px;
    margin-bottom: 6px;
}

.skeleton-meta {
    width: 60%;
    height: 10px;
}

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

/* Empty and loading states */
.search-empty {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
    grid-column: 1 / -1;
}

.results-loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    gap: 12px;
}

/* === DETAIL VIEW (Character/VA Pages) === */
.detail-view {
    min-height: 100vh;
    background: var(--bg-deep);
}

/* Spotlight effect */
.detail-view::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    background: radial-gradient(ellipse 100% 80% at 50% 0%, rgba(var(--primary-rgb), 0.18), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.detail-view > * {
    position: relative;
    z-index: 1;
}

/* === BANNER === */
.detail-banner {
    position: relative;
    height: 350px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-surface);
}

.detail-banner.banner-blur {
    background-size: 200%;
    background-position: center;
}

.detail-banner.banner-blur::before {
    content: '';
    position: absolute;
    inset: 0;
    backdrop-filter: blur(50px);
    background: rgba(10, 10, 15, 0.3);
}

.detail-banner .banner-overlay {
    position: absolute;
    inset: 0;
    bottom: -1px;
    background: linear-gradient(to bottom,
        rgba(10, 10, 15, 0.2) 0%,
        rgba(10, 10, 15, 0.4) 50%,
        #0a0a0f 100%
    );
}

.detail-banner .back-btn {
    position: absolute;
    top: 80px;
    left: 24px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.detail-banner .back-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(-4px);
}

.detail-banner .back-btn svg {
    width: 18px;
    height: 18px;
}

/* === HEADER === */
.detail-header {
    position: relative;
    margin-top: -180px;
    z-index: 10;
    padding: 0 24px;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.header-poster {
    flex-shrink: 0;
    width: 200px;
}

.header-poster img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid var(--border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.header-info {
    flex: 1;
    padding-top: 100px;
}

.entity-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 14px;
}

.entity-badge.character-badge {
    background: var(--primary-subtle);
    color: var(--primary);
    border: 1px solid rgba(var(--primary-rgb), 0.3);
}

.entity-badge.va-badge {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.entity-title {
    font-family: var(--font-display);
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.15;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.name-variants {
    font-size: 1rem;
    color: #9ca3af;
    margin-bottom: 16px;
    font-weight: 400;
}

.entity-stats {
    display: flex;
    gap: 32px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-item .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-item .stat-label {
    font-size: 0.8rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* === BODY === */
.detail-body {
    padding: 48px 24px 80px;
}

.body-container {
    max-width: 1200px;
    margin: 0 auto;
}

.content-section {
    margin-bottom: 48px;
}

.content-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* === VOICE ACTORS GRID === */
.va-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.va-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s;
}

.va-card:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.va-card-image {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.va-card:hover .va-card-image {
    border-color: var(--primary);
}

.va-card-info {
    flex: 1;
    min-width: 0;
}

.va-card-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.va-card:hover .va-card-name {
    color: var(--primary);
}

.va-card-lang {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* === APPEARANCES GRID === */
.appearances-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.appearance-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s;
}

.appearance-card:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.appearance-cover {
    width: 75px;
    height: 107px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
}

.appearance-card:hover .appearance-cover {
    border-color: var(--primary);
}

.appearance-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.appearance-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.appearance-card:hover .appearance-title {
    color: var(--primary);
}

.appearance-meta {
    font-size: 0.8rem;
    color: #9ca3af;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.appearance-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.appearance-role {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: var(--primary-subtle);
    color: var(--primary);
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: auto;
    width: fit-content;
}

.appearance-role.supporting {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
}

/* === ROLES GRID (Voice Actor Page) === */
.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 16px;
}

.role-card {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
}

.role-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.role-character-side {
    flex: 1;
    min-width: 0;
}

.role-character-side a {
    display: flex;
    gap: 14px;
    padding: 14px;
    text-decoration: none;
    transition: background 0.2s;
    height: 100%;
}

.role-character-image {
    width: 55px;
    height: 78px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: var(--bg-surface);
}

.role-character-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.role-character-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.role-character-side a:hover .role-character-name {
    color: var(--primary);
}

.role-type {
    display: inline-flex;
    padding: 3px 8px;
    background: var(--primary-subtle);
    color: var(--primary);
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    width: fit-content;
}

.role-anime-side {
    flex: 1;
    min-width: 0;
}

.role-anime-side a {
    display: flex;
    gap: 14px;
    padding: 14px;
    text-decoration: none;
    transition: background 0.2s;
    height: 100%;
    flex-direction: row-reverse;
}

.role-anime-cover {
    width: 55px;
    height: 78px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: var(--bg-deep);
}

.role-anime-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    text-align: right;
    flex: 1;
}

.role-anime-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.role-anime-side a:hover .role-anime-title {
    color: var(--primary);
}

.role-anime-year {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
    .detail-banner {
        height: 280px;
    }

    .detail-header {
        margin-top: -140px;
    }

    .header-container {
        gap: 24px;
    }

    .header-poster {
        width: 160px;
    }

    .header-info {
        padding-top: 60px;
    }

    .entity-title {
        font-size: 2rem;
    }

    .roles-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .detail-banner {
        height: 220px;
    }

    .detail-banner .back-btn {
        top: 70px;
        left: 16px;
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .detail-header {
        margin-top: -100px;
        padding: 0 16px;
    }

    .header-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .header-poster {
        width: 140px;
    }

    .header-info {
        padding-top: 16px;
    }

    .entity-title {
        font-size: 1.75rem;
    }

    .entity-stats {
        justify-content: center;
    }

    .detail-body {
        padding: 32px 16px 60px;
    }

    .appearances-grid {
        grid-template-columns: 1fr;
    }

    .role-card {
        flex-direction: column;
    }

    .role-anime-side a {
        flex-direction: row;
    }

    .role-anime-info {
        text-align: left;
    }

    .search-view .search-container {
        padding-top: 20px;
    }

    .search-header h1 {
        font-size: 1.75rem;
    }
}

/* ============================================
   REVISION HISTORY SECTION
   ============================================ */
.revision-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.revision-history-item {
    background: var(--bg-card, rgba(255, 255, 255, 0.02));
    border: 1px solid var(--border, rgba(255, 255, 255, 0.06));
    border-radius: 8px;
    padding: 14px 16px;
    transition: all 0.15s;
}

.revision-history-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(var(--primary-rgb), 0.2);
}

.revision-item-main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.revision-action-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.revision-action-badge.action-add {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.revision-action-badge.action-edit {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.revision-user-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-primary, #fafafa);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.15s;
}

.revision-user-link:hover {
    color: var(--primary, #8b5cf6);
}

.revision-user-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
}

.revision-item-date {
    font-size: 0.8rem;
    color: var(--text-muted, #71717a);
    margin-left: auto;
}

.revision-points {
    font-size: 0.8rem;
    font-weight: 600;
    color: #22c55e;
}

.revision-changes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.revision-change-item {
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary, #a1a1aa);
}

.revision-change-more {
    font-size: 0.75rem;
    color: var(--text-muted, #71717a);
}

#revisionHistorySection .btn-load-more {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--text-secondary, #a1a1aa);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s;
}

.revision-empty,
.revision-loading {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-muted, #71717a);
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
}

#revisionHistorySection .btn-load-more:hover {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: var(--primary, #8b5cf6);
    color: var(--primary, #8b5cf6);
}

@media (max-width: 600px) {
    .revision-item-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .revision-item-date {
        margin-left: 0;
    }
}

/* ============================================
   INFINITE SCROLL - LOAD MORE TRIGGER
   ============================================ */
.load-more-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 0;
    color: var(--text-secondary, #9ca3af);
    font-size: 0.85rem;
}

.load-more-trigger .loader-spinner {
    width: 24px;
    height: 24px;
}
