/* ================= KIDS RAINBOW UI STYLES ================= */

:root{
    --rainbow-gradient: linear-gradient(90deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3, #54a0ff, #5f27cd);
    --rainbow-loop: linear-gradient(90deg, #ff6b6b 0%, #feca57 20%, #48dbfb 40%, #ff9ff3 60%, #54a0ff 80%, #5f27cd 90%, #ff6b6b 100%);
    --rainbow-animation: rainbow-flow 8s linear infinite;
    --kids-bg: linear-gradient(135deg, #fff5f5 0%, #fff9e6 25%, #f0f9ff 50%, #fff5f5 75%, #fff9e6 100%);
    --kids-text: #2d3436;
    --kids-accent: #ff6b6b;
    --kids-secondary: #48dbfb;
    --kids-tertiary: #feca57;
    --kids-purple: #5f27cd;
    --kids-pink: #ff9ff3;
}

/* Animated Rainbow Background */
body{
    background: var(--kids-bg);
    background-size: 400% 400%;
    animation: gradient-bg 15s ease infinite;
    color: var(--kids-text);
    position: relative;
    overflow-x: hidden;
}

body::before{
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 107, 107, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(72, 219, 251, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(254, 202, 87, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 60% 60%, rgba(255, 159, 243, 0.1) 0%, transparent 50%);
    animation: rainbow-move 10s ease infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes gradient-bg{
    0%{ background-position: 0% 50%; }
    50%{ background-position: 100% 50%; }
    100%{ background-position: 0% 50%; }
}

@keyframes rainbow-move{
    0%{ transform: translateX(0) translateY(0); }
    25%{ transform: translateX(8px) translateY(-8px); }
    50%{ transform: translateX(-8px) translateY(8px); }
    75%{ transform: translateX(8px) translateY(8px); }
    100%{ transform: translateX(0) translateY(0); }
}

@keyframes rainbow-flow{
    from{ background-position: 0% 50%; }
    to{ background-position: 300% 50%; }
}

/* Navbar Styling */
header{
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-bottom: 3px solid;
    border-image: var(--rainbow-gradient);
    border-image-slice: 1;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

header::after{
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -3px;
    height: 3px;
    background: var(--rainbow-loop);
    background-size: 100% 100%;
}

.logo h1,
.logo span,
nav a{
    background: var(--rainbow-gradient);
    -webkit-background-clip: text;
    color: transparent;
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

nav a{
    position: relative;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

nav a::before{
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--rainbow-gradient);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

nav a:hover::before,
nav a.active::before{
    width: 80%;
}

nav a:hover,
nav a.active{
    transform: translateY(-2px) scale(1.03);
    filter: saturate(1.3);
    background: var(--rainbow-gradient);
    -webkit-background-clip: text;
    color: transparent;
}

/* Buttons */
.subscribe-btn,
.main-btn,
.library-btn,
.contact-form button{
    background: var(--rainbow-gradient);
    color: white;
    font-weight: 700;
    border: none;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.main-btn,
.library-btn,
.contact-form button{
    background: var(--rainbow-gradient);
    background-size: 100% 100%;
    animation: none;
}

.subscribe-btn:hover,
.main-btn:hover,
.library-btn:hover,
.contact-form button:hover{
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5);
    filter: saturate(1.2);
}

.subscribe-btn:active,
.main-btn:active,
.library-btn:active,
.contact-form button:active{
    transform: none;
}

.subscribe-btn,
.main-btn,
.library-btn,
.contact-form button{
    background: var(--rainbow-loop);
    background-size: 300% 100%;
    animation: rainbow-flow 8s linear infinite;
}

.main-btn,
.library-btn,
.contact-form button{
    background: var(--rainbow-gradient);
    background-size: 100% 100%;
    animation: none;
}


.subscribe-btn:hover,
.main-btn:hover,
.library-btn:hover,
.contact-form button:hover{
    transform: none;
    filter: saturate(1.35);
}

/* Hero Section */
.hero h2{
    background: var(--rainbow-gradient);
    -webkit-background-clip: text;
    color: transparent;
    font-weight: 900;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.1);
    animation: text-pop 0.5s ease;
}

.hero p{
    color: var(--kids-text);
    font-weight: 500;
}

@keyframes text-pop{
    0%{ transform: scale(0.9); opacity: 0; }
    100%{ transform: scale(1); opacity: 1; }
}

/* Section Headers */
.section h2,
.contact-section h2,
.hero h2{
    background: var(--rainbow-gradient);
    -webkit-background-clip: text;
    color: transparent;
    font-weight: 900;
    position: relative;
    display: inline-block;
}

.section h2::after,
.contact-section h2::after{
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 4px;
    background: var(--rainbow-gradient);
    border-radius: 2px;
}

.section > h2,
.contact-section > h2{
    display: block;
    width: 100%;
    text-align: center;
}

.framed-block{
    border: 3px solid rgba(255, 107, 107, .3);
    border-image: none;
}

.discover-section{
    margin: 70px auto 0;
    padding: 36px 24px;
    text-align: center;
    border-radius: 24px;
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 10px 32px rgba(0, 0, 0, .1);
}

.discover-section h2{
    margin-bottom: 24px;
    text-align: center;
}

.discover-section .library-btn{
    margin-top: 28px;
}

/* Video Cards */
.video-card{
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 3px solid transparent;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.video-card::before{
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--rainbow-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.video-card:hover{
    transform: translateY(-15px) scale(1.03);
    box-shadow: 0 15px 40px rgba(255, 107, 107, 0.3);
    border-color: rgba(255, 107, 107, 0.3);
}

.video-title{
    background: var(--rainbow-gradient);
    -webkit-background-clip: text;
    color: transparent;
    font-weight: 700;
}

.video-card-content h3{
    background: var(--rainbow-gradient);
    -webkit-background-clip: text;
    color: transparent;
    font-weight: 700;
}

.gradient-text{
    background: var(--rainbow-gradient);
    -webkit-background-clip: text;
    color: transparent;
    font-weight: 700;
}

/* Short Video Badge */
.short-badge{
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--rainbow-gradient);
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 800;
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.4);
    z-index: 10;
}

/* New Video Badge */
.new-badge{
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.4);
    z-index: 10;
}

.library-tabs .tab-btn,
.playlist-btn{
    padding: 7px 12px;
    border-radius: 14px;
    font-size: 13px;
}

/* Library Specific Styles */
.video-container{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    padding: 40px;
}

.video-card .video-thumb{
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 15px;
    transition: transform 0.3s ease;
}

.video-card:hover .video-thumb{
    transform: scale(1.05);
}

.video-desc{
    color: var(--kids-text);
    font-weight: 500;
    line-height: 1.6;
}

.video-date{
    color: var(--kids-purple);
    font-weight: 700;
    font-size: 14px;
}

/* Forms */
.contact-form input,
.contact-form textarea{
    background: white;
    border: 2px solid #e0e0e0;
    color: var(--kids-text);
    border-radius: 15px;
    transition: all 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus{
    border-color: var(--kids-accent);
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.2);
    outline: none;
}

/* Footer */
footer{
    background: linear-gradient(135deg, #2d3436, #636e72);
    color: white;
    position: relative;
}

footer::before{
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--rainbow-gradient);
}

.social-icons a{
    background: var(--rainbow-gradient);
    -webkit-background-clip: text;
    color: transparent;
    transition: all 0.3s ease;
}

.social-icons a:hover{
    transform: translateY(-8px) scale(1.3);
    filter: drop-shadow(0 0 15px rgba(255, 107, 107, 0.6));
}

.copy{
    background: var(--rainbow-gradient);
    -webkit-background-clip: text;
    color: transparent;
    font-weight: 600;
}

/* About Page */
.about-text{
    color: var(--kids-text);
    line-height: 1.8;
    font-weight: 500;
}

.framed-block{
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 3px solid;
    border-image: var(--rainbow-gradient);
    border-image-slice: 1;
    position: relative;
    overflow: hidden;
}

.framed-block::before{
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--rainbow-gradient);
}

/* 3D Text Effect */
.three-d-text{
    text-shadow: 
        1px 1px 0 #ff6b6b,
        2px 2px 0 #feca57,
        3px 3px 0 #48dbfb,
        4px 4px 0 #ff9ff3,
        5px 5px 10px rgba(0, 0, 0, 0.3);
}

/* Interactive Elements */
.interactive-hover{
    transition: all 0.3s ease;
    cursor: pointer;
}

.interactive-hover:hover{
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Like/Share Buttons */
.video-actions{
    display: flex;
    gap: 10px;
    margin-top: 10px;
    padding: 0 12px 12px;
}

.action-btn{
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #67707a;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.2);
}

.action-btn:hover{
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    filter: saturate(1.2);
}

.action-btn.active{
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    transform: scale(1.05);
}

.action-btn i{
    font-size: 14px;
}

.action-btn svg,
.heart-icon{
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
}

.action-btn:hover,
.action-btn.active{
    transform: none;
    filter: saturate(1.4);
}

.action-btn:hover{
    color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, .15);
}

.like-btn.active .heart-icon path{
    fill: url(#rainbowHeart);
    stroke: none;
}

.like-btn.active{
    background:#fff;
    color:#67707a;
    box-shadow:none;
}

.like-btn .like-count{
    display: none;
}

.home-showcase{
    transition: opacity .45s ease, transform .45s cubic-bezier(.22,.61,.36,1);
    will-change: opacity, transform;
}

.home-showcase.showcase-refreshing{
    opacity: .25;
    transform: translateY(4px);
}

.home-showcase .video-card{
    transition: transform .3s cubic-bezier(.22,.61,.36,1), box-shadow .3s ease, border-color .3s ease, filter .3s ease;
    will-change: transform;
}

.home-showcase .video-card:hover{
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(255, 107, 107, .2);
    border-color: rgba(255, 107, 107, .3);
    filter: saturate(1.08);
}

.home-showcase .video-card:hover .video-thumb{
    transform: none;
}

.home-showcase .video-desc,
.home-showcase .video-date{
    display: none;
}

.home-grid .video-card{
    transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease, filter .28s ease;
}

.home-grid .video-card:hover{
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(255, 107, 107, .2);
    border-color: rgba(255, 107, 107, .3);
    filter: saturate(1.08);
}

.home-grid .video-card:hover .video-thumb,
.home-showcase .video-card:hover .video-thumb{
    transform: scale(1.03);
}

@media (min-width:761px){
    html body.library-page .video-card .video-desc{
        opacity:0 !important;
        transform:translateY(10px) !important;
        transition:opacity .28s ease, transform .28s ease !important;
    }
    html body.library-page .video-card.is-description-open .video-desc{
        opacity:1 !important;
        transform:translateY(0) !important;
    }
    html body.library-page .video-card:hover .video-desc{
        opacity:1 !important;
        transform:translateY(0) !important;
    }
    html body.library-page .video-card .video-date{
        opacity:0 !important;
        transform:translateY(10px) !important;
    }
}

.like-count{
    font-size: 12px;
    font-weight: 700;
}

.message-delete{
    border:0;
    border-radius:999px;
    padding:6px 10px;
    background:#ff6b6b;
    color:#fff;
    font-weight:700;
    cursor:pointer;
}
.reset-followers{margin:0 0 12px;padding:8px 14px;border:0;border-radius:999px;background:#ff6b6b;color:#fff;font-weight:700;cursor:pointer;}

/* Playlists Section */
.playlist-nav{
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 20px 0;
}

.playlist-btn{
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    background: var(--rainbow-gradient);
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.playlist-btn:hover{
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5);
}

.playlist-btn.active{
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.6);
}

/* Loading Animation */
.rainbow-loader{
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid;
    border-image: var(--rainbow-gradient);
    border-image-slice: 1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin{
    0%{ transform: rotate(0deg); }
    100%{ transform: rotate(360deg); }
}

/* Responsive Adjustments */
@media (max-width: 760px){
    .video-container{
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    .playlist-nav{
        flex-direction: column;
        align-items: center;
    }
    
    .playlist-btn{
        width: 100%;
        max-width: 300px;
    }
}

/* Floating Elements */
.floating-element{
    animation: float 3s ease-in-out infinite;
}

@keyframes float{
    0%, 100%{ transform: translateY(0); }
    50%{ transform: translateY(-10px); }
}

/* Sparkle Effect */
.sparkle{
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--rainbow-gradient);
    border-radius: 50%;
    animation: sparkle 1.5s ease-in-out infinite;
}

@keyframes sparkle{
    0%, 100%{ opacity: 0; transform: scale(0); }
    50%{ opacity: 1; transform: scale(1); }
}

/* Status Messages */
.status-ok{
    background: var(--rainbow-gradient);
    -webkit-background-clip: text;
    color: transparent;
    font-weight: 700;
}

.subscribe-status-inline{
    color: var(--kids-accent);
    font-weight: 600;
}

.follower-count{
    color: rgba(255,255,255,.95);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}
.subscribe-btn .follower-count{padding-left:8px;margin-left:2px;border-left:1px solid rgba(255,255,255,.55);}

.countdown-ribbon{
    position:fixed;
    left:0;
    bottom:0;
    z-index:1200;
    width:min(230px, calc(100vw - 28px));
    padding:12px 14px;
    text-align: center;
    cursor:pointer;
    background:#fff;
    border:0;
    border-radius:0 32px 0 0;
    overflow:hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
    transform:translateX(0);
    transition:transform .32s cubic-bezier(.22,.61,.36,1), box-shadow .25s ease, width .32s ease;
}

.countdown-ribbon::before,
.countdown-ribbon::after{
    content:'';
    position:absolute;
    pointer-events:none;
}
.countdown-ribbon::before{
    inset:0;
    z-index:0;
    border:3px solid transparent;
    border-left:0;
    border-bottom:1px solid transparent;
    border-radius:0 32px 0 0;
    background:linear-gradient(#fff,#fff) padding-box, var(--rainbow-gradient) border-box;
    background-clip:padding-box,border-box;
}
.countdown-ribbon::after{display:none;}
.countdown-ribbon > *{position:relative;z-index:1;}
.countdown-ribbon:hover{transform:translateY(0);box-shadow:0 14px 34px rgba(95,39,205,.22);}
.countdown-ribbon.countdown-expanded{transform:translateX(0);}
.countdown-ribbon.countdown-expanded:hover{transform:translateX(0);}
.countdown-kicker{font-size:10px;font-weight:900;letter-spacing:.12em;color:#5f27cd;}
.countdown-kicker span{font-weight:600;letter-spacing:0;color:#67707a;}
.countdown-preview{margin-top:4px;font-size:20px;font-weight:900;letter-spacing:.02em;color:#ff6b6b;}
.countdown-expanded .countdown-preview{display:none;}
.countdown-details{display:block;max-height:0;opacity:0;overflow:hidden;transition:max-height .32s ease, opacity .25s ease;}
.countdown-expanded{width:min(390px, calc(100vw - 28px));}
.countdown-expanded .countdown-details{max-height:180px;opacity:1;}
.countdown-title{margin:8px 0 10px;font-size:15px;font-weight:900;color:#2d3436;}
.countdown-units{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;}
.countdown-unit{min-width:68px;padding:7px 8px;border-radius:12px;background:#fff8e8;}
.countdown-unit strong{display:block;font-size:23px;color:#ff6b6b;line-height:1.1;font-weight:900;}
.countdown-unit span{font-size:10px;font-weight:800;color:#5f27cd;text-transform:uppercase;}

@media (max-width:760px){
    .countdown-ribbon{width:min(190px, calc(100vw - 24px));bottom:0;padding:9px 10px;}
    .countdown-ribbon.countdown-expanded{width:min(310px, calc(100vw - 24px));}
    .countdown-preview{font-size:16px;}
    .countdown-unit{min-width:54px;padding:5px 5px;}
    .countdown-unit strong{font-size:17px;}
    .countdown-unit span{font-size:8px;}
}

.admin-feedback{min-height:20px;font-weight:700;color:#5f27cd;}

.admin-controls{display:grid;gap:10px;}
.admin-controls input{padding:10px 12px;border:2px solid #e0e0e0;border-radius:10px;font:inherit;}
.admin-controls button{justify-self:start;padding:10px 16px;border:0;border-radius:999px;background:var(--rainbow-gradient);color:#fff;font-weight:700;cursor:pointer;}

@media (max-width:760px){
    .follower-count{font-size:11px;}
    .countdown-unit{min-width:58px;}
}

/* Empty State */
.empty{
    background: linear-gradient(#fff9e6, #fff9e6) padding-box, var(--rainbow-loop) border-box;
    background-size: auto, 300% 100%;
    border: 2px solid transparent;
    border-radius: 20px;
    color: var(--kids-text);
    font-weight: 600;
}

.curved-box{
    background: linear-gradient(white, white) padding-box, var(--rainbow-loop) border-box;
    background-size: auto, 300% 100%;
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    border: 3px solid transparent;
    animation: none;
    text-align: center;
    min-width: 300px;
}