* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    color: #E0E0E0;
}

:root {
    --background: 0 0% 100%;
    --foreground: 224 71.4% 4.1%;
    --card: 0 0% 100%;
    --card-foreground: 224 71.4% 4.1%;
    --popover: 0 0% 100%;
    --popover-foreground: 224 71.4% 4.1%;
    --primary: 262.1 83.3% 57.8%;
    --primary-foreground: 210 20% 98%;
    --secondary: 220 14.3% 95.9%;
    --secondary-foreground: 220.9 39.3% 11%;
    --muted: 220 14.3% 95.9%;
    --muted-foreground: 220 8.9% 46.1%;
    --accent: 220 14.3% 95.9%;
    --accent-foreground: 220.9 39.3% 11%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 20% 98%;
    --border: 220 13% 91%;
    --input: 220 13% 91%;
    --ring: 262.1 83.3% 57.8%;
    --radius: 0.5rem;
}

body {
    font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: transparent;
    color: #E0E0E0;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.5;
}

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

header {
    /* background: #2B2B2B; */
    padding: 30px 0px;
    /* border-radius: var(--radius); */
    /* border: 1px solid hsl(var(--border)); */
    margin-bottom: 30px;
    /* box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1); */
}

h1 {
    color: #E0E0E0;
    font-size: 2.5em;
    margin-bottom: 15px;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.last-update {
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
}

.refresh-btn {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.refresh-btn:hover {
    background: hsl(var(--primary) / 0.9);
}

.refresh-btn:active {
    scale: 0.98;
}

.channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 30px;
}

.channel-card {
    background: #2B2B2B;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.channel-card:not(.live) {
    filter: grayscale(1);
    opacity: 0.7;
}

.channel-card:not(.live):hover {
    opacity: 0.85;
}

.channel-card:hover {
    border-color: hsl(var(--ring));
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.channel-card.live {
    border: 2px solid hsl(0 72% 51%);
    background: #2B2B2B;
    box-shadow:
        0 0 20px hsla(0, 72%, 51%, 0.4),
        0 0 40px hsla(0, 72%, 51%, 0.2),
        0 4px 6px -1px rgb(0 0 0 / 0.3);
    animation: liveGlow 5s ease-in-out infinite;
}

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

    100% {
        background-position: 200% 0;
    }
}

@keyframes liveGlow {

    0%,
    100% {
        box-shadow:
            0 0 20px hsla(0, 72%, 51%, 0.4),
            0 0 40px hsla(0, 72%, 51%, 0.2),
            0 4px 6px -1px rgb(0 0 0 / 0.3);
        border-color: hsl(0 72% 51%);
    }

    50% {
        box-shadow:
            0 0 30px hsla(0, 72%, 51%, 0.6),
            0 0 60px hsla(0, 72%, 51%, 0.3),
            0 0 80px hsla(0, 72%, 51%, 0.1),
            0 4px 6px -1px rgb(0 0 0 / 0.3);
        border-color: hsl(0 72% 61%);
    }
}

.channel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 0.75rem;
}

.channel-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: #E0E0E0;
    letter-spacing: -0.025em;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    letter-spacing: 0.025em;
}

.status-badge.live {
    background: hsl(0 72% 51%);
    color: white;
    animation: liveBadgePulse 2s infinite;
    box-shadow:
        0 0 10px hsla(0, 72%, 51%, 0.5),
        0 0 20px hsla(0, 72%, 51%, 0.3);
}

.status-badge.offline {
    background: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
}

@keyframes liveBadgePulse {

    0%,
    100% {
        opacity: 1;
        box-shadow:
            0 0 10px hsla(0, 72%, 51%, 0.5),
            0 0 20px hsla(0, 72%, 51%, 0.3);
    }

    50% {
        opacity: 0.85;
        box-shadow:
            0 0 15px hsla(0, 72%, 51%, 0.7),
            0 0 30px hsla(0, 72%, 51%, 0.4);
    }
}

.channel-thumbnail {
    width: 100%;
    /* height: 180px; */
    border-radius: calc(var(--radius) - 2px);
    object-fit: cover;
    margin-bottom: 1rem;
    background: hsl(var(--muted));
    /* border: 1px solid hsl(var(--border)); */
    transition: opacity 0.3s ease;
}

.channel-thumbnail.image-retrying {
    opacity: 0.5;
    animation: retryPulse 1.5s ease-in-out infinite;
}

@keyframes retryPulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.7;
    }
}

.channel-thumbnail.channel-avatar {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 50%;
    margin: 0 auto 1rem auto;
    padding: 0;
    background: #1A1A1A;
    border: 2px solid hsl(var(--border));
    display: block;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
}

.channel-thumbnail.live-thumbnail {
    object-fit: cover;
    padding: 0;
}

.viewer-count {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: hsla(0, 72%, 51%, 0.15);
    border: 1px solid hsla(0, 72%, 51%, 0.3);
    color: hsl(0 72% 61%);
    padding: 0.375rem 0.75rem;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    backdrop-filter: blur(4px);
    box-shadow: 0 0 10px hsla(0, 72%, 51%, 0.2);
}

.video-title {
    color: #E0E0E0;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.channel-placeholder {
    width: 100%;
    height: 180px;
    background: hsl(var(--muted));
    border-radius: calc(var(--radius) - 2px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    color: hsl(var(--muted-foreground));
    margin-bottom: 1rem;
    border: 1px solid hsl(var(--border));
}

.offline-message {
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
    text-align: center;
    padding: 0.5rem 1.25rem;
}

.channel-card:not(.live) .channel-avatar {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.channel-card:not(.live):hover .channel-avatar {
    transform: scale(1.05);
    box-shadow: 0 8px 12px -2px rgb(0 0 0 / 0.4), 0 4px 6px -2px rgb(0 0 0 / 0.4);
}

.loading {
    text-align: center;
    color: #E0E0E0;
    font-size: 1.5em;
    padding: 50px;
}

footer {
    padding: 30px 0px;
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
}

/* Background pulse animation */
#main-background {
    position: fixed;
    z-index: -1;
    width: 100vw;
    height: 100vh;
    background: #1A1A1A;
    overflow: visible;
    top: 0;
    left: 0;
}

#main-background-pulse-1 {
    position: absolute;
    top: calc(50% - 200px);
    left: -200px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle at top, rgba(55, 0, 179, 1), rgba(187, 134, 252, 1), rgba(3, 218, 198, 1));
    border-radius: 50%;
    animation: background-glowPulse 50s infinite;
    box-shadow: 0 0 30px rgba(55, 0, 179, 0.6), 0 0 60px rgba(187, 134, 252, 0.6), 0 0 90px rgba(0, 255, 255, 0.6);
    opacity: 0.7;
    rotate: -45deg;
    filter: blur(120px);
}

@keyframes background-glowPulse {
    0% {
        transform: scale3d(1, 1, 1) translate3d(0, 0, 0) rotate(0deg);
    }

    20% {
        transform: scale3d(1.3, 1.3, 1) translate3d(150px, -150px, 0) rotate(15deg);
    }

    40% {
        transform: scale3d(0.95, 0.95, 1) translate3d(-150px, 150px, 0) rotate(-10deg);
    }

    60% {
        transform: scale3d(1.2, 1.2, 1) translate3d(-150px, 150px, 0) rotate(20deg);
    }

    80% {
        transform: scale3d(0.9, 0.9, 1) translate3d(-150px, 150px, 0) rotate(-5deg);
    }

    100% {
        transform: scale3d(1, 1, 1) translate3d(0, 0, 0) rotate(0deg);
    }
}

/* Webkit (Chrome, Safari, Edge) için scroll stilleri */
::-webkit-scrollbar {
    width: 2px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #7C3AED;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #7C3AED;
}

/* Firefox için scroll stilleri */
* {
    scrollbar-width: thin;
    scrollbar-color: #7C3AED transparent;
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    h1 {
        font-size: 1.875rem;
    }

    header {
        padding: 1.5rem;
    }

    .channels-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

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

    .channel-card {
        padding: 1.25rem;
    }
}