/*
    * ----------------------------------------
    * 1. BASE STYLES & VARIABLES
    * ----------------------------------------
    */
:root {
    --color-1: #91D4C2;
    --color-2: #45BB89;
    --color-3: #3D82AB;
    --color-4: #003853;
    --color-link: #005BD0;

    /* Primary Accent Palette (Based on #3D82AB) */
    /*--color-primary: #3D82AB;*/ /* Medium Blue/Cerulean - Main accent color */
    --color-primary: #EEFFFA;
    /*--color-primary-light-hover: #eaf2f7;*/ /* Calculated: Very light blue tint for subtle hovers */
    --color-primary-light-hover: #f4f9fc; /* Calculated: Very light blue tint for subtle hovers */
    --color-primary-dark-border: #aab6bd; /* Calculated: Darker shade of primary for borders/accents */

    /* Background & Text Palette */
    --color-light: #f8faff;   /* Super subtle off-white main background */
    --color-dark: #003853;    /* Dark Navy/Slate for main text and header background */
    --color-card-bg: #ffffff; /* Pure white for unhighlighted cards */

    /* Neutral/Grayscale Palette */
    --color-border: #e0e0e0;          /* Soft, neutral border for large cards */
    --color-text-secondary: #444a55;  /* General card content/muted text (Can be adjusted to use one of the lighter teals, but keeping neutral for readability) */
    --color-dark-secondary: #374151;  /* Secondary titles in non-primary cards (Kept neutral for contrast with the new dark) */
    
    /* Placeholder/Inactive Elements */
    --color-placeholder-bg: #f3f4f6;  /* Background for charts/placeholders */
    --color-placeholder-text: #9ca3af; /* Text color for placeholders */
    --color-success: #10b981;         /* Green for positive metrics */
    --color-danger: #ef4444;          /* Red for warnings/churn */

    /* Spacing & Effects */
    --space-unit: 1rem;
    --shadow-subtle: 0 1px 3px 0 rgb(0 0 0 / 0.05), 0 1px 2px -1px rgb(0 0 0 / 0.05);
    --shadow-md: 0 3px 5px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --border-radius: 0.4rem;

    /* Links */
    --link-hover: #00588fa6;

    /* Social Colors */
    --color-facebook: #1877F2;
    --color-facebook-custom:#005BD0;
    --color-x-twitter: #000000;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-light);
    margin: 0;
    padding: 0;
    color: var(--color-dark);
    line-height: 1.5;
}
/* Body text inside the card link */
.card a p {
    margin-bottom: 0.5rem; 
    font-size: 0.925rem;
    line-height: 1;
}
.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 var(--space-unit);
}
h1 {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-dark);
}
h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-dark);
}

/*
    * ----------------------------------------
    * 2. LAYOUT - FLEX GRID SYSTEM
    * ----------------------------------------
    */

.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: calc(-1 * var(--space-unit));
    margin-right: calc(-1 * var(--space-unit));
    margin-bottom: calc(2 * var(--space-unit));
}

/* Base styles for all columns (Mobile-First: 100% width) */
.col {
    padding: var(--space-unit);
    width: 100%;
    box-sizing: border-box; 
}

/* Reduced padding for small price items (5-10px) */
.col.card-small {
    padding: 0.5rem;
    width: 50%; 
}

/* Custom Card Styles */
.card {
    background-color: var(--color-card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: calc(1.2 * var(--space-unit));
    border: 0px solid var(--color-border);
    height: 100%;
}
.card .card-content a {
    text-decoration: none; /* Remove underline from the whole link */
    display:inline;
    flex-direction:unset;
    padding: 0; 
    color:var(--color-link);
}
.card .card-content a:hover {
    text-decoration: underline; /* Remove underline from the whole link */
}
.card-content {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}
.ingress:hover {
    transition: all 0.3s ease; 
    transform: translateY(-2px); 
}

/* Custom Card Styles */
.chart {
    background-color: var(--color-card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    border: 0px solid var(--color-border);
}
/*
    * ----------------------------------------
    * 3. MOBILE/TABLET BREAKPOINT (sm: >= 640px)
    * ----------------------------------------
    */
@media (min-width: 640px) {
    .col.card-small {
        width: 33.33333%;
    }

    .col.card-medium {
        width: 100%;
    }
}

/*
    * ----------------------------------------
    * 4. DESKTOP BREAKPOINT (lg: >= 1024px)
    * ----------------------------------------
    */
@media (min-width: 1024px) {
    .col.card-small {
        width: 16.66667%;
    }

    .col.card-medium {
        width: 50%; 
    }
}

/*
    * ----------------------------------------
    * 5. SPECIFIC SECTION STYLES (NAVBAR & DROPDOWN)
    * ----------------------------------------
    */
.navbar {
    /* Using the Deep Charcoal/Navy */
    background-color: var(--color-dark);
    color: white;
    padding: 0.5rem var(--space-unit);
    margin-bottom: calc(0.8 * var(--space-unit));
    box-shadow: var(--shadow-md);
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.35rem;
    font-weight: 600;
}
.logo a {
    color: var(--color-dark);
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: white;
}

.logo a:hover {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Navbar Links */
.nav-link {
    color: white;
    margin-left: 1rem;
    text-decoration: none;
    padding: 0.5rem 0;
    display: inline-block;
    transition: color 0.2s;
}

.nav-link:hover {
    /* Highlight links with the primary Indigo color */
    color: var(--color-primary-light-hover); 
}

/* Dropdown Container */
.dropdown {
    position: relative;
    display: inline-block;
    margin-left: 1rem;
}

.dropdown-toggle {
    cursor: pointer;
    margin-left: 0; 
}

/* Dropdown Menu Content */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--color-card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    min-width: 160px;
    z-index: 10;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Show menu on hover */
.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    color: var(--color-dark);
    padding: 0.5rem 1rem;
    text-decoration: none;
    display: block;
    font-size: 0.875rem;
}

.dropdown-menu a:hover {
    background-color: var(--color-light);
    color: var(--color-dark);
}

.dropdown-separator {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 0.25rem 0;
}

/* Other Section Styles */
.chart-container {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-footer {
    min-height: 100px;
    font-size: 0.8rem;
    color: #4e4e4e;
    text-align: center;
}        
/* from old sahkotutka */
  .price-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.3rem;
    text-align: center;
    align-items: center;
  }

  .price-item {
    background: var(--color-card-bg);
    border-radius: 6px;
    padding: 0.3rem 0.5rem;
    box-shadow: var(--shadow-subtle); 
    transform: none; 
  }
  .info-font {
    display: block;
    font-size: 0.75rem;
    opacity: 0.9;
    line-height: 1.2;
  }

  .price-value {
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.3;
  }
  .price-now{
    font-weight: 600;
    font-size: 1.1rem;
    line-height: 1.3;
  }
/*
    * ----------------------------------------
    * 7. LINK CARD STYLES
    * ----------------------------------------
    * Makes the entire card area clickable and handles text styling inside the link.
    */
.card a {
    text-decoration: none; /* Remove underline from the whole link */
    display: flex; 
    flex-direction: column;
    color: inherit; 
    height: 100%; 
    padding: 0; 
}

/* Title inside the card link */
.card a h2 {
    margin-top: 0;
    color: var(--color-dark); /* Title color */
    font-size: 1.125rem; 
    font-weight: 600;
}

/* Body text inside the card link */
.card a p {
    margin-bottom: 0.75rem; 
    flex-grow: 1; /* Pushes the 'read more' link to the bottom */
    color: var(--color-text-secondary); /* Body text color */
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Style for the "Lue lisää" call to action */
.card a .read-more {
    font-weight: 700; 
    color: var(--color-primary); /* Use primary color for the action link */
    transition: color 0.2s;
    margin-top: auto; /* Push to the bottom of the card */
    font-size: 0.875rem;
}

.card a:hover .read-more {
    color: var(--color-primary-dark-border); /* Subtle hover effect on the action text */
}
/*
    * ----------------------------------------
    * 8. RESOURCE LIST STYLES (Modern Link List)
    * ----------------------------------------
    */
.resource-list {
    list-style: none; /* Remove bullet points */
    padding: 0;
    margin: 0;
}

.resource-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-border);
}

.resource-item:last-child {
    border-bottom: none;
}

.resource-item .link-title {
    flex: 0 0 20%; /* Link/Title column width */
    font-weight: 600;
    font-size: 1rem;
    margin-right: 2rem; /* Spacing between columns */
}

.resource-item .link-title a {
    color: var(--color-dark); /* Ensure link color matches dark text */
    text-decoration: none;
    transition: color 0.2s;
}

.resource-item .link-title a:hover {
    color: var(--link-hover);
}

.resource-item .link-description {
    flex: 1; /* Description takes up remaining space */
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

/* Mobile layout: stack the title and description */
@media (max-width: 639px) {
    .resource-item {
        flex-direction: column;
    }
    .resource-item .link-title {
        flex-basis: auto;
        margin-bottom: 0.25rem;
        margin-right: 0;
    }
    .resource-item .link-description {
        flex-basis: auto;
    }
}

/* Some buttons */

    .social-icons {
        display: flex !important;
        gap: 1rem;
        flex-wrap: wrap;
    }

    .social-icons .social-button {
        display: flex; 
        align-items: center;
        text-decoration: none !important;
        color: white !important;
        padding: 0.5rem 1rem !important;
        border-radius: var(--border-radius);
        font-size: 0.875rem;
        font-weight: 600;
        transition: opacity 0.2s, transform 0.2s;
        flex-direction: row;
    }

    .social-button:hover {
        opacity: 0.9;
        transform: translateY(-1px);
    }

    .social-button.facebook {
        background-color: var(--color-facebook-custom);
    }

    .social-button.x-twitter {
        background-color: var(--color-x-twitter);
    }

    .social-svg {
        width: 1.25rem;
        height: 1.25rem;
        margin-right: 0.5rem; /* Space between icon and text */
        flex-shrink: 0; /* Prevent SVG from shrinking */
    }
    
    .social-button span {
        white-space: nowrap !important; /* Prevent text from wrapping within the button */
    }
#container {
    height: 80%;
    max-height:600px; 
    content-visibility: auto;
    contain-intrinsic-size: 1300px 600px; /* estimated size */
    min-width: 310px;
    min-height: 550px;
    margin: 0 auto;
}
#container_2 {
    height: 80%;
    max-height:600px; 
    content-visibility: auto;
    contain-intrinsic-size: 1300px 600px; /* estimated size */
    min-width: 310px;
    min-height: 500px;
    margin: 0 auto;
}
/* On mobile screens, limit chart height */
@media (max-width: 768px) {
    #container {
      min-height: 440px !important;     /* smaller minimum */
      max-height: 480px !important;     /* prevents overly tall charts */
    }
}
.highcharts-tooltip {
  z-index: 9998;
}
.highcharts-button highcharts-button-normal > text > tspan {
    padding: 3px;
}
.alv-notice {
    color:var(--color-dark);
    font-size:0.9rem;
    text-align: center;
    padding-top: 0.5rem;
    padding-bottom: 0.2rem;
}

  .affi-card {
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 10px;
    margin: 10px 0;
    background: var(--color-card-bg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    font-family: system-ui, sans-serif;
    text-align: center;
    background-color: #ecf3ff;
  }

  .affi-card h3 {
    font-size: 20px;
    margin: 0 0 8px;
    color: var(--color-4);
  }

  .affi-card p {
    font-size: 16px;
    margin: 0 0 12px;
    color: var(--color-4);
  }

  .affi-btn {
    display: inline-block;
    background: #317E5D;
    color: #fff;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    margin-top: 8px;
  }
  .google-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background-color: #F0F5FF;
    border: 1px solid #dadce0;
    color: #3c4043;
    font-weight: 500;
    font-size: 15px;
    padding: 10px 0;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: background-color 0.2s, box-shadow 0.2s;
  }
  
  .google-btn img {
    width: 20px;
    height: 20px;
  }
  
  .google-btn:hover {
    background-color: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  }
  
  .google-btn:active {
    background-color: #f1f3f4;
  }
  
  .text-muted {
    color: #9aa0a6 !important;
    font-size: 14px;
  }

       /* ----------------------------------------
         * 7. MODAL STYLES
         * ----------------------------------------
         */

        /* Base Modal Container */
        .modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.6);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 1000;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
            overflow-y: auto; /* Allow scrolling for tall modals */
            padding: 1rem 0; /* Ensures content padding on vertical scroll */
            box-sizing: border-box;
        }

        /* Modal Open State */
        .modal.is-open {
            opacity: 1;
            visibility: visible;
        }

        /* Modal Content (The actual box) */
        .modal-content {
            background-color: var(--color-card-bg);
            border-radius: var(--border-radius);
            box-shadow: var(--shadow-lg);
            width: 90%;
            max-width: 500px;
            margin: auto; /* Important for alignment inside flex container */
            transform: scale(0.95);
            transition: transform 0.3s ease-in-out;
        }
        
        .modal.is-open .modal-content {
            transform: scale(1);
        }

        /* Modal Header */
        .modal-header {
            padding: 1.5rem;
            border-bottom: 1px solid var(--color-border);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .modal-header h3 {
            margin: 0;
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--color-dark);
        }

        /* Close Button */
        .modal-close {
            background: none;
            border: none;
            font-size: 1.5rem;
            font-weight: 300;
            color: var(--color-text-secondary);
            cursor: pointer;
            line-height: 1;
            padding: 0;
            transition: color 0.2s;
        }

        .modal-close:hover {
            color: var(--color-dark);
        }

        /* Modal Body */
        .modal-body {
            padding: 1.5rem;
        }

        /* Modal Footer (for secondary actions) */
        .modal-footer {
            padding: 1rem 1.5rem 1.5rem;
            border-top: 1px solid var(--color-border);
            display: flex;
            justify-content: flex-end;
            gap: 0.5rem;
        }
        
        
        /* ----------------------------------------
         * 8. AUTH MODAL SPECIFIC STYLES (Tabs & Forms)
         * ----------------------------------------
         */
        
        .tab-nav {
            display: flex;
            border-bottom: 2px solid var(--color-border);
            margin-bottom: 1.5rem;
        }
        
        .tab-button {
            padding: 0.75rem 1rem;
            cursor: pointer;
            font-weight: 600;
            color: var(--color-text-secondary);
            border: none;
            background: none;
            position: relative;
            transition: color 0.2s;
        }

        .tab-button.active {
            color: var(--color--4);
        }

        .tab-button.active::after {
            content: '';
            position: absolute;
            bottom: -2px;
            left: 0;
            width: 100%;
            height: 2px;
            background-color: var(--color-4);
        }

        .tab-content {
            display: none;
        }

        .tab-content.show.active {
            display: block;
        }
        
        /* Form Styling */
        .form-group {
            margin-bottom: 1rem;
        }

        .form-group label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 500;
            color: var(--color-dark-secondary);
            font-size: 0.875rem;
        }

        .form-group input, .form-group textarea {
            width: 100%;
            padding: 0.75rem 1rem;
            border: 1px solid var(--color-border);
            border-radius: var(--border-radius);
            box-sizing: border-box;
            transition: border-color 0.2s, box-shadow 0.2s;
        }

        .form-group input:focus, .form-group textarea:focus {
            border-color: var(--color-primary);
            outline: none;
            box-shadow: 0 0 0 3px rgba(61, 130, 171, 0.1);
        }

        .btn {
            padding: 0.75rem 1.5rem;
            border-radius: var(--border-radius);
            font-weight: 600;
            cursor: pointer;
            background-color: var(--color-1);
            transition: background-color 0.2s, opacity 0.2s;
            border: 1px solid transparent;
        }

        .btn-secondary {
            background-color: #82998f;
            color: white;
        }

        .btn :hover {
            opacity: 0.9;
        }

        .btn-full {
            width: 100%;
            margin-top: 0.5rem;
        }

        .text-center {
            text-align: center;
        }
        
        /* Utility for small text inside modal forms */
        .modal-body small {
            display: block;
            margin-top: 1rem;
            color: var(--color-text-secondary);
            text-align: center;
        }

.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}
.alert-success {
    border-color: #0b8600;
    color: #0b8600;
}
.alert-danger {
    border-color: #6e0000;
    color: #6e0000;
}

/*Hamburger menu*/
.menu-text {
    display: block;
}
.menu-icon {
    display: none;
    height: 1.5rem;
    width: 1.5rem;
    stroke: currentColor; 
}
@media (max-width: 767px) {
    .menu-text {
        display: none !important;
    }
    .menu-icon {
        display: block !important;
        height: 1.75rem;
        width: 1.75rem;
    }
    .navbar {
        padding: 0.3rem var(--space-unit) !important;
    }

    .logo {
        font-size: 1.25rem !important;
        font-weight: 600 !important;
    }    
}
