/* YouTube Section */
.youtube {
    margin: 0;
    padding: 80px 20px; /* extra room for waves */
    text-align: center;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.9s cubic-bezier(.4, 2, .6, 1), transform 0.9s cubic-bezier(.4, 2, .6, 1);
    background-image: url('../Images/ytbg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

    /* wave setup */
    position: relative;
    overflow: hidden;
}

/* Wave separators */
.youtube::before,
.youtube::after {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 90px;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    pointer-events: none;
    z-index: 1;
}

.youtube::before {
    top: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120' preserveAspectRatio='none'><path fill='%23121212' d='M0,40 C240,60 480,80 720,80 C960,80 1200,60 1440,40 L1440,0 L0,0 Z'/></svg>");
}

.youtube::after {
    bottom: 0;
    transform: rotate(180deg);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120' preserveAspectRatio='none'><path fill='%23121212' d='M0,40 C240,60 480,80 720,80 C960,80 1200,60 1440,40 L1440,0 L0,0 Z'/></svg>");
}

@media (max-width: 768px) {
    .youtube::before,
    .youtube::after {
        height: 56px;
    }
}

.youtube.in-view {
    opacity: 1;
    transform: translateY(0);
}

.youtube h1 {
	font-size: 36px;
	margin: 0 0 40px 0;
	font-weight: 800;
	position: relative;
	display: inline-block;
	padding: 10px 18px;
	-webkit-text-fill-color: #fff; /* solid white for max contrast */
	-webkit-background-clip: initial;
	background: none;
	text-shadow: 0 2px 6px rgba(0,0,0,0.45);
}

.youtube h1::before {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 12px; /* boxy look (tweak to 6px for sharper corners) */
	background: rgba(0,0,0,0.62); /* dark backplate */
	box-shadow: 0 12px 30px rgba(0,0,0,0.58), 0 0 0 1px rgba(255,255,255,0.06);
	z-index: -1; /* sits behind the text */
}

.youtube-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    align-items: stretch;
}

.channel-info,
.latest-video {
    min-height: 340px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.channel-info {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
}

.channel-info:hover {
    border-color: rgba(246, 0, 255, 0.4);
    background: rgba(0, 0, 0, 0.45);
    transform: translateY(-5px);
}

.channel-logo {
    margin-bottom: 20px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    position: relative;
}

.channel-logo img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    transition: transform 0.3s ease;
    object-fit: cover;
    background: #181818;
    display: block;
    position: relative;
    z-index: 2;
}

.channel-logo::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 132px;
    height: 132px;
    border-radius: 50%;
    background: linear-gradient(45deg, rgba(246, 0, 255, 1), rgba(255, 136, 0, 1));
    z-index: 1;
}

.channel-logo img:hover {
    transform: scale(1.05);
}

.channel-details h2 {
    color: white;
    font-size: 24px;
    margin-bottom: 15px;
    font-weight: bold;
}

.channel-details p {
    color: #ccc;
    font-size: 16px;
    margin-bottom: 25px;
    line-height: 1.6;
}

.subscribe-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(90deg, #ff0033 0%, #ff8a00 100%);
    color: #fff;
    text-decoration: none;
    padding: 12px 26px;
    border-radius: 28px;
    font-weight: 800;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 22px rgba(255, 0, 51, 0.28);
    cursor: pointer;
}
.subscribe-btn:hover {
    background: linear-gradient(90deg, #ff4d4d 0%, #ff9c33 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(255, 0, 51, 0.36);
    color: #fff;
}

.subscribe-btn i {
    font-size: 18px;
}

.latest-video {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    padding: 30px;
    transition: all 0.3s ease;
}

.latest-video:hover {
    border-color: rgba(255, 136, 0, 0.4);
    background: rgba(0, 0, 0, 0.45);
    transform: translateY(-5px);
}

.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    margin-bottom: 20px;
    border-radius: 10px;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

.video-info h3 {
    color: white;
    font-size: 20px;
    margin-bottom: 10px;
    font-weight: bold;
}

.video-info p {
    color: #ccc;
    font-size: 16px;
    line-height: 1.6;
}

/* Recent videos grid */
.recent-videos {
    margin-top: 20px;
    text-align: left;
}

.recent-videos h4 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 12px;
}

.recent-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.video-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    aspect-ratio: 16/9;
    overflow: hidden;
    position: relative;
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.video-card:hover {
    transform: translateY(-2px);
    border-color: rgba(246, 0, 255, 0.4);
    background: rgba(246, 0, 255, 0.06);
}

.video-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-card .meta {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    color: #fff;
    font-size: 12px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.6) 100%);
    padding: 24px 8px 8px 8px;
    border-radius: 10px;
}

.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.08) 37%, rgba(255, 255, 255, 0.05) 63%);
    background-size: 400% 100%;
    animation: shimmer 1.4s ease infinite;
}

@keyframes shimmer {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: 0 0;
    }
}

@media (max-width: 768px) {
    .recent-grid {
        grid-template-columns: 1fr;
    }
}

.logo-fallback {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, rgba(246, 0, 255, 1), rgba(255, 136, 0, 1));
    color: #fff;
    font-size: 54px;
    font-weight: bold;
    margin: 0 auto 20px auto;
    box-shadow: 0 2px 16px rgba(246, 0, 255, 0.12);
    letter-spacing: 2px;
    user-select: none;
}

/* Responsive Design */
@media (max-width: 768px) {

    .youtube {
        margin: 0;
        padding: 40px 16px;
        background-attachment: scroll;
    }


    .youtube h1 {
        text-align: left;
        font-size: 28px;
    }

    .youtube-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .channel-info,
    .latest-video {
        padding: 20px;
    }

    .channel-logo img {
        width: 100px;
        height: 100px;
    }

    .channel-details h2 {
        font-size: 20px;
    }

    .channel-details p {
        font-size: 14px;
    }

    .subscribe-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .logo-fallback {
        width: 100px;
        height: 100px;
        font-size: 38px;
    }
}