/* Sidebar layout */
.mål-layout {
    padding: 2rem 0;
    background-color: var(--white);
}

.mål-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem;
}

.mål-page-title {
    color: var(--secondary-color);
    font-size: 2rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    text-align: center;
}

.mål-intro-text {
    color: var(--text-color);
    font-size: 1.1rem;
    line-height: 1.7;
    margin: 0 0 2rem 0;
    text-align: center;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.mål-sidebar-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 3rem;
    width: 100%;
}

.mål-sidebar {
    position: sticky;
    top: 140px;
    height: fit-content;
}

.mål-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-tab-btn {
    padding: 0.9rem 1.25rem;
    background: var(--white);
    border: 2px solid #d0d0d0;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-color);
    transition: var(--transition);
    font-weight: 500;
    text-align: left;
    border-radius: var(--border-radius);
    width: 100%;
}

/* Fargenyanser for hver årstrinn-tab */
.sidebar-tab-btn[data-year="2"] {
    background: linear-gradient(to right, rgba(26, 117, 255, 0.08), rgba(26, 117, 255, 0.03));
    border-color: rgba(26, 117, 255, 0.3);
}

.sidebar-tab-btn[data-year="4"] {
    background: linear-gradient(to right, rgba(76, 175, 80, 0.08), rgba(76, 175, 80, 0.03));
    border-color: rgba(76, 175, 80, 0.3);
}

.sidebar-tab-btn[data-year="7"] {
    background: linear-gradient(to right, rgba(255, 193, 7, 0.08), rgba(255, 193, 7, 0.03));
    border-color: rgba(255, 193, 7, 0.3);
}

.sidebar-tab-btn[data-year="10"] {
    background: linear-gradient(to right, rgba(156, 39, 176, 0.08), rgba(156, 39, 176, 0.03));
    border-color: rgba(156, 39, 176, 0.3);
}

.sidebar-tab-btn:hover {
    color: var(--primary-color);
    background-color: rgba(26, 117, 255, 0.1);
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.sidebar-tab-btn[data-year="2"]:hover {
    background: linear-gradient(to right, rgba(26, 117, 255, 0.15), rgba(26, 117, 255, 0.08));
    border-color: rgba(26, 117, 255, 0.5);
}

.sidebar-tab-btn[data-year="4"]:hover {
    background: linear-gradient(to right, rgba(76, 175, 80, 0.15), rgba(76, 175, 80, 0.08));
    border-color: rgba(76, 175, 80, 0.5);
}

.sidebar-tab-btn[data-year="7"]:hover {
    background: linear-gradient(to right, rgba(255, 193, 7, 0.15), rgba(255, 193, 7, 0.08));
    border-color: rgba(255, 193, 7, 0.5);
}

.sidebar-tab-btn[data-year="10"]:hover {
    background: linear-gradient(to right, rgba(156, 39, 176, 0.15), rgba(156, 39, 176, 0.08));
    border-color: rgba(156, 39, 176, 0.5);
}

.sidebar-tab-btn.active {
    color: var(--primary-color);
    font-weight: 600;
    background-color: var(--white);
    border-width: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-tab-btn[data-year="2"].active {
    border-color: rgba(26, 117, 255, 0.4);
}

.sidebar-tab-btn[data-year="4"].active {
    border-color: rgba(76, 175, 80, 0.4);
}

.sidebar-tab-btn[data-year="7"].active {
    border-color: rgba(255, 193, 7, 0.4);
}

.sidebar-tab-btn[data-year="10"].active {
    border-color: rgba(156, 39, 176, 0.4);
}

.mål-main-content {
    min-width: 0;
}

/* Kategori og mål styling */
.kategori-container {
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin: 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.kategori {
    margin-bottom: 3rem;
    border-bottom: 3px solid var(--light-gray);
    padding-bottom: 2rem;
}

.kategori:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.kategori h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: left;
    font-size: 1.4rem;
    font-weight: 600;
    padding: 1rem 0;
    border-bottom: 2px solid var(--light-gray);
    position: relative;
}

.kategori h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.mål-liste {
    list-style: none;
    padding: 0;
}

.mål-tabell {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.mål-tabell th,
.mål-tabell td {
    padding: 1.2rem 1.5rem;
    text-align: left;
    border: none;
}

.mål-tabell th {
    background-color: var(--primary-color);
    color: var(--white);
    font-weight: 600;
    padding: 1.5rem 2rem;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.mål-tabell tr:last-child td {
    border-bottom: none;
}

/* Kategori farger */
.kategori-celle {
    font-weight: 600;
    vertical-align: top;
    width: 200px;
    text-align: left;
    border-right: none;
    padding: 1.5rem 2rem;
    background-color: rgba(41, 128, 185, 0.12);
    color: var(--primary-color);
    font-size: 1rem;
    border-right: 2px solid var(--light-gray);
}

.kategori-1 .kategori-celle {
    background-color: rgba(255, 107, 53, 0.12);
    color: var(--accent-orange);
    border-right-color: rgba(255, 107, 53, 0.3);
}

.kategori-2 .kategori-celle {
    background-color: rgba(76, 175, 80, 0.12);
    color: var(--accent-green);
    border-right-color: rgba(76, 175, 80, 0.3);
}

.kategori-3 .kategori-celle {
    background-color: rgba(156, 39, 176, 0.12);
    color: var(--accent-purple);
    border-right-color: rgba(156, 39, 176, 0.3);
}

.kategori-4 .kategori-celle {
    background-color: rgba(255, 193, 7, 0.12);
    color: var(--accent-yellow);
    border-right-color: rgba(255, 193, 7, 0.3);
}

.kategori-5 .kategori-celle {
    background-color: rgba(26, 117, 255, 0.12);
    color: var(--primary-color);
    border-right-color: rgba(26, 117, 255, 0.3);
}

.mål-tittel {
    font-weight: 500;
    width: 250px;
    color: var(--secondary-color);
    font-size: 1rem;
}

.mål-beskrivelse {
    color: var(--text-color);
    opacity: 0.9;
    width: calc(100% - 200px);
    transition: transform 0.2s ease, color 0.2s ease;
    background-color: var(--white);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Hover effekt */
.mål-tabell tr {
    transition: all 0.2s ease;
    background-color: var(--white);
}

.mål-tabell tr:hover {
    cursor: pointer;
    background-color: rgba(26, 117, 255, 0.02);
    transform: translateX(2px);
}

.mål-tabell tr:hover .mål-beskrivelse {
    transform: scale(1.01);
    color: var(--primary-color);
    opacity: 1;
}

/* Bedre separasjon mellom kategorier */
.kategori-separator {
    height: 2rem;
    background-color: var(--light-gray);
    margin: 2rem 0;
    border-radius: 1px;
}

/* Modal styling */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background-color: var(--white);
    margin: 2% auto;
    padding: 2rem;
    width: 95%;
    max-width: 1200px;
    border-radius: var(--border-radius);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-color);
    transition: var(--transition);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
}

.modal-title {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-right: 3rem;
    font-size: 1.6rem;
    line-height: 1.4;
    font-weight: 600;
}

.modal-sections {
    display: grid;
    gap: 1.5rem;
}

.modal-section h3 {
    color: var(--secondary-color);
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.modal-section h3::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 1.3em;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.section-content {
    background-color: var(--light-gray);
    padding: 1.2rem;
    border-radius: var(--border-radius);
    line-height: 1.5;
}

.section-content ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.section-content li {
    margin-bottom: 0.6rem;
    padding-left: 1.2rem;
    position: relative;
}

.section-content li:last-child {
    margin-bottom: 0;
}

.section-content li::before {
    content: '•';
    color: var(--primary-color);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Tab content */
.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Responsivt design */
@media (max-width: 1024px) {
    .mål-sidebar-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .mål-sidebar {
        position: static;
    }
    
    .mål-sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .sidebar-tab-btn {
        flex: 1;
        min-width: 140px;
        text-align: center;
        min-height: 44px;
    }
}

@media (max-width: 768px) {
    .mål-container {
        padding: 0 1rem;
    }
    
    .mål-page-title {
        font-size: 1.6rem;
        margin-bottom: 1rem;
    }
    
    .mål-intro-text {
        font-size: 0.95rem;
        padding: 0 0.5rem;
        margin-bottom: 1.5rem;
    }
    
    .mål-sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .sidebar-tab-btn {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: 120px;
        font-size: 0.9rem;
        padding: 0.85rem 0.75rem;
        min-height: 44px;
    }

    .modal-content {
        margin: 5% auto;
        padding: 1.5rem;
        width: 95%;
        max-height: 85vh;
    }

    .modal-title {
        font-size: 1.3rem;
        margin-bottom: 1.5rem;
        padding-right: 2rem;
    }

    .modal-sections {
        gap: 1.5rem;
    }

    .modal-section h3 {
        font-size: 1.1rem;
    }

    .section-content {
        padding: 1rem;
        font-size: 0.9rem;
    }

    /* Tabellvisning - horisontal scroll med bedre styling */
    .kategori-container {
        margin: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .mål-tabell {
        display: table;
        width: 100%;
        min-width: 600px;
        border-collapse: separate;
        border-spacing: 0;
    }

    .mål-tabell th,
    .mål-tabell td {
        padding: 0.75rem 0.8rem;
        min-width: 100px;
        font-size: 0.9rem;
    }
    
    .mål-tabell th {
        font-size: 0.95rem;
        padding: 1rem 0.8rem;
    }
    
    .kategori-celle {
        width: 150px;
        font-size: 0.9rem;
        padding: 1rem 0.8rem;
    }
    
    .mål-tittel {
        width: 200px;
        font-size: 0.9rem;
    }
    
    .mål-beskrivelse {
        font-size: 0.85rem;
    }
    
    /* Touch-friendly hover states fjernes på mobil */
    .mål-tabell tr:active {
        background-color: rgba(26, 117, 255, 0.05);
    }
}

@media (max-width: 480px) {
    .mål-container {
        padding: 0 0.5rem;
    }
    
    .mål-page-title {
        font-size: 1.4rem;
    }
    
    .mål-intro-text {
        font-size: 0.9rem;
        padding: 0 0.25rem;
        margin-bottom: 1rem;
    }
    
    .sidebar-tab-btn {
        width: 100%;
        margin-bottom: 0.5rem;
        font-size: 0.85rem;
        padding: 0.9rem 0.7rem;
        min-height: 44px;
    }
    
    .kategori-container {
        margin: 0;
    }
    
    .mål-tabell th,
    .mål-tabell td {
        padding: 0.6rem 0.6rem;
        min-width: 90px;
        font-size: 0.85rem;
    }
    
    .mål-tabell th {
        font-size: 0.9rem;
        padding: 0.8rem 0.6rem;
    }
    
    .kategori-celle {
        width: 120px;
        font-size: 0.85rem;
        padding: 0.8rem 0.6rem;
    }
    
    .mål-tittel {
        width: 180px;
        font-size: 0.85rem;
    }
    
    .mål-beskrivelse {
        font-size: 0.8rem;
    }
    
    .modal-content {
        margin: 2% auto;
        padding: 1rem;
        width: 98%;
        max-height: 90vh;
    }
    
    .modal-title {
        font-size: 1.2rem;
        margin-bottom: 1rem;
        padding-right: 1.5rem;
    }
    
    .modal-sections {
        gap: 1.2rem;
    }
    
    .modal-section h3 {
        font-size: 1rem;
    }
    
    .section-content {
        padding: 0.9rem;
        font-size: 0.85rem;
    }
    
    .close-modal {
        right: 1rem;
        top: 1rem;
        font-size: 1.5rem;
        width: 36px;
        height: 36px;
    }
}

/* Touch-friendly hover states */
@media (hover: hover) {
    .sidebar-tab-btn:hover {
        transform: translateX(4px);
    }
    
    .mål-tabell tr:hover .mål-beskrivelse {
        transform: scale(1.01);
        color: var(--primary-color);
        opacity: 1;
    }
}

/* Forbedret fokus states */
.sidebar-tab-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Årstrinn overskrift */
.årstrinn-overskrift {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin: 1rem 0;
    font-weight: 600;
    text-align: center;
    padding: 0.5rem;
}

/* Barnehage info accordion */
.barnehage-info-accordion {
    margin-bottom: 2rem;
}

.barnehage-accordion-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.barnehage-accordion-header {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.barnehage-accordion-header:hover {
    background: #e9ecef;
}

.barnehage-accordion-header.active {
    background: var(--primary-color);
    color: white;
}

.barnehage-accordion-header span:first-child {
    font-weight: 600;
    font-size: 1.1rem;
    color: #2c3e50;
}

.barnehage-accordion-header.active span:first-child {
    color: white;
}

.barnehage-accordion-icon {
    font-size: 1.5rem;
    font-weight: bold;
    transition: transform 0.3s ease;
    color: var(--primary-color);
}

.barnehage-accordion-header.active .barnehage-accordion-icon {
    color: white;
}

.barnehage-accordion-content {
    display: none;
    padding: 1.5rem;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.barnehage-accordion-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--text-color);
}

.barnehage-accordion-content p:last-child {
    margin-bottom: 0;
}

.barnehage-accordion-content a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
    font-style: italic;
}

.barnehage-accordion-content a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.barnehage-accordion-content q {
    font-style: italic;
    quotes: "«" "»";
}

.barnehage-accordion-content q::before {
    content: "«";
}

.barnehage-accordion-content q::after {
    content: "»";
}

/* Årstrinn info accordion */
.årstrinn-info-accordion {
    margin-bottom: 2rem;
}

.årstrinn-accordion-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.årstrinn-accordion-header {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.årstrinn-accordion-header:hover {
    background: #e9ecef;
}

.årstrinn-accordion-header.active {
    background: var(--primary-color);
    color: white;
}

.årstrinn-accordion-header span:first-child {
    font-weight: 600;
    font-size: 1.1rem;
    color: #2c3e50;
}

.årstrinn-accordion-header.active span:first-child {
    color: white;
}

.årstrinn-accordion-icon {
    font-size: 1.5rem;
    font-weight: bold;
    transition: transform 0.3s ease;
    color: var(--primary-color);
}

.årstrinn-accordion-header.active .årstrinn-accordion-icon {
    color: white;
}

.årstrinn-accordion-content {
    display: none;
    padding: 1.5rem;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.årstrinn-accordion-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--text-color);
}

.årstrinn-accordion-content p:last-child {
    margin-bottom: 0;
}
