/* =========================================================================
   Custom styles for VP Vrtić - Children's Kingdom Theme
   Childish, playful design with castles, pencils, books, princes & princesses
   ========================================================================= */

/* -------------------------------------------------------------------------
   Skip-to-content link (accessibility)
   ------------------------------------------------------------------------- */
.skip-to-content {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 9999;
    padding: 0.75rem 1.5rem;
    background-color: #FF6B35;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 0 0 0.75rem 0;
}

.skip-to-content:focus {
    position: fixed;
    left: 0;
    top: 0;
    width: auto;
    height: auto;
    overflow: visible;
}

/* -------------------------------------------------------------------------
   Focus visible outline
   ------------------------------------------------------------------------- */
*:focus-visible {
    outline: 2px solid #FF6B35;
    outline-offset: 2px;
}

/* -------------------------------------------------------------------------
   Mobile menu transitions
   ------------------------------------------------------------------------- */
.mobile-menu-panel {
    transform: translateX(100%);
    transition: transform 300ms ease-in-out;
}

.mobile-menu-open .mobile-menu-panel {
    transform: translateX(0);
}

/* -------------------------------------------------------------------------
   Floating Animations - Pencils, Books, Stars
   ------------------------------------------------------------------------- */
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-15px) rotate(3deg); }
    50% { transform: translateY(-5px) rotate(-2deg); }
    75% { transform: translateY(-20px) rotate(2deg); }
}

@keyframes floatSlow {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(-3deg); }
}

@keyframes floatReverse {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(15px) rotate(3deg); }
}

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

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

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

@keyframes wiggle {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

@keyframes drawLine {
    from { stroke-dashoffset: 100; }
    to { stroke-dashoffset: 0; }
}

@keyframes popIn {
    0% { transform: scale(0) rotate(-10deg); opacity: 0; }
    60% { transform: scale(1.15) rotate(3deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes slideInLeft {
    from { transform: translateX(-40px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(40px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes rainbow {
    0% { color: #FF6B35; }
    16% { color: #EF476F; }
    33% { color: #FFD166; }
    50% { color: #06D6A0; }
    66% { color: #2EC4B6; }
    83% { color: #1B4965; }
    100% { color: #FF6B35; }
}

.animate-float { animation: float 6s ease-in-out infinite; }
.animate-float-slow { animation: floatSlow 8s ease-in-out infinite; }
.animate-float-reverse { animation: floatReverse 7s ease-in-out infinite; }
.animate-twinkle { animation: twinkle 2s ease-in-out infinite; }
.animate-bounce { animation: bounce 2s ease-in-out infinite; }
.animate-wiggle { animation: wiggle 3s ease-in-out infinite; }
.animate-pop-in { animation: popIn 0.6s ease-out forwards; }
.animate-spin-slow { animation: spin 20s linear infinite; }
.animate-rainbow { animation: rainbow 8s linear infinite; }

.animate-delay-1 { animation-delay: 0.5s; }
.animate-delay-2 { animation-delay: 1s; }
.animate-delay-3 { animation-delay: 1.5s; }
.animate-delay-4 { animation-delay: 2s; }
.animate-delay-5 { animation-delay: 2.5s; }

/* -------------------------------------------------------------------------
   Decorative floating elements
   ------------------------------------------------------------------------- */
.floating-decoration {
    position: absolute;
    pointer-events: none;
    z-index: 1;
    font-size: 2rem;
    opacity: 0.15;
}

.floating-decoration.large {
    font-size: 3.5rem;
    opacity: 0.1;
}

.floating-decoration.medium {
    font-size: 2.5rem;
    opacity: 0.12;
}

/* Hero floating items - more visible */
.hero-floating {
    position: absolute;
    pointer-events: none;
    z-index: 1;
    opacity: 0.3;
}

/* -------------------------------------------------------------------------
   Castle turret borders (for section headers)
   ------------------------------------------------------------------------- */
.castle-border {
    position: relative;
}

.castle-border::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
    background:
        repeating-linear-gradient(
            90deg,
            #FFD166 0px, #FFD166 20px,
            transparent 20px, transparent 30px
        );
    border-radius: 4px 4px 0 0;
}

/* -------------------------------------------------------------------------
   Pencil underline effect
   ------------------------------------------------------------------------- */
.pencil-underline {
    position: relative;
    display: inline-block;
}

.pencil-underline::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, #FF6B35, #FFD166, #EF476F);
    border-radius: 2px;
    transform: skewX(-5deg);
}

/* -------------------------------------------------------------------------
   Storybook card style
   ------------------------------------------------------------------------- */
.storybook-card {
    position: relative;
    border-radius: 1.5rem;
    overflow: hidden;
    transition: transform 300ms ease, box-shadow 300ms ease;
    border: 3px solid transparent;
}

.storybook-card:hover {
    transform: translateY(-6px) rotate(-0.5deg);
    box-shadow: 0 20px 40px -10px rgba(255, 107, 53, 0.25);
    border-color: #FFD166;
}

.storybook-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #FF6B35, #FFD166, #EF476F, #2EC4B6, #06D6A0);
    z-index: 10;
}

/* -------------------------------------------------------------------------
   Crown decoration for headings
   ------------------------------------------------------------------------- */
.crown-heading {
    position: relative;
    display: inline-block;
}

.crown-heading::before {
    content: '👑';
    position: absolute;
    top: -1.5em;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.2em;
    animation: bounce 2s ease-in-out infinite;
}

/* -------------------------------------------------------------------------
   Prose styles (for rich text content from DB)
   ------------------------------------------------------------------------- */
.prose h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #1B4965;
    line-height: 1.3;
    position: relative;
    padding-left: 1.5rem;
}

.prose h2::before {
    content: '✏️';
    position: absolute;
    left: 0;
    top: 0;
}

.prose h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #1B4965;
    line-height: 1.4;
}

.prose h4 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: #1B4965;
}

.prose p {
    margin-bottom: 1rem;
    line-height: 1.75;
}

.prose ul {
    list-style-type: none;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.prose ul li {
    position: relative;
    padding-left: 1.5rem;
}

.prose ul li::before {
    content: '⭐';
    position: absolute;
    left: 0;
    top: 0.1em;
    font-size: 0.8em;
}

.prose ol {
    list-style-type: decimal;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.prose li {
    margin-bottom: 0.25rem;
    line-height: 1.75;
}

.prose a {
    color: #FF6B35;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 150ms ease;
}

.prose a:hover {
    color: #E55A2B;
}

.prose blockquote {
    border-left: 4px solid #FFD166;
    padding: 1rem 1rem 1rem 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #4b5563;
    background: linear-gradient(135deg, #FFF8F0, #fff);
    border-radius: 0 1rem 1rem 0;
    position: relative;
}

.prose blockquote::before {
    content: '📖';
    position: absolute;
    top: -0.8rem;
    left: 0.5rem;
    font-size: 1.2rem;
}

.prose strong {
    font-weight: 700;
}

.prose img {
    max-width: 100%;
    height: auto;
    border-radius: 1rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 3px solid #FFD166;
}

.prose img.img-float-left {
    float: left;
    margin: 0.25rem 1.5em 1em 0;
    max-width: 50%;
}

.prose img.img-float-right {
    float: right;
    margin: 0.25rem 0 1em 1.5em;
    max-width: 50%;
}

.prose img.img-center {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.prose img[style*="float: left"] {
    margin: 0.25rem 1.5em 1em 0;
}

.prose img[style*="float: right"] {
    margin: 0.25rem 0 1em 1.5em;
}

.prose img[style*="margin: 0 auto"],
.prose img[style*="margin: 1em auto"],
.prose img[style*="display: block"] {
    margin-left: auto;
    margin-right: auto;
}

.prose::after {
    content: "";
    display: table;
    clear: both;
}

@media (max-width: 640px) {
    .prose img.img-float-left,
    .prose img.img-float-right,
    .prose img[style*="float: left"],
    .prose img[style*="float: right"] {
        float: none !important;
        display: block;
        margin: 1rem auto !important;
        max-width: 100% !important;
    }
}

.prose hr {
    border: 0;
    border-top: 3px dashed #FFD166;
    margin: 2rem 0;
}

/* -------------------------------------------------------------------------
   Line clamp utilities
   ------------------------------------------------------------------------- */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* -------------------------------------------------------------------------
   Post card hover effects (storybook style)
   ------------------------------------------------------------------------- */
.post-card {
    transition: transform 300ms ease, box-shadow 300ms ease;
    border: 2px solid transparent;
}

.post-card:hover {
    transform: translateY(-4px) rotate(-0.5deg);
    box-shadow: 0 15px 30px -5px rgba(255, 107, 53, 0.2);
    border-color: #FFD166;
}

.post-card .post-card-image {
    transition: transform 300ms ease;
    overflow: hidden;
}

.post-card:hover .post-card-image img {
    transform: scale(1.05);
}

/* -------------------------------------------------------------------------
   Document card hover
   ------------------------------------------------------------------------- */
.document-card {
    transition: transform 200ms ease, box-shadow 200ms ease;
}

.document-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* -------------------------------------------------------------------------
   Smooth page transitions
   ------------------------------------------------------------------------- */
html {
    scroll-behavior: smooth;
}

/* -------------------------------------------------------------------------
   Custom scrollbar (webkit) - rainbow style
   ------------------------------------------------------------------------- */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #FFF8F0;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #FF6B35, #FFD166, #EF476F, #2EC4B6);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #E55A2B, #FFD166, #EF476F, #2EC4B6);
}

/* -------------------------------------------------------------------------
   Fade-in on scroll (IntersectionObserver)
   ------------------------------------------------------------------------- */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-up-delay-1 { transition-delay: 0.1s; }
.fade-up-delay-2 { transition-delay: 0.2s; }
.fade-up-delay-3 { transition-delay: 0.3s; }
.fade-up-delay-4 { transition-delay: 0.4s; }

/* -------------------------------------------------------------------------
   Hero animations
   ------------------------------------------------------------------------- */
@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hero-animate {
    animation: heroFadeIn 0.8s ease-out forwards;
}

.hero-animate-delay-1 { animation-delay: 0.2s; opacity: 0; }
.hero-animate-delay-2 { animation-delay: 0.4s; opacity: 0; }
.hero-animate-delay-3 { animation-delay: 0.6s; opacity: 0; }

/* -------------------------------------------------------------------------
   Quick-link card effects
   ------------------------------------------------------------------------- */
.quick-link-card {
    transition: transform 250ms ease, box-shadow 250ms ease, border-color 250ms ease;
    border: 2px solid transparent;
}

.quick-link-card:hover {
    transform: translateY(-6px) rotate(-1deg);
    box-shadow: 0 15px 35px -8px rgba(255, 107, 53, 0.25);
    border-color: #FFD166;
}

.quick-link-card .quick-link-icon {
    transition: transform 300ms ease, background-color 300ms ease, color 300ms ease;
}

.quick-link-card:hover .quick-link-icon {
    transform: scale(1.15) rotate(5deg);
    background-color: #FF6B35;
    color: white;
}

/* -------------------------------------------------------------------------
   Decorative divider (rainbow crayon line)
   ------------------------------------------------------------------------- */
.section-divider {
    width: 80px;
    height: 5px;
    background: linear-gradient(to right, #FF6B35, #FFD166, #EF476F, #2EC4B6);
    border-radius: 3px;
    position: relative;
}

.section-divider::after {
    content: '✏️';
    position: absolute;
    right: -1.5rem;
    top: -0.6rem;
    font-size: 1rem;
    animation: wiggle 2s ease-in-out infinite;
}

/* -------------------------------------------------------------------------
   News card image zoom
   ------------------------------------------------------------------------- */
.news-card-img {
    transition: transform 400ms ease;
}

.news-card:hover .news-card-img {
    transform: scale(1.05);
}

/* -------------------------------------------------------------------------
   Facility card - playful style
   ------------------------------------------------------------------------- */
.facility-card {
    position: relative;
    transition: transform 300ms ease, box-shadow 300ms ease;
    border: 2px dashed transparent;
}

.facility-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px -10px rgba(255, 107, 53, 0.2);
    border-color: #FFD166;
}

.facility-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #FF6B35, #FFD166, #EF476F);
    border-radius: 0 0 1rem 1rem;
    opacity: 0;
    transition: opacity 300ms ease;
}

.facility-card:hover::after {
    opacity: 1;
}

/* -------------------------------------------------------------------------
   Wavy section separator
   ------------------------------------------------------------------------- */
.wavy-top {
    position: relative;
}

.wavy-top::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 30px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 30'%3E%3Cpath fill='%23FFF8F0' d='M0,15 C120,30 240,0 360,15 C480,30 600,0 720,15 C840,30 960,0 1080,15 C1200,30 1320,0 1440,15 L1440,0 L0,0 Z'/%3E%3C/svg%3E") repeat-x;
    background-size: 1440px 30px;
}

/* -------------------------------------------------------------------------
   Cloud decoration
   ------------------------------------------------------------------------- */
.cloud {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.15;
}

.cloud::before,
.cloud::after {
    content: '';
    position: absolute;
    background: white;
    border-radius: 50%;
}

/* -------------------------------------------------------------------------
   Star burst (for special elements)
   ------------------------------------------------------------------------- */
.star-burst {
    position: relative;
}

.star-burst::before {
    content: '⭐';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 1.2rem;
    animation: twinkle 2s ease-in-out infinite;
}

/* -------------------------------------------------------------------------
   Rainbow text effect
   ------------------------------------------------------------------------- */
.rainbow-text {
    background: linear-gradient(90deg, #FF6B35, #EF476F, #FFD166, #06D6A0, #2EC4B6);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbowShift 4s ease infinite;
}

@keyframes rainbowShift {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

/* -------------------------------------------------------------------------
   Playful button style
   ------------------------------------------------------------------------- */
.btn-playful {
    position: relative;
    transition: all 300ms ease;
    border: 2px solid transparent;
}

.btn-playful:hover {
    transform: translateY(-3px) rotate(-1deg);
    box-shadow: 0 10px 25px -5px rgba(255, 107, 53, 0.4);
}

.btn-playful:active {
    transform: translateY(0) rotate(0deg);
}

/* -------------------------------------------------------------------------
   Doodle border
   ------------------------------------------------------------------------- */
.doodle-border {
    border: 3px dashed #FFD166;
    border-radius: 1.5rem;
}

/* -------------------------------------------------------------------------
   Stats counter - playful bounce
   ------------------------------------------------------------------------- */
.stat-card {
    transition: transform 300ms ease;
}

.stat-card:hover {
    transform: scale(1.08) rotate(-2deg);
}

.stat-card:hover .stat-number {
    animation: bounce 0.5s ease;
}

/* -------------------------------------------------------------------------
   Confetti-like dots background pattern
   ------------------------------------------------------------------------- */
.confetti-bg {
    background-image:
        radial-gradient(circle, #FF6B35 1px, transparent 1px),
        radial-gradient(circle, #FFD166 1px, transparent 1px),
        radial-gradient(circle, #EF476F 1px, transparent 1px),
        radial-gradient(circle, #2EC4B6 1px, transparent 1px),
        radial-gradient(circle, #06D6A0 1px, transparent 1px);
    background-size: 100px 100px, 80px 80px, 120px 120px, 90px 90px, 110px 110px;
    background-position: 0 0, 40px 30px, 20px 60px, 60px 10px, 80px 50px;
}
