/* General Styles */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #f8f9fa;
   /* overflow-y: auto;*/ 
}

/* Brand tokens (kept minimal to avoid conflicts) */
:root {
    --brand-accent: #FF9E03;
    --brand-accent-dark: #e67e00;
    --brand-accent-green: #0d5c33;
    --brand-accent-green-dark: #0b4c2a;
    --brand-accent-green-darker: #08351d;
    --brand-bg-warm: #FFF5E6;
    --radius-pill: 30px;
    --shadow-soft: 0 2px 4px rgba(0,0,0,0.08);
}

/* Locale dropdown hover/focus styling (shared markup via partial) */
.flag-icon {
    width: 18px;
    height: 18px;
    display: inline-block;
    flex: 0 0 auto;
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.10);
}
img.flag-icon { object-fit: cover; }
.locale-menu a:hover,
.locale-menu a:focus-visible {
    background: #fffbf5;
    background: color-mix(in srgb, var(--brand-bg-warm) 40%, #ffffff);
}
.locale-menu a.active {
    background: var(--brand-bg-warm);
}

/* Rounded orange brand button (match account "open-gen" look) */
.btn-brand {
    background: var(--brand-accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-pill);
    padding: 14px 40px;
    font-weight: 600;
    box-shadow: var(--shadow-soft);
    transition: background 120ms ease, transform 120ms ease;
}
.btn-brand:hover { background: var(--brand-accent-dark); transform: translateY(-2px); }
.btn-brand:active { transform: translateY(0); }
.btn-brand:disabled { opacity: .7; }

.btn-secondary:hover {
    background-color: #FF9E03;
    color: #fff;
    border-color: #bc7400;
}

constants {
    --bs-dropdown-link-hover-bg: #FFF7EB;
    --bs-dropdown-link-active-bg: #FFF7EB;
    --bs-dropdown-link-active-color: #FF9E03 !important;
    --bs-dropdown-link-color: #363636 !important;
    --bs-dropdown-link-hover-color: #FF9E03 !important;
}

 

#cropperModal .modal-body {
    min-height: 400px;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
#cropperImage {
    max-width: 100%;
    max-height: 58vh;
    width: auto;
    height: auto;
    display: block;
    margin: auto;
}

@media (min-width: 1268px) {
  #cropperModal .modal-dialog {
    max-width: 700px;
  }
  #cropperModal .modal-body {
    min-height: 500px;
    height: 70vh;
  }
  #cropperImage {
    max-height: 68vh;
  }
  
  /* Custom toggle button visibility for desktop (above 1268px) */
  .toggle-btn-desktop {
    display: inline-block !important;
  }
  .toggle-btn-mobile {
    display: none !important;
  }
}

@media (max-width: 1267px) {
  /* Custom toggle button visibility for mobile (1267px and below) */
  .toggle-btn-desktop {
    display: none !important;
  }
  .toggle-btn-mobile {
    position: absolute;
    left: 50%;
    top: 8px;
    transform: translateX(-50%);
    z-index: 1001;
    width: 300px;
    display: flex !important;
    justify-content: center;
    align-items: center;
    margin: 0;
  }
  
  /* Make navbar container use flexbox for proper centering */
  .navbar .container-fluid {
    display: flex;
    align-items: center;
  }
  
  /* Ensure hamburger menu stays on the right */
  .navbar-toggler {
    order: 2;
    margin-left: auto;
  }
  
  /* Center the toggle button container */
  .toggle-btn-mobile {
    order: 1;
  }
  
 

}

@media (max-width: 1267px) {
    .navbar .container-fluid,
    #navbarNav {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    width: 100% !important;
  }
  .navbar-nav {
    margin-left: auto !important;
  }
}
 

.preview-footer-container {
    position: relative;
}

.preview-footer-trigger {
    display: none;
}

#navbarPreviewFooterButton {
    background-color: var(--brand-accent-green);
    border-color: var(--brand-accent-green);
    color: #fff;
    box-shadow: 0 6px 16px rgba(13, 92, 51, 0.25);
    font-weight: 700;
}

#navbarPreviewFooterButton:hover,
#navbarPreviewFooterButton:focus {
    background-color: var(--brand-accent-green-dark);
    border-color: var(--brand-accent-green-dark);
    color: #fff;
}

#navbarPreviewFooterButton:active {
    background-color: var(--brand-accent-green-darker);
    border-color: var(--brand-accent-green-darker);
}

@media (max-width: 1268px) {
    body.cv-builder-page {
        padding-bottom: calc(90px + env(safe-area-inset-bottom, 0));
    }
    #navbarPreviewContainer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        background: #ffffff;
        box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.12);
        padding: 10px 16px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0));
        z-index: 1200;
    }
    #navbarPreviewContainer .preview-footer-trigger {
        display: inline-flex;
        justify-content: center;
        align-items: center;
        font-weight: 600;
    }
}

@media (min-width: 1269px) {
    #navbarPreviewContainer .preview-footer-trigger {
        display: none !important;
    }
}

/* Move scrollbar to the left */
.cv-editor-container {
    direction: rtl; /* This moves the scrollbar to the left */
    max-height: calc(100vh - 100px);
    max-width: 727px;
    /* Reserve scrollbar space at all times to prevent horizontal layout shift */
    overflow-y: scroll;
    margin: 0;
}
/* Force intrinsic width to reserve the full max-width even when current accordion
   content is narrow, preventing the container from shrinking based on shorter lines.
   Uses a zero-height pseudo-element instead of an extra markup div. */
.cv-editor-container::after {
    content: '';
    display: block;
    width: 727px;        /* matches max-width */
    max-width: 100%;
    height: 30px;           /* no vertical impact */
    pointer-events: none;
    visibility: hidden;  /* keep out of accessibility tree */
}
@media (max-width: 900px) {
    .cv-editor-container::after {
        width: 100%;     /* allow full fluid width on smaller screens */
    }
}

/* Ensure inner content retains normal left-to-right direction */
.cv-editor-container > * {
    direction: ltr;
}

/* Increase scrollbar width to 32px */
.cv-editor-container::-webkit-scrollbar {
    width: 32px;
}

.cv-editor-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}


.cv-editor-container::-webkit-scrollbar-thumb {
    background: #bbb; /* Gray scrollbar thumb */
    border-radius: 3px;
}

/* Sidebar Styles */
.sidebar {
    background-color: #FF9E03;
    color: #fff;
    height: 100vh;
    padding: 20px;
    position: fixed;
    width: 250px;
}

.sidebar a {
    color: #fff;
    display: block;
    margin: 10px 0;
    text-decoration: none;
}

.sidebar a:hover {
    text-decoration: underline;
}

/* Navbar Styles */
.navbar {
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    padding: 10px 20px;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.navbar .navbar-brand {
    color: #FF9E03;
    font-weight: bold;
}

.navbar .navbar-nav .nav-link {
    color: var(--bs-dropdown-link-color) !important;
}

.navbar .navbar-nav .nav-link:hover {
    color: #FF9E03;
}

.navbar .navbar-nav .dropdown-menu {
    right: 0;
}

.navbar .navbar-nav .dropdown-menu li a {
    color: #333 !important;
}

:root { --card-border-radius: 20px; }

/* Speed up accordion collapse/expand transitions */
.accordion {
    --bs-accordion-transition: height 0.18s ease;
}

.accordion .collapsing {
    transition: height 0.18s ease;
}

/* Ensure the header is relatively positioned */
.accordion-header {
    position: relative;
    background-color: transparent; /* show underlying container background */
}
 
 


 

.delete-item i {
    text-shadow: -1px -1px 0 #7a766f, 1px -1px 0 #7a766f, -1px 1px 0 #7a766f, 1px 1px 0 #7a766f;
}

/* Hide delete-item by default, show on hover for all entry-item accordions */
.entry-item .delete-item {
    visibility: hidden;
    position: absolute;
    right: 8px;
    top: 10px;
    cursor: pointer;
    color: #f1f1f1;
    z-index: 2;
    transition: color 0.2s;
    font-size: 0.84em;
    opacity: 0;
    z-index: 1000;
}

.entry-item:hover .delete-item {
    visibility: visible;
    color: #f1f1f1
}

/* Show when accordion is expanded or hovered */
.accordion-item.card-expanded .delete-item,
.accordion-header:hover .delete-item {
    opacity: 1;

}

/* --- Smaller delete (trash) icon variant ----------------------------------
   If you want the trash icon to appear smaller, we shrink the icon itself
   but keep a reasonable hit area (24x24) for accessibility. Adjust values
   below as desired. */
.entry-item .delete-item {
    width: 24px;               /* clickable area */
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.70em;         /* shrink inherited font size (affects <i>) */
}
.entry-item .delete-item i.fa-trash {
    font-size: 14px;           /* explicit control over icon size */
    line-height: 1;
}
/* For very fine pointers you can go even smaller if wanted */
@media (pointer: fine) {
    .entry-item .delete-item i.fa-trash { font-size: 20px; color: rgb(204, 132, 132); }
}
/* ------------------------------------------------------------------------- */


.entry-item .accordion-button {
    display: flex;
    align-items: center;
    gap: 10px;
}

.entry-item .drag-handle {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #c1ad99 !important;
    cursor: grab;
    opacity: 0.85;
    transition: color 0.2s, opacity 0.2s;
    flex-shrink: 0; 
}

.entry-item .accordion-button:hover .drag-handle {
    color: #a88768;
    opacity: 1;
}

.entry-item .drag-handle:active {
    cursor: grabbing;
}

.entry-item .drag-handle i {
    font-size: 16px;
}

.accordion-entry-title {
    flex: 1;
    text-align: left;
}

.drag-ghost {
    opacity: 0.6;
    background-color: rgba(255, 247, 235, 0.8);
}


.accordion-button {
    background-color: #FFF7EB; /* Default background color */
    color: #363636; /* Default text color */
    font-weight: bold;
    height: 44px;
}

.accordion-button:not(.collapsed) {
    background-color: var(--brand-bg-warm); /* Background color when expanded */
    color: #363636; /* Text color when expanded */
}
.accordion-button:focus {
    box-shadow: 0 0 0 0.2rem #f3e5d0
}

/* Rounded corners for accordion */
.btn-rounded,
.btn-rounded .accordion-button,
.btn-rounded .accordion-collapse,
.btn-rounded .accordion-body {
    border-radius: 0.75rem !important;
}

.accordion-item {
 
    background-color: transparent !important;
}
/* Remove double borders between items if you want a fully rounded look */
.btn-rounded .accordion-item {
    border: none;
    margin-bottom: 0.5rem;
    background-color: transparent;
}

/* Optional: Only round the top and bottom of the whole accordion */
.btn-rounded .accordion-item:first-child .accordion-button {
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
}
.btn-rounded .accordion-item:last-child .accordion-collapse,
.btn-rounded .accordion-item:last-child .accordion-button {
    border-bottom-left-radius: 0.75rem;
    border-bottom-right-radius: 0.75rem;
}

.btn-secondary {
    background-color: #FFFFFF;
    color: #FF9E03;
    border-color: #ddd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}


/* Accordion styled like card-header */
#styleControlsAccordion #headingStyleControls, #headingTemplateSelect,
#styleControlsAccordion #stylesAccordionButton {
  
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.2;
    padding: 0.75rem 0.25rem;
    color: #495057;
    box-shadow: none;
}

#stylesAccordionButton {
    padding: 0.75rem 1rem !important;
}

#styleControlsAccordion #styleControls, #styleControlsAccordion #templateSelect {
    border-radius: 1rem;
    border: none;
}

#styleControlsAccordion #styleControls {
    margin-bottom: 1rem;
}



#styleControlsAccordion #stylesAccordionButton:not(.collapsed) {
    background-color: #FFF7EB;
    color: #212529;
}
#styleControlsAccordion #styleControls .accordion-body {
    padding: 1.25rem;
    background: #fff;
    border-radius: 0 0 1rem 1rem;
}

#stylesAccordionButton {
    box-shadow: 0 0 0 0.2rem #FF9E03 !important;
}

#stylesAccordionButton:focus {
    box-shadow: 0 0 0 0.2rem #ffa616 !important;
}

#stylesAccordionButton {
    border-radius: 2rem !important; /* or 999px for pill shape */
    border-color: #E4981F !important; /* Change border color */
    color: #FFF7EB;
}

#styleControlsAccordion .accordion-header,
#styleControlsAccordion .accordion-item {
    border-radius: 0 !important; /* Remove parent rounding if present */
    overflow: visible !important; /* Prevent clipping */
}

 
/* Card Styles */
.card {
    border-radius: var(--card-border-radius) var(--card-border-radius) 0 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.card-header i {
    margin-right: 12px; /* Adjust the value as needed */
}

/* When collapsed, show all corners rounded */
.card-collapsed {
    border-radius: var(--card-border-radius); /* all corners rounded */
}

.card-expanded {
    border-radius: var(--card-border-radius); /* keep all corners rounded when expanded */
}

.card-header {
    font-size: 1.2em;
    background-color: #FF9E03;
    color: #fff;
    font-weight: bold;
    padding: 8px 20px;
}

.card-header:first-child {
    border-radius: var(--card-border-radius);
}

.card-body {
    padding: 20px;
    border-radius: 0 0 var(--card-border-radius) var(--card-border-radius);
}

/* CV editor: tighter padding only for the "Farvepaletter" section */
#collapseStyleControls > .card-body {
    padding: 5px;
}

/* Form Styles */
.form-label {
    font-weight: bold;
    margin-top: 5px;
}

.form-control {
    border-radius: 5px;
    margin-bottom: 10px;
}

.btn-primary {
    background-color: #FF9E03;
    border: none;
    border-radius: 5px;
}

.btn-primary:hover {
    background-color: #e67e00;
}

 

/* Hide scrollbar for Chrome, Safari and Opera */
.cv-editor-container::-webkit-scrollbar {
    width: 6px;
}

.cv-editor-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.cv-editor-container::-webkit-scrollbar-thumb {
    background: #FF9E03;
    border-radius: 3px;
}

/* Make body not scrollable, containers will scroll internally (except auth pages) */
body:not(.auth-page) {
    overflow: hidden;
}

/* Adjust container to be full height */
.container {
  /*  height: calc(100vh - 56px);*/ /* Account for navbar height */
    padding-bottom: 60px; /* Account for footer */
    margin-left: 0;
    margin-right: 0;
    max-width: 3000px;

}



.kompetence-list .badge {
    background: linear-gradient(45deg, #FF9E03, #E4981F);
    font-size: 1.0em;
    color: #fff;
    font-weight: 500;
    border-radius: 16px;
    padding: 0.5em 0.8em;
    margin-right: 0.8em;
    margin-bottom: 0.4em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.15s ease-in-out;
 
}

.kompetence-list .badge:hover {
    transform: translateY(-2px);
    background: #e67e00 !important;
}

.kompetence-list .badge .remove-kompetence {
    font-weight: bold;
    margin-left: 0.5em;
    cursor: pointer;
}

/* Example styling for the carousel thumbnail images */
.carousel-thumb {
    width: 152px;
    height: auto;
    border: 2px solid transparent;
    transition: border-color 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.carousel-thumb:hover {
    border-color: #718560;
}
.carousel-thumb.selected {
    border-color: #FF9E03;
    border-width: 3px;
    box-shadow: 0 4px 8px rgba(34, 108, 140, 0.3);
}

/* Responsive stacking for mobile */
@media (max-width: 1268px) {
    .row.gx-4.no-gutters {
        flex-direction: column !important;
        display: flex !important;
    }
    .cv-editor-container, .cv-preview-container {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        min-width: 0 !important;
        padding: 0 !important;
    }
    .cv-preview-container {
        display: none !important;
        min-height: 0 !important;
        height: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }
    .cv-preview-container.preview-mobile-visible {
        display: block !important;
        min-height: 400px !important;
        height: auto !important;
        padding: 20px 0 40px 0 !important;
        overflow: auto !important;
        align-items: unset !important;
        justify-content: unset !important;
    }
    .row.no-gutters > [class*='col-'] {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        display: block !important;
    }
    .row.no-gutters > [class*="col-"] {
        width: 100% !important;
        max-width: 100% !important;
    }
    .col-md-auto {
        width: 100% !important;
        max-width: 100% !important;
    }
}

.center-mobile {
    margin: 0 auto !important; 
}

.cv-preview-column {
    display: block;
}

.cv-preview-column.preview-column-hidden {
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
}

@media (max-width: 1268px) {
    .col.no-gutters {
        width: auto !important;
        max-width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: flex-start !important;
    }
    #cvPreviewOriginalParent {
        display: none !important;
    }
}

.cv-preview-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(100vh - 120px);
    padding: 20px;
    background-color: #f0f0f0;
    width: 100%;
    min-height: 100vh;
    background: #f0f0f0;
    overflow: auto;
}

/* Add a tiny spacer after the last A4 page so the bottom paper edge is visible when scrolled to the end */
#cvPreview::after {
    content: '';
    display: block;
    height: 150px; /* extra scroll space below the last page */
}

@media print {
    #cvPreview::after { display: none; }
}

.preview-container {
    background-color: #f0f0f0;
    width: 100%;
}

.row.no-gutters {
    margin-right: 0 !important;
    margin-left: 0 !important;
}

.row.no-gutters > [class*='col-'] {
    padding-right: 0 !important;
    padding-left: 0 !important;
    width:auto;
    max-width: 100%;
    min-width: 700px;
}
 
.a4-paper {
    width: 210mm;
    
    margin: 0 auto 0 auto;
    background: white;
    position: relative;
    overflow: hidden;
}

 

.cv-content {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

 

#fontSizeControlsForm .form-control-sm[type="number"] {
    width: 80px !important;
    min-width: 0;
    max-width: 80px !important;
    flex: 0 0 80px;
    display: inline-block;
}

/* Preview navbar flex layout for export/print/undo/redo */
.navbar-preview {
    border-bottom: 1px solid #e3e3e3;
    padding: 8px 16px 8px 16px;
    min-height: 48px;
    background: #ffffff; /* match site header */
    z-index: 10;
    display: flex;
    align-items: center;
    position: relative;
}
/* Ensure bootstrap helper classes don't override preview bar color */
.navbar-preview.navbar-light,
.navbar-preview.bg-light { background-color: #ffffff !important; }


/* Mobile preview modal helpers */
.cv-preview-modal-content {
    max-width: 100vw;
    height: 100dvh;
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: #fff;
}

/* Ensure the modal itself respects dynamic viewport height (iOS address bar) */
#cvPreviewModal,
#cvPreviewModal > div,
#cvPreviewModalContent {
    height: 100dvh !important;
}

#cvPreviewModalBody {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
}

#cvPreviewMobileCanvasHost {
    min-height: 0 !important;
}

.cv-preview-modal-content .cv-preview-container {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    overflow: auto;
    padding: 12px 0 32px;
}

.cv-preview-modal-content .cv-modal-sticky-topbar {
    padding: 12px 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}


