/*
    Tiedosto: kalajokinen-plugin/assets/css/style.css (versio 1.2)
    Tekijä: Markus Haapasaari / Kaupunkilehti Kalajokinen
    Kuvaus: Sivuston päärungon tyylitiedosto.
    Versio 1.2: Lisätty 3D Tilt -efektit ja tuotekohtaiset hehkut (Glows). Tehty <3 Kalajoella.
*/

/* --- 1. Variables & Reset --- */
:root {
    /* Colors */
    --bg-dark: #0a0a0c;
    --bg-dark-2: #13131f;
    --primary: #00f2ff; /* Neon Cyan */
    --primary-dim: rgba(0, 242, 255, 0.1);
    --secondary: #7000ff; /* Neon Purple */
    --accent: #ff0055; /* Neon Pink/Red */
    --text-main: #ffffff;
    --text-muted: #a0a0b0;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.15);

    /* Typography */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing & Sizing */
    --header-height: 80px;
    --container-width: 1200px;
    --border-radius: 16px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* --- 2. Background Effects --- */
.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    z-index: -2;
    animation: floatOrb 20s infinite alternate ease-in-out;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--secondary), transparent);
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--primary), transparent);
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
}

.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    pointer-events: none;
    mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
}

@keyframes floatOrb {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 100px); }
}

/* --- 3. Layout & Utilities --- */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 100px 0;
    opacity: 0;
    animation: fadeIn 0.8s forwards;
}

.text-center { text-align: center; }

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--text-main);
    font-weight: 700;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff 0%, #b0b0b0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

p.subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- 4. Header & Navigation --- */
.site-header {
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(10, 10, 12, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    transition: background 0.3s;
}

.header-inner {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.highlight {
    color: var(--primary);
    text-shadow: 0 0 15px var(--primary-dim);
}

.main-nav ul {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-muted);
    position: relative;
    padding: 5px 0;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-main);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
    box-shadow: 0 0 8px var(--primary);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

/* --- 5. Language Switcher --- */
.language-switcher {
    position: relative;
    margin-left: 20px;
    margin-right: auto; /* Push nav to right, keep lang near logo on desktop */
}

.lang-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-fast);
}

.lang-btn:hover {
    background: var(--glass-highlight);
    border-color: var(--primary);
}

.lang-dropdown {
    position: absolute;
    top: 120%;
    left: 0;
    background: rgba(19, 19, 31, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    width: 140px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition-fast);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.language-switcher:hover .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown a {
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.lang-dropdown a:hover, .lang-dropdown a.active {
    background: var(--primary-dim);
    color: var(--primary);
}

/* --- 6. Hero Section (Home) --- */
.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 80vh;
    padding-top: var(--header-height);
}

.hero-title {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #ffffff, #b0b0b0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    max-width: 900px;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 2.5rem;
}

.hero-actions {
    display: flex;
    gap: 20px;
}

/* --- 7. Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    font-family: var(--font-body);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #00a2ff);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 242, 255, 0.5);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary), #aa00ff);
    color: #fff;
    box-shadow: 0 0 20px rgba(112, 0, 255, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(112, 0, 255, 0.5);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-highlight);
    color: var(--text-main);
}

.btn-outline:hover {
    background: var(--glass-highlight);
    border-color: var(--text-main);
}

.btn.small {
    padding: 8px 20px;
    font-size: 0.85rem;
}

.btn.full-width {
    width: 100%;
}

/* --- 8. Cards & Grid (Products) --- */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    /* Lisätty perspektiivi 3D-efektiä varten */
    perspective: 1000px;
}

.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 40px;
    transition: transform 0.1s ease, box-shadow 0.2s ease, border-color 0.2s ease; /* Nopeutettu transform */
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;

    /* 3D-efektin asetukset */
    transform-style: preserve-3d;
    transform: translateZ(0); /* Hardware acceleration */
}

/* Poistetaan vanha hover-efekti, jotta JS voi hallita sitä */
.card:hover {
    border-color: var(--glass-highlight);
}

/* UUSI: Card Glow (Hehku) */
.card-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.1), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: -1;
    filter: blur(40px);
}

.card:hover .card-glow {
    opacity: 1;
}

/* Tuotekohtaiset värit */
#card-cachedeck:hover { border-color: var(--primary); }
#card-cachedeck .card-icon { color: var(--primary); }
#card-cachedeck .card-glow { background: radial-gradient(circle, rgba(0, 242, 255, 0.2), transparent 70%); }

#card-loginbuilder:hover { border-color: var(--secondary); }
#card-loginbuilder .card-icon { color: var(--secondary); }
#card-loginbuilder .card-glow { background: radial-gradient(circle, rgba(112, 0, 255, 0.2), transparent 70%); }

#card-heleppo2fa:hover { border-color: var(--accent); }
#card-heleppo2fa .card-icon { color: var(--accent); }
#card-heleppo2fa .card-glow { background: radial-gradient(circle, rgba(255, 0, 85, 0.2), transparent 70%); }

.card-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--text-main);
    text-shadow: 0 0 20px rgba(0,0,0,0.5);
    transition: color 0.3s ease;
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.card-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.card-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 25px;
    flex-grow: 1;
    transform: translateZ(5px); /* Pieni syvyys */
}

.feature-list {
    margin-bottom: 30px;
    border-top: 1px solid var(--glass-border);
    padding-top: 20px;
    transform: translateZ(5px);
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.feature-list li i {
    color: var(--primary);
    font-size: 0.8rem;
}

.card-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1;
}

/* Badge for "New" items */
.badge-new {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 0 10px rgba(255, 0, 85, 0.4);
    transform: translateZ(30px); /* Nousee selvästi irti */
}

/* --- 9. Loader --- */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    width: 100%;
}

.loader {
    width: 48px;
    height: 48px;
    border: 3px solid var(--text-muted);
    border-radius: 50%;
    display: inline-block;
    position: relative;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

.loader::after {
    content: '';
    box-sizing: border-box;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-bottom-color: var(--primary);
}

.loading-text {
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- 10. Footer --- */
.site-footer {
    border-top: 1px solid var(--glass-border);
    padding: 60px 0 30px;
    margin-top: auto;
    background: #050507;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 30px;
}

.footer-col h4 {
    color: #fff;
    margin-bottom: 10px;
}

.footer-col p {
    color: var(--text-muted);
    font-size: 0.9rem;
    max-width: 400px;
}

.author-credits {
    font-size: 0.85rem;
    opacity: 0.6;
    margin-top: 5px;
}

/* --- 11. Support / Shop Elements --- */
.support-section {
    transition: var(--transition-smooth);
}
.support-section:hover {
    border-color: var(--accent);
    box-shadow: 0 0 30px rgba(255, 0, 85, 0.1);
}

/* --- 12. Accordion / Manuals --- */
.accordion-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: var(--transition-fast);
}

.accordion-item:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.accordion-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease;
}

.accordion-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.question-text {
    padding-right: 15px;
}

.accordion-icon {
    transition: transform 0.3s ease;
    color: var(--primary);
    font-size: 0.9rem;
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(0, 0, 0, 0.2);
}

.content-inner {
    padding: 20px;
    color: var(--text-muted);
    border-top: 1px solid var(--glass-border);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* --- 13. Legal Styles --- */
.legal-card {
    border-top: 4px solid var(--glass-border); /* Default accent */
}
.legal-card:first-child { border-color: var(--primary); }
.legal-card:last-child { border-color: var(--secondary); }

.legal-content h4 {
    color: var(--text-main);
    margin-top: 25px;
    margin-bottom: 10px;
    font-size: 1.1rem;
}
.legal-content h4:first-child {
    margin-top: 0;
}
.legal-content p {
    margin-bottom: 15px;
}

/* --- 14. Responsive Design --- */
@media (max-width: 900px) {
    .main-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background: var(--bg-dark);
        padding: 40px 20px;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        border-top: 1px solid var(--glass-border);
    }

    .main-nav.open {
        transform: translateX(0);
    }

    .main-nav ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .main-nav ul li {
        width: 100%;
    }

    .nav-link {
        font-size: 1.2rem;
        display: block;
        width: 100%;
    }

    .mobile-menu-toggle {
        display: block;
        margin-left: 20px;
    }

    .language-switcher {
        margin-left: auto;
        margin-right: 0;
    }

    .hero-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 600px) {
    .header-inner {
        padding: 0 15px;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
    }

    .footer-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .right-align {
        text-align: center;
    }
}
