
    :root {
        --primary: #8b5cf6;
        --primary-light: #a78bfa;
        --primary-dark: #7c3aed;
        --secondary: #10b981;
        --background: #0f172a;
        --surface: #1e293b;
        --surface-light: #334155;
        --text-primary: #f1f5f9;
        --text-secondary: #94a3b8;
        --text-muted: #64748b;
        --border: #475569;
        --shadow: rgba(0, 0, 0, 0.3);
        --glow: rgba(139, 92, 246, 0.2);
        --success: #10b981;
        --warning: #f59e0b;
        --danger: #ef4444;
        
        --radius-sm: 8px;
        --radius-md: 12px;
        --radius-lg: 16px;
        --radius-xl: 20px;
        
        --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        --shadow-lg: 0 10px 25px -5px var(--shadow);
        --shadow-glow: 0 0 30px var(--glow);
        --border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    @media (prefers-color-scheme: light) {
    :root {
        --border-bottom: 1px solid rgba(100, 100, 100, 0.1);
    }
    }

    #app {
        max-width: 1200px;
        margin: 0 auto;
        padding: 20px;
        display: flex;
        flex-direction: column;
    }

    .app-header {
        text-align: center;
        margin-bottom: 32px;
        padding-bottom: 20px;
        border-bottom: var(--border-bottom);
        }

    .app-header h1 {
        font-size: 2.5rem;
        font-weight: 700;
        background: linear-gradient(135deg, var(--primary), var(--secondary));
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        margin-bottom: 8px;
        letter-spacing: -0.5px;
    }

    .app-header p {
        color: var(--text-secondary);
        font-size: 1.1rem;
    }

    .player-container {
        background: var(--surface);
        border-radius: var(--radius-xl);
        padding: 24px;
        margin-bottom: 32px;
        box-shadow: var(--shadow-lg);
        border: 1px solid rgba(255, 255, 255, 0.05);
        position: relative;
        overflow: hidden;
    }

    .player-container::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 2px;
        background: linear-gradient(90deg, var(--primary), var(--secondary));
    }

    .gif-display {
        margin-bottom: 24px;
        position: relative;
        min-height: 400px;
        border-radius: var(--radius-lg);
        overflow: hidden;
        background: rgba(0, 0, 0, 0.3);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .gif-display img {
        max-width: 100%;
        max-height: 500px;
        object-fit: contain;
        border-radius: var(--radius-md);
        transition: var(--transition);
    }

    .gif-display img:hover {
        transform: scale(1.02);
    }

    .title-bar {
        text-align: center;
        padding: 16px;
        margin-bottom: 20px;
        background: rgba(255, 255, 255, 0.03);
        border-radius: var(--radius-md);
        border: 1px solid rgba(255, 255, 255, 0.05);
        position: relative;
        overflow: hidden;
    }

    .title-bar::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        width: 4px;
        background: var(--primary);
    }

    .title-text {
        font-size: 1.25rem;
        font-weight: 600;
        color: var(--text-primary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 0 20px;
    }

    .controls {
        display: flex;
        gap: 12px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .btn-gif {
        border: none;
        color: white;
        padding: 14px 28px;
        border-radius: var(--radius-md);
        cursor: pointer;
        font-size: 1rem;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        transition: var(--transition);
        min-width: 140px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }

    .btn-primary {
        background: linear-gradient(135deg, var(--primary), var(--primary-dark));
        box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    }

    .btn-secondary {
        background: linear-gradient(135deg, var(--surface-light), var(--surface));
    }

    .btn-success {
        background: linear-gradient(135deg, var(--secondary), #059669);
    }

    .btn-gif:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    }

    .btn-primary:hover:not(:disabled) {
        box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
    }

    .btn-gif:active:not(:disabled) {
        transform: translateY(0);
    }

    .btn-gif:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    .btn-icon {
        font-size: 1.2em;
        line-height: 1;
    }

    .stats-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px;
        background: rgba(255, 255, 255, 0.02);
        border-radius: var(--radius-md);
        margin-top: 20px;
        border: 1px solid rgba(255, 255, 255, 0.03);
        flex-wrap: wrap;
        gap: 12px;
    }

    .stat-item {
        display: flex;
        align-items: center;
        gap: 8px;
        color: var(--text-secondary);
        font-size: 0.9rem;
    }

    .stat-value {
        color: var(--text-primary);
        font-weight: 600;
        background: rgba(255, 255, 255, 0.05);
        padding: 4px 12px;
        border-radius: 20px;
        min-width: 60px;
        text-align: center;
    }

    .related-container {
        width: 100%;
        display: none;
    }

    .related-container.show {
        display: block;
        animation: fadeInUp 0.5s ease-out;
    }

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

    .related-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        flex-wrap: wrap;
        gap: 16px;
    }

    .related-title {
        font-size: 1.5rem;
        font-weight: 600;
    }

    .related-grid {
        width: 100%;
        transition: all 0.3s ease;
    }

    .grid-sizer {
        width: calc(25% - 12px);
    }

    .related-item {
        width: calc(25% - 12px);
        margin-bottom: 16px;
        cursor: pointer;
        border-radius: var(--radius-md);
        overflow: hidden;
        background: #fff;
        transition: var(--transition);
        border: 2px solid transparent;
        break-inside: avoid;
    }

    .related-item.is-pending {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
    
    [data-bs-theme=dark] .related-item {
            background-color: #191b1d;
        }

    .related-item:hover {
        transform: translateY(-4px);
        border-color: var(--primary);
        box-shadow: var(--shadow-glow);
    }

    .related-item img {
        width: 100%;
        height: auto;
        display: block;
        transition: var(--transition);
    }

    .related-item:hover img {
        transform: scale(1.05);
    }

    .related-item-caption {
        padding: 12px;
        font-size: 0.9rem;
        color: var(--text-secondary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .loading {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 60px;
        color: var(--text-muted);
        width: 100%;
    }

    .loading-spinner {
        width: 50px;
        height: 50px;
        border: 3px solid rgba(139, 92, 246, 0.3);
        border-radius: 50%;
        border-top-color: var(--primary);
        animation: spin 1s linear infinite;
        margin-bottom: 20px;
    }

    .loading-text {
        font-size: 1.1rem;
        letter-spacing: 2px;
    }

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

    .load-more-container {
        width: 100%;
        text-align: center;
        margin-top: 20px;
        padding: 20px 0;
        display: none;
    }

    .load-more-container.show {
        display: block;
    }

    .load-more-container .btn {
        min-width: 200px;
        margin: 0 auto;
    }

    @media (max-width: 1024px) {
        .related-item,
        .grid-sizer {
            width: calc(33.333% - 12px);
        }
    }

    @media (max-width: 768px) {
        #app {
            padding: 16px;
        }

        .app-header h1 {
            font-size: 2rem;
        }

        .player-container {
            padding: 20px;
        }

        .gif-display {
            min-height: 300px;
        }

        .gif-display img {
            max-height: 300px;
        }

        .controls {
            flex-direction: column;
            align-items: stretch;
        }

        .btn {
            width: 100%;
            min-width: unset;
        }

        .stats-bar {
            flex-direction: column;
            align-items: stretch;
        }

        .stat-item {
            justify-content: space-between;
        }

        .related-item,
        .grid-sizer {
            width: calc(50% - 8px);
            margin-bottom: 12px;
        }
    }

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

        .player-container {
            padding: 16px;
        }

        .gif-display {
            min-height: 250px;
        }

        .title-text {
            font-size: 1.1rem;
        }

        .related-item,
        .grid-sizer {
            width: 100%;
            margin-bottom: 10px;
        }
    }

    @media (prefers-color-scheme: dark) {
        :root {
            --background: #0a0a0f;
            --surface: #151520;
        }
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: scale(0.95);
        }
        to {
            opacity: 1;
            transform: scale(1);
        }
    }

    .fade-in {
        animation: fadeIn 0.5s ease-out;
    }
