/**
 * DASHBOARD PROJECT CUSTOM CSS
 * This file contains all custom styling for the dashboard project with MVC structure
 *
 * TABLE OF CONTENTS:
 * 1. GENERAL STYLES
 * 2. LAYOUT & CONTAINERS
 * 3. NAVIGATION
 *    3.1 Top Navbar
 *    3.2 Sidebar
 *    3.3 Submenu
 * 4. DASHBOARD COMPONENTS
 *    4.1 Cards & Boxes
 *    4.2 Charts
 *    4.3 Tables & DataTables
 * 5. UTILITIES
 *    5.1 Colors
 *    5.2 Text Styles
 *    5.3 Spacing Helpers
 *    5.4 CRUD operations
 * 6. FORMS & INPUTS
 * 7. MEDIA QUERIES
 *    7.1 Small devices (phones, 576px and down)
 *    7.2 Medium devices (tablets, 768px and up)
 *    7.3 Large devices (desktops, 992px and up)
 *    7.4 Extra large devices (large desktops, 1200px and up)
 */


/*=================================
  1. GENERAL STYLES
=================================*/
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,100..700;1,100..700&display=swap');
body {
    /* Light grayish blue background */
    background-color: #f0f2f5;
    font-family: "IBM Plex Sans", sans-serif;
    padding-top: 56px; /* Account for fixed navbar height */
}

/*=================================
  2. LAYOUT & CONTAINERS
=================================*/
.chartcontainer {
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 1px 9px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    /*padding: 15px;*/
    margin: 5px 5px 20px 5px;
}

/* Container adjustments to prevent overlap */
.container-fluid {
    padding-left: 0;
    padding-right: 0;
    /*overflow-x: hidden;*/
}

.row {
    margin-left: 0;
    margin-right: 0;
}

/*=================================
  3. NAVIGATION
=================================*/

/* 3.1 Top Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030; /* Higher z-index than sidebar */
    height: 56px; /* Fixed height for navbar */
    padding: 0 1rem; /* Restore default padding */
    background-color: rgb(45,142,159);
    color: white;
}


.navbar-brand,
.navbar-brand a,
.navbar-brand:active,
.navbar-brand:hover {
    text-decoration: none;
    color: white;
}

/* Sidebar toggle button */
#sidebarToggle {
    background-color: rgba(85, 185, 255, 0.73);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 15px;
    margin: 0 10px;
}

/* 3.2 Sidebar */
.sidebar {
    width: 250px; /* Fixed width when expanded */
    min-height: calc(100vh - 56px);
    height: 100%;
    background-color: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    padding-top: 20px;
    transition: all 0.3s ease;
    position: fixed;
    left: 0;
    top: 56px; /* Match navbar height */
    z-index: 100; /* Lower z-index than the navbar */
}

/* Collapsed sidebar styles */
.sidebar-collapsed {
    width: 60px; /* Slim width when collapsed */
}

/* Sidebar menu text behavior */
.sidebar .menu-text {
    display: inline;
    transition: opacity 0.3s, visibility 0.3s;
}

.sidebar-collapsed .menu-text,
.sidebar-collapsed .submenu-icon,
.sidebar-collapsed .sidebar-heading span {
    display: none;
}

/* Icon positioning in collapsed state */
.sidebar-collapsed .nav-link i {
    font-size: 1.2rem;
    margin-right: 0;
    text-align: center;
    width: 100%;
}

.sidebar .nav-link {
    font-weight: 500;
    color: rgba(13, 27, 62, 0.7);
    padding: 10px 15px;
    border-radius: 4px;
    margin: 2px 10px;
}

.sidebar .nav-link:hover {
    /*background-color: rgba(85, 185, 255, 0.73);*/
    background-color: rgb(45,142,159);
    color: white;
}



li.nav-item {
    line-height: 10px;
}

.sidebar-heading {
    color: rgb(85, 185, 255);
    padding: 10px 15px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 3.3 Submenu */
.sidebar .submenu {
    padding-left: 40px;
    list-style: none;
}

.sidebar-collapsed .submenu {
    position: absolute;
    left: 60px;
    top: 0;
    width: 180px;
    background: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    display: none;
    padding-left: 0;
    z-index: 101; /* Make sure submenu is above content */
}

/* Show submenu on hover in collapsed state */
.sidebar-collapsed .nav-item:hover .submenu {
    display: block;
}

/* Overlay for when sidebar is open on mobile */
.sidebar-overlay {
    position: fixed;
    top: 56px; /* Match navbar height */
    left: 0;
    width: 100%;
    height: calc(100vh - 56px); /* Full height minus navbar */
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99; /* Below sidebar, above content */
    display: none;
}

.sidebar-overlay.active {
    display: block!important;
}
/* Style for aktive lenker i hovedmenyen */
.sidebar .nav-link.active {
    /*background-color: rgba(85, 185, 255, 0.73);*/
    background-color: rgb(45,142,159);
    color: white;
}

/* Style for aktive lenker i submenyen */
.sidebar .submenu-link.active {
    /*background-color: rgba(85, 185, 255, 0.73);*/
    background-color: rgb(45,142,159);
    /*color: #0d6efd;*/
    font-weight: bold;
}
/* Stilsetting for kollapseknappen */
.sidebar-collapse-btn {
    position: absolute;
    top: 10px;
    right: -15px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    z-index: 100;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform 0.3s ease;
}

/* Rotasjon av pilen når sidebaren er kollapset */
.sidebar.manually-collapsed .sidebar-collapse-btn {
    transform: rotate(180deg);
}

/* Stilsetting for manuelt kollapset sidebar */
.sidebar.manually-collapsed {
    width: 60px;
}

.sidebar.manually-collapsed .menu-text,
.sidebar.manually-collapsed .submenu,
.sidebar.manually-collapsed .sidebar-heading span,
.sidebar.manually-collapsed .submenu-icon {
    display: none;
}

.sidebar.manually-collapsed .nav-link {
    text-align: center;
    padding: 10px 0;
}

.sidebar.manually-collapsed .nav-link i {
    margin-right: 0;
    font-size: 1.2rem;
}

/* Hovedinnhold blir bredere når sidebar er kollapset */
.main-content.sidebar-manually-collapsed {
    width: calc(100% - 60px);
    margin-left: 60px;
}

/* Vis tooltip på hover ved kollapset sidebar */
.sidebar.manually-collapsed .nav-link {
    position: relative;
}

.sidebar.manually-collapsed .nav-link:hover:after {
    content: attr(data-title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    white-space: nowrap;
    z-index: 99;
    margin-left: 10px;
}

/* Main content adjustments */
.main-content {
    margin-left: 240px; /* Match sidebar width */
    padding: 20px;
    transition: margin-left 0.3s ease;
    position: relative;
    min-height: calc(100vh - 56px); /* Full viewport height minus navbar */
}

/*.main-content.expanded {*/
/*    margin-left: 250px; !* Match collapsed sidebar width *!*/
/*}*/
/* Main content når sidebar er manuelt utvidet (normal tilstand) */
.main-content.sidebar-manually-expanded {
    /*margin-left: 250px; !* Samme som standard sidebar-bredde *!*/
    width: calc(100% - 250px);
}

/* Sikre at sidebar har korrekt bredde når den er manuelt utvidet */
.sidebar.manually-expanded {
    width: 250px; /* Full bredde */
}

/* Dropdown styling i 'legg til aktivitet' */
.activity-dropdown {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
}

.activity-dropdown .dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.activity-dropdown .dropdown-item:hover {
    background-color: rgb(151, 208, 243);
}

/*=================================
  4. DASHBOARD COMPONENTS
=================================*/

/* 4.1 Cards & Boxes */
/* Add card styles here as your project grows */
.card-header{
    /*background-color: rgb(151, 208, 243);*/
    background-color: rgb(45,142,159);
    color:white;
}
.secondary-header-color{
    background-color: rgb(88, 111, 115);
}

.card-header p{
    color:white;
}
/* 4.2 Charts */
.highcharts-title {
    color: red !important;
}

/* 4.3 Tables & DataTables */
/* DataTables customization */
.no-wrap{
    white-space: nowrap;
}
.dataTables_filter input {
    width: 400px !important;
    margin-left: 10px;
    padding: 6px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

/* Kollone størrelser prosjekt tabell */
#projectTable th.small {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
}

#projectTable th.medium {
    width: 300px !important;
    min-width: 200px !important;
    max-width: 300px !important;
}

#projectTable th.large {
    width: 500px !important;
    min-width: 300px !important;
    max-width: 500px !important;
}

/*!* DataTables *!*/
/* Små kolonner - brukes for korte verdier som tall og datoer */
#projectTable .col-small {
    min-width: 20px!important;   /* Minimumsstørrelse for at innholdet skal være lesbart */
    max-width: 80px!important;  /* Maksimal bredde så kolonnen ikke tar unødvendig plass */
    width: auto!important;       /* La kolonnen tilpasse seg mellom min og max */
}

/* Store kolonner - brukes for lengre tekst som prosjektnavn */
#projectTable .col-large {
    min-width: 150px!important;  /* Større minimumsbredde for mer tekst */
    max-width: 400px!important;  /* Maksimal bredde så kolonnen ikke dominerer */
    width: auto!important;       /* La kolonnen tilpasse seg mellom min og max */
}
#projectTable th.col-large {
    min-width: 150px !important;
    max-width: 400px !important;
    width: auto !important;
}

#projectTable th.col-small {
    min-width: 20px !important;
    max-width: 80px !important;
    width: auto !important;
}

/* Sørg for at tekst håndteres riktig ved overflow */
#projectTable .col-small, .col-large {
    white-space: nowrap;    /* Unngå linjeskift */
    overflow: hidden;       /* Skjul overflødig tekst */
    text-overflow: ellipsis; /* Vis ... ved overflødig tekst */
}

/* Table links styling */
td a {
    color: #33a1d3;
    text-decoration: none;
}

td a:hover {
    color: #719dfc;
}

/*=================================
  5. UTILITIES
=================================*/

/* 5.1 Colors */
.bg-gray {
    background-color: #EBEEF0;
}

.text-blue {
    color: rgb(85, 185, 255);
}

/* Mobile Pill knapp styling */
.mobile-pill {
    position: fixed;
    top: 60px;
    left: 20px;
    z-index: 1050; /* Higher than sidebar */
    background-color: rgba(85, 185, 255, 0.9);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 12px 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: none; /* Hidden by default */
    align-items: center;
    transition: all 0.3s ease;
}

.mobile-pill:hover {
    background-color: rgba(65, 165, 235, 1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.mobile-pill i {
    margin-right: 8px;
    font-size: 1.2rem;
}
.badge{
    padding:7px!important;
}
/*Override bootstrap buttons */
.btn-secondary{
    background-color: rgb(45,142,159);
}
.btn-primary{
    background-color: rgb(200,73,87);
    border-color: rgb(200,73,87);
}
.btn-primary:hover{
    background-color: rgb(232, 174, 99);
    border-color: rgb(232, 174, 99);
}
/* 5.2 Text Styles */
/* Add text styles here as your project grows */

/* 5.3 Spacing Helpers */
/* Add spacing helpers here as your project grows */

/* 5.4 CRUD operations */
/* Styling for edit buttons */
.edit-section-btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}
/* Add hover effect to sections */
.row.mb-4 {
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.row.mb-4:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

/* Form styling */
.section-form .form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Alert message styling */
/*.alert-message {*/
/*    position: fixed;*/
/*    top: 15px;*/
/*    right: 15px;*/
/*    z-index: 9999;*/
/*    min-width: 300px;*/
/*    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);*/
/*}*/

/* Add transition effect for form display/hiding */
.section-edit, .section-display {
    transition: opacity 0.3s ease;
}

/*=================================
  6. FORMS & INPUTS
=================================*/
/* Add form styles here as your project grows */

/*=================================
  7. MEDIA QUERIES
=================================*/
@media (max-width: 1390px) {
    /*main{*/
    /*    margin-left:240px!important;*/
    /*}*/
}
/* Custom breakpoint for sidebar collapse at 1160px */
@media (max-width: 1160px) {
    .sidebar {
        width: 75px;
    }

    .sidebar .menu-text,
    .sidebar .submenu-icon,
    .sidebar .sidebar-heading span {
        display: none;
    }

    .sidebar .nav-link i {
        font-size: 1.2rem;
        margin-right: 0;
        text-align: center;
        width: 100%;
    }

    .main-content {
        margin-left: 65px;
    }

    /* Submenu positioning in collapsed state */
    .sidebar .submenu {
        position: absolute;
        left: 60px;
        top: 0;
        width: 180px;
        background: white;
        box-shadow: 0 0 10px rgba(0,0,0,0.1);
        display: none;
        padding-left: 0;
    }

    .sidebar .nav-item:hover .submenu {
        display: block;
    }
    .dataTables_filter input {
        width: 200px !important;
        margin-left: 10px;
        padding: 6px 12px;
        border: 1px solid #ced4da;
        border-radius: 4px;
    }
}

/* Only show on mobile devices, mobile pill pop up */
@media (max-width: 992px) {
    .sidebar.manually-expanded {
        width: 250px !important;
    }

    .main-content.sidebar-manually-expanded {
        margin-left: 250px !important;
        width: calc(100% - 250px) !important;
    }
    .mobile-pill {
        display: flex;
    }

    /* Hide the regular sidebar toggle on mobile */
    #sidebarToggle {
        display: none;
    }

    /* Full width sidebar for mobile */
    .sidebar {
        width: 270px;
        transform: translateX(-100%);
    }

    /* Reset menu text display for mobile */
    .sidebar .menu-text {
        display: inline;
    }

    /* Reset icon positioning for mobile */
    .sidebar .nav-link i {
        margin-right: 10px;
        width: auto;
        text-align: left;
    }

    /* When sidebar is shown */
    .sidebar.mobile-open {
        transform: translateX(0) !important; /* Overstyr alle andre transform verdier */
        width: 270px !important; /* Sørg for at bredden er korrekt */
        display: block !important; /* Sikre at den vises */
    }

    /* Adjust main content when sidebar is open */
    .main-content.mobile-pushed {
        margin-left: 0!important;
    }

}

/* 7.1 Small devices (phones, 576px and down) */
@media (max-width: 576px) {
    .navbar-brand{
        display: none;
    }


    /*.sidebar {*/
    /*    transform: translateX(-100%); !* Hidden by default *!*/
    /*    width: 250px; !* Full width when shown *!*/
    /*    z-index: 1020;*/
    /*}*/

    /*.sidebar-collapsed {*/
    /*    transform: translateX(0); !* Show when toggled *!*/
    /*    width: 60px;*/
    /*}*/

    /*.main-content {*/
    /*    margin-left: 0; !* No margin on mobile *!*/
    /*    width: 100%;*/
    /*}*/

    .main-content.expanded {
        margin-left: 0;
    }

    /*.dataTables_filter input {*/
    /*    width: 200px !important;*/
    /*}*/
}


/* 7.3 Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1159px) {
    /* This range will use the custom breakpoint styles from above */
}

/* 7.4 Extra large devices (large desktops, 1160px and up) */
/*@media (min-width: 1161px) {*/
/*    !* Default styles for large screens (sidebar fully expanded) *!*/

/*    !* JS might still toggle sidebar with button *!*/
/*    .sidebar-collapsed {*/
/*        width: 75px;*/
/*    }*/

/*    .sidebar-collapsed ~ .main-content,*/
/*    .main-content.expanded {*/
/*        margin-left: 0;*/
/*    }*/
/*}*/