/* Piilotetaan date-inputin oletuspainike */
input[type="date"]::-webkit-calendar-picker-indicator {
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: auto;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
}

/* Tooltip tyylit */
.group {
    position: relative;
    display: inline-block;
    width: 100%;
}

.group:hover .tooltip {
    display: block !important;
    visibility: visible;
    opacity: 1;
}

.tooltip {
    position: absolute;
    z-index: 50;
    min-width: 200px;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

/* Lisätään nuoli tooltippiin */
.tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 10%;
    border-width: 0 6px 6px 6px;
    border-style: solid;
    border-color: transparent transparent #fff transparent;
}

/* Dark mode tooltip nuoli */
.dark .tooltip::before {
    border-color: transparent transparent rgb(31 41 55) transparent;
}

/* Varmistetaan tekstin värit */
.tooltip .text-black {
    color: black !important;
}

.dark .tooltip .dark\:text-gray-100 {
    color: rgb(243 244 246) !important;
}

/* Responsiiviset container-tyylit */
.container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 1024px) {
    .container {
        max-width: 1280px;
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }
}

@media (min-width: 1920px) {
    .container {
        max-width: 1800px;
    }
}

@media (min-width: 3000px) {
    .container {
        max-width: 2400px;
    }
}

/* Navigaation responsiiviset tyylit */
.nav-container {
    width: 100%;
    padding: 0.5rem;
}

@media (min-width: 1024px) {
    .nav-container {
        padding: 0.75rem 2rem;
    }
}

/* Navigaation tyylit */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.active-nav::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #4F46E5;
    transition: transform 0.3s ease;
}

/* Otsikon vaihtumisen animaatio */
.title-change {
    animation: titleFade 0.3s ease;
}

@keyframes titleFade {
    0% {
        opacity: 0;
        transform: translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobiilinavigaation tyylit */
.mobile-menu {
    display: none;
}

@media (max-width: 768px) {
    .mobile-menu {
        display: block;
    }
    
    .desktop-menu {
        display: none;
    }
    
    .mobile-menu.active {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #1f2937;
        padding: 1rem;
    }
}

/* Lataus-indikaattori */
.loading-indicator {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, #4F46E5, #818CF8);
    animation: loading 1.5s infinite ease-in-out;
    z-index: 1000;
}

.loading .loading-indicator {
    display: block;
}

@keyframes loading {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Sivun vaihtumisen animaatio */
.page-content {
    opacity: 1;
    transition: opacity 0.2s ease-in-out;
}

.loading .page-content {
    opacity: 0.6;
}

/* Virheilmoituksen animaatio */
#errorToast {
    transition: transform 0.3s ease-in-out;
}

#errorToast.translate-x-full {
    transform: translateX(100%);
}

#errorToast:not(.translate-x-full) {
    transform: translateX(0);
}

/* Takaisin ylös -painike */
#scrollToTop {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#scrollToTop.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Tummassa teemassa painikkeen värit */
.dark #scrollToTop {
    background-color: #4F46E5;
}

.dark #scrollToTop:hover {
    background-color: #4338CA;
}

/* Mobiililla pienempi painike ja eri sijainti */
@media (max-width: 640px) {
    #scrollToTop {
        bottom: 1rem;
        right: 1rem;
        padding: 0.5rem;
        font-size: 0.875rem;
    }
}
