


/* =========================== */
/* TARGET GROUP CARD STYLING */
/* =========================== */

.target-groups-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.target-group-card {
    border: 2px solid #0073aa !important; /* Dark blue border */
    background-color: white !important; /* White background */
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s ease;
}

.target-group-card:hover {
    box-shadow: 0 4px 12px rgba(0,115,170,0.15);
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.group-header h4 {
    margin: 0;
    color: #0073aa;
    font-size: 1.2rem;
}

.group-actions {
    display: flex;
    gap: 0.5rem;
}

.group-actions button {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.group-actions button:hover {
    background-color: #f0f8ff;
}

.group-description {
    margin: 0.75rem 0;
    color: #333;
    font-size: 0.95rem;
    line-height: 1.4;
}

.group-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #666;
}

.group-stats span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Hide the "Bruk denne målgruppen" button */
.use-group-btn,
.group-actions-bottom {
    display: none !important;
}






/* TARGET GROUPS - Custom option styling with unique prefixed classes */
/* Updated .nyekunder-option-item with proper spacing */
.nyekunder-option-item {
    display: block !important;
    padding: 0.75rem 1rem !important;
    margin: 0.25rem 5px !important; /* Horizontal margin for shadow space */
    cursor: pointer !important;
    border: 1px solid #e1e5e9 !important;
    border-radius: 4px !important;
    font-weight: normal !important;
    font-size: 15px !important;
    background: white !important;
    transition: all 0.2s ease !important;
    line-height: 1.4 !important;
    width: calc(100% - 10px) !important; /* Reduce width to allow for margins */
    height: auto !important;
    box-sizing: border-box !important;
    position: relative !important;
    overflow: visible !important;
}

.nyekunder-option-item:hover {
    background-color: #f8f9fa !important;
    border-color: #6EC1E4 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}




/* Checkbox styling within option items */
.nyekunder-option-item input[type="checkbox"] {
    margin-right: 0.75rem !important;
    transform: scale(1.1) !important;
    vertical-align: top !important;
    margin-top: 2px !important;
}

/* Label styling within option items */
.nyekunder-option-label {
    cursor: pointer !important;
    display: inline !important;
    font-size: 15px !important;
    font-weight: normal !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    color: inherit !important;
}

/* When option is selected/checked */
.nyekunder-option-item:has(input[type="checkbox"]:checked) {
    background-color: #e7f3ff !important;
    border-color: #0073aa !important;
    font-weight: 500 !important;
}

/* Alternative for browsers that don't support :has() */
.nyekunder-option-item.selected {
    background-color: #e7f3ff !important;
    border-color: #0073aa !important;
    font-weight: 500 !important;
}

/* Checkbox group styling */
#target-groups-container .checkbox-group .nyekunder-option-item {
    display: block !important;
    padding: 0.75rem 1rem !important;
    border: 1px solid #e1e5e9 !important;
    border-radius: 4px !important;
    background: white !important;
    cursor: pointer !important;
    font-size: 15px !important;
    transition: all 0.2s ease !important;
    line-height: 1.4 !important;
    margin-bottom: 0.5rem !important;
    box-sizing: border-box !important;
}

#target-groups-container .checkbox-group .nyekunder-option-item:hover {
    background-color: #f8f9fa !important;
    border-color: #6EC1E4 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

#target-groups-container .checkbox-group .nyekunder-option-item:has(input[type="checkbox"]:checked),
#target-groups-container .checkbox-group .nyekunder-option-item.selected {
    background-color: #e7f3ff !important;
    border-color: #0073aa !important;
    font-weight: 500 !important;
}

/* Small text styling */
#target-groups-container small {
    color: #666 !important;
    font-size: 11px !important;
}







/* Send tab styling */
#send-container {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
}

#send-container .send-header {
    text-align: center;
    margin-bottom: 2rem;
}

#send-container .send-header h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

#send-container .form-group {
    margin-bottom: 1.5rem;
}

#send-container label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

#send-container input,
#send-container textarea,
#send-container select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
}

#send-container textarea {
    min-height: 120px;
    resize: vertical;
}




#selected-companies-container {
    margin: 2rem 0;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    /* Remove any overflow properties */
    overflow: visible;
}


#selected-companies-container h4 {
    margin-top: 0;
    color: #2c3e50;
}

.email-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: center;
}




/* Send tab company list - fix double scrollbar */
#send-company-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
}





/* Compact options for digital presence checkboxes - overrides width to fit content */
.nyekunder-option-item.compact-option {
    width: auto !important; /* Fit to content instead of 100% */
    display: inline-block !important; /* Allow them to sit inline or stack naturally */
    padding: 0.5rem 1rem !important; /* Reduced padding for compactness: 0.5rem vertical, 1rem horizontal (covers text + some space) */
    margin: 0.25rem 0.5rem !important; /* Smaller margins to allow better flow if they wrap */
}

/* Hover and selected states remain, but ensure they apply to compact items */
.nyekunder-option-item.compact-option:hover {
    background-color: #f8f9fa !important;
    border-color: #6EC1E4 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

.nyekunder-option-item.compact-option:has(input[type="checkbox"]:checked),
.nyekunder-option-item.compact-option.selected {
    background-color: #e7f3ff !important;
    border-color: #0073aa !important;
    font-weight: 500 !important;
}

/* For the checkbox group container - ensure compact items flow well */
#target-groups-container .checkbox-group .nyekunder-option-item.compact-option {
    display: inline-block !important; /* Override block display for inline flow */
    margin-bottom: 0.5rem !important; /* Keep some vertical spacing if they wrap */
    width: auto !important;
}








.multi-select-options.scrollable {
    max-height: 300px;         /* Adjust as needed */
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem 0;         /* Optional: space for options */
}







/* Make multi-select dropdown buttons wider */
.multi-select-container .multi-select-button {
    min-width: 200px !important; /* Increase from default */
    width: auto !important;
    max-width: 300px !important; /* Set a reasonable max width */
}

/* Make the selected text area wider and allow text overflow handling */
.multi-select-container .multi-select-button .selected-text {
    flex: 1 !important;
    min-width: 160px !important; /* Ensure minimum text space */
    max-width: 250px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    display: inline-block !important;
}

/* Ensure the arrow doesn't take up too much space */
.multi-select-container .multi-select-button .arrow {
    flex-shrink: 0 !important;
    margin-left: 8px !important;
    width: 20px !important;
}

/* Make the button display flex for better layout */
.multi-select-container .multi-select-button {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.75rem 1rem !important;
}







.nyekunder-container {
    max-width: 800px;
    margin: 2rem auto;
    padding-top: 2rem;
	padding-bottom: 2rem;
}







.postcode-search {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

#postcode-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#search-button {
    background-color: #6EC1E4;
	border: 1px solid #373D8F;
    color: black;
}

#search-button:hover {
    background-color: #6E7AE4;
	color: white;
}

.results-container {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
}

.results-message {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}




.nyekunder-popup-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nyekunder-popup {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    max-width: 900px;       /* Økt bredde til ca. dobbelt så stor */
    width: 90%;
    max-height: 80vh;       /* Maks høyde: 80% av skjermen */
    overflow-y: auto;       /* Vertikal rulling om nødvendig */
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
    position: relative;
    text-align: left;
}

.nyekunder-popup h2 {
    margin-top: 0;
}
.popup-close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}
.popup-images img {
    max-width: 100%;
    margin: 0.5rem 0;
    border-radius: 4px;
}
.button-info {
    background: #e7f1fa;
    color: #0073aa;
    border: 1px solid #0073aa;
    margin-top: 1rem;
}
.button-info:hover {
    background: #0073aa;
    color: #fff;
}



.nyekunder-company-selector {
    margin: 1rem 0;
}
.nyekunder-filters {
    margin-bottom: 1rem;
}
.nyekunder-company-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 4px;
    background: #fafbfc;
}
.nyekunder-company-list li {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #eee;
}
.nyekunder-company-list li:last-child {
    border-bottom: none;
}


/* Gjør bransje-dropdown smalere */
#industry-filter {
    width: 500px;   /* Juster til ønsket bredde, f.eks. 180-240px */
    max-width: 100%;
}

/* Sett en minimumsbredde på størrelse-dropdown for bedre balanse */
#size-filter {
    min-width: 110px;  /* Juster etter behov */
    width: auto;
}






/* Stack filters vertically and reduce gap on mobile */
@media (max-width: 600px) {
    .nyekunder-filters {
        flex-direction: column !important;
        gap: 0.5rem !important;
        align-items: stretch;
    }
    .nyekunder-filters > div {
        width: 100%;
    }
    #industry-filter,
    #size-filter {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    .nyekunder-filters label {
        display: block;
        margin-bottom: 0.25em;
    }


    .target-group-card {
        padding: 1rem;
    }
    
    .group-stats {
        flex-direction: column;
        gap: 0.5rem;
    }

}




#logout-btn {
    border-color: #0073aa !important;
}

#logout-btn .button-secondary {
    color: #0073aa !important;
    background-color: #e7f1fa !important; /* Light blue background */
    border-color: #0073aa !important;
}

#logout-btn .button-secondary:hover {
    background-color: #0073aa !important;
    color: white !important;
}





.toggle-details {
    color: #0073aa !important; /* Dark blue instead of red */
}

.toggle-details.open {
    color: #005177 !important; /* Keep the darker blue for open state */
}

.company-details {
    background: #f7fafd;
    border-left: 3px solid #e1e8ed;
    padding: 0.5rem 1rem;
    border-radius: 3px;
}



/* Loading state for submit button */
#nyekunder-request-form button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Success/error messaging */
.nyekunder-message {
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}
.nyekunder-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}
.nyekunder-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}





/* Historikk-styling */
.email-history-list {
    max-height: 500px;
    overflow-y: auto;
}

.history-item {
    transition: box-shadow 0.2s;
}

.history-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#history-container h3 {
    text-align: center;
    color: #0073aa;
    margin-bottom: 1.5rem;
}

#back-to-search {
    display: block;
    margin: 1rem auto 0;
}



/* Tab button active state */
.button-info.active {
    background-color: #0073aa !important; /* Dark blue instead of red */
    color: white !important;
    border-color: #0073aa !important;
}

.button-info.active:hover {
    background-color: #005177 !important; /* Darker blue instead of red */
    border-color: #005177 !important;
}

/* Ensure tab buttons have consistent styling */
.button-info {
    transition: all 0.2s ease;
}




/* =========================== */
/* Email Preview Popup Styles */
#email-preview-popup .nyekunder-popup {
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}

.email-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

#email-preview-content {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1.5rem;
    background: #fff;
    margin: 1rem 0;
}

.email-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.email-header p {
    margin: 0.5rem 0;
    color: #666;
}

.email-body {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.email-signature {
    border-top: 1px solid #eee;
    padding-top: 1rem;
    color: #666;
    font-size: 0.9rem;
}

.email-signature p {
    margin: 0.3rem 0;
}

.popup-actions {
    text-align: center;
    margin-top: 1rem;
}

#preview-email-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

#preview-email-btn:hover {
    background-color: #5a6268;
}








/* Recently contacted company styling */
.company-restricted {
    display: inline-block;
    width: 20px;
    height: 20px;
    text-align: center;
    line-height: 20px;
}

.recently-contacted-message {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Styling for restricted companies */
li[data-recently-contacted="true"] {
    border-left: 3px solid #d63384;
    background: #fdf2f2;
}

li[data-recently-contacted="true"] .company-main {
    color: #6c757d;
}

/* Tooltip styling */
.company-restricted[title]:hover::after {
    content: attr(title);
    position: absolute;
    background: #333;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    margin-left: 1rem;
    white-space: nowrap;
    z-index: 1000;
}




/* Subscription required popup styling */
#subscription-required-popup .nyekunder-popup {
    text-align: center;
}

#subscription-required-popup ul {
    display: inline-block;
    text-align: left;
    margin: 0 auto;
}

#subscription-required-popup .button-primary {
    background-color: #28a745;
    border-color: #28a745;
}

#subscription-required-popup .button-primary:hover {
    background-color: #218838;
    border-color: #1e7e34;
}




/* Responsive button container with smaller spacing */
.nyekunder-button-container {
    display: flex;
    align-items: center;
    gap: 1rem; /* Reduced from 1.5rem */
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* Button text and icon setup - always show text, hide icons */
.button-text {
    display: inline;
}

.button-icon {
    display: none;
}

/* Tablet and small desktop screens */
@media (max-width: 768px) {
    .nyekunder-button-container {
        gap: 0.7rem; /* Reduced from 1rem */
    }
    
    .nyekunder-button-container .button {
        font-size: 0.9rem;
        padding: 0.6rem 0.9rem;
        flex: 1 1 auto;
        min-width: 0;
    }
}

/* Mobile devices - stack vertically and keep text */
@media (max-width: 480px) {
    .nyekunder-button-container {
        flex-direction: column; /* Stack vertically */
        align-items: stretch; /* Full width buttons */
        gap: 0.5rem; /* Reduced from 0.8rem */
    }
    
    .nyekunder-button-container .button {
        width: 100%; /* Full width */
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
        text-align: center;
    }
    
    /* Keep text visible on mobile */
    .button-text {
        display: inline;
    }
    
    .button-icon {
        display: none;
    }
}

/* Extra small screens - maintain vertical layout */
@media (max-width: 360px) {
    .nyekunder-button-container {
        gap: 0.3rem; /* Reduced from 0.6rem */
    }
    
    .nyekunder-button-container .button {
        padding: 0.7rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* Handle shorter text on very small screens */
@media (max-width: 320px) {
    .desktop-text {
        display: none;
    }
    .mobile-text {
        display: inline; /* Add the missing value */
    }
} /* Add the missing closing brace */











/* Style for disabled/guaranteed filters */
input[type="checkbox"]:disabled + small {
    font-style: italic;
    color: #888;
}

input[type="checkbox"]:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

label:has(input[type="checkbox"]:disabled) {
    color: #666;
    font-weight: normal;
}

/* Tooltip-style explanation */
.filter-guaranteed {
    position: relative;
}

.filter-guaranteed:hover::after {
    content: "Alle bedrifter i systemet har kontaktinformasjon";
    position: absolute;
    background: #333;
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 1000;
    top: -2rem;
    left: 0;
}






















/* =========================== */
/* TARGET GROUP EDITING COLORS - Change from red to dark blue */
/* =========================== */

/* Multi-select button styling - main dropdown buttons */
.multi-select-container .multi-select-button {
    background-color: white !important;
    border: 1px solid #0073aa !important; /* Dark blue border instead of red */
    color: #0073aa !important; /* Dark blue text instead of red */
}

.multi-select-container .multi-select-button:hover {
    background-color: #f0f8ff !important; /* Light blue hover */
    border-color: #005177 !important; /* Darker blue on hover */
}

/* When dropdown is open */
.multi-select-container .multi-select-button.open {
    background-color: #e7f3ff !important; /* Light blue when open */
    border-color: #0073aa !important;
    color: #005177 !important;
}

/* Selected text inside the dropdown button */
.multi-select-container .multi-select-button .selected-text {
    color: #0073aa !important; /* Dark blue text instead of red */
}

/* Arrow styling */
.multi-select-container .multi-select-button .arrow {
    color: #0073aa !important; /* Dark blue arrow instead of red */
}

/* Dropdown container */
.multi-select-dropdown {
    border: 1px solid #0073aa !important; /* Dark blue border */
}

/* Search input inside dropdowns */
.multi-select-search input {
    border: 1px solid #0073aa !important;
    focus: {
        border-color: #005177 !important;
        box-shadow: 0 0 0 1px #0073aa !important;
    }
}

/* Override any red colors in option items to dark blue */
.nyekunder-option-item {
    border-color: #e1e5e9 !important; /* Keep light border as default */
}

.nyekunder-option-item:hover {
    border-color: #0073aa !important; /* Dark blue hover instead of red */
    background-color: #f0f8ff !important; /* Light blue background */
}

.nyekunder-option-item:has(input[type="checkbox"]:checked),
.nyekunder-option-item.selected {
    background-color: #e7f3ff !important; /* Light blue when selected */
    border-color: #0073aa !important; /* Dark blue border when selected */
    color: #005177 !important; /* Darker blue text when selected */
}

/* Specific styling for when text shows "1-9 ansatte" etc. */
.multi-select-container .selected-text {
    color: #0073aa !important; /* Ensure selected text is dark blue, not red */
}

/* Form elements in target group builder */
#target-group-builder input[type="text"],
#target-group-builder textarea {
    border: 1px solid #ddd !important;
    focus: {
        border-color: #0073aa !important;
        box-shadow: 0 0 0 1px rgba(0, 115, 170, 0.2) !important;
    }
}

/* Save and Cancel buttons in target group editing */
#target-group-builder .button-primary {
    background-color: #0073aa !important; /* Dark blue instead of red */
    border-color: #0073aa !important;
    color: white !important;
}

#target-group-builder .button-primary:hover {
    background-color: #005177 !important; /* Darker blue on hover */
    border-color: #005177 !important;
}

#target-group-builder .button-secondary {
    background-color: #f8f9fa !important;
    border-color: #0073aa !important;
    color: #0073aa !important;
}

#target-group-builder .button-secondary:hover {
    background-color: #0073aa !important;
    color: white !important;
}

/* Preview button styling */
#preview-target-group {
    background-color: #6c757d !important; /* Gray for preview */
    border-color: #6c757d !important;
    color: white !important;
}

#preview-target-group:hover {
    background-color: #5a6268 !important;
    border-color: #5a6268 !important;
}

/* Any remaining red elements - catch-all */
#target-group-builder .text-danger,
#target-group-builder .btn-danger,
#target-group-builder .border-danger {
    color: #0073aa !important;
    border-color: #0073aa !important;
    background-color: transparent !important;
}













/* Search type selector styling */
#search-type-selector {
    transition: all 0.3s ease;
}

#search-type-selector label {
    transition: all 0.2s ease;
    padding: 0.5rem;
    border-radius: 4px;
}

#search-type-selector label:hover {
    background-color: rgba(0, 115, 170, 0.05);
}

#search-type-selector input[type="radio"]:checked + span {
    font-weight: 500;
    color: #0073aa;
}

/* Visual indicator for detected search type */
.detected-search-type {
    background-color: #e7f3ff !important;
    border: 1px solid #0073aa !important;
    color: #005177 !important;
    font-weight: 500 !important;
    animation: highlight-detection 0.5s ease-in-out;
}

@keyframes highlight-detection {
    0% { background-color: #ffeb3b; }
    100% { background-color: #e7f3ff; }
}

/* Mobile responsiveness for search type selector */
@media (max-width: 600px) {
    #search-type-selector > div {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    #search-type-selector label {
        justify-content: flex-start;
    }
}

