/* ==========================================================================
   CSS Variables & Base Configuration
   ========================================================================== */
:root {
    --primary-color: #1E3A8A;
    --primary-light: #3B82F6;
    --secondary-color: #D3D4E3;
    --text-light: #FFFFFF;
    --border-color: #ccc;
    --border-light: #eee;
    --shadow-color: #888888;
}

/* ==========================================================================
   Body & Base Styles
   ========================================================================== */
body {
    padding-top: 50px;
    padding-bottom: 20px;
}

/* ==========================================================================
   Loading & Overlays
   ========================================================================== */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255,255,255,1);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border: 0.4em solid #007bff;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   CRM Shortcuts Styles
   ========================================================================== */
.crm-shortcuts {
    margin-top: 10px;
    margin-bottom: 10px;
}

.crm-shortcuts-buttons {
    display: flex;
    flex-direction: row;
    gap: 5px;
    justify-content: flex-start;
    font-size: 90%;
}

.crm-shortcuts-buttons .btn {
    text-align: center;
    padding: 3px 6px;
    font-size: 11px;
    border: 1px solid var(--border-color);
    background-color: #f8f9fa;
    min-width: 60px;
}

.crm-shortcuts-buttons .btn:hover:not(:disabled) {
    background-color: #e6e6e6;
    border-color: #adadad;
}

.crm-shortcuts-buttons .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f8f9fa;
    color: #6c757d;
}

/* CRM Shortcuts Notification */
.crm-shortcuts-notification {
    position: fixed;
    top: 60px;
    right: 20px;
    z-index: 1050;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    max-width: 300px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: none;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.crm-shortcuts-notification.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.crm-shortcuts-notification.warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.crm-shortcuts-notification.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.crm-shortcuts-notification.info {
    background-color: #d1ecf1;
    border: 1px solid #b8daff;
    color: #0c5460;
}

#loading-overlay .loading-text {
    margin-top: 20px;
    font-size: 1.2em;
    color: #333;
}

.loader {
    vertical-align: bottom;
    margin-left: 10px;
    display: none;
}

/* ==========================================================================
   Layout & Visibility
   ========================================================================== */
.authenticated-show,
#activityDetailsPanel,
#errorMessage,
#quoteTables {
    display: none;
}

@media (min-width:1200px) {
    .container {
        width: 1400px;
    }
}

/* ==========================================================================
   Typography
   ========================================================================== */
h2, .h2 {
    font-size: 20px;
}

.title {
    font-weight: 700;
    margin-top: 10px;
}

.activityDetails {
    font-size: 0.9em;
}

/* ==========================================================================
   Links & Interactive Elements
   ========================================================================== */
.offerTemplateLink,
.offerTemplateLink:hover,
.offerTemplateLink:active,
.offerTemplateLink:visited {
    color: var(--primary-color);
    text-decoration: underline;
}

.tooltiplink {
    border-bottom: 1px dashed #999;
}

/* ==========================================================================
   Select2 Components
   ========================================================================== */
.select2-container--default .select2-results > .select2-results__options {
    max-height: 400px;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #F0F1F2;
    color: #393A3B;
}

/* Reduce blank space in Select2 loading state */
.select2-results__option.loading-results {
    padding: 6px !important;
    min-height: auto !important;
}

.select2-results__option.loading-results .select2-results__message {
    margin: 0 !important;
    padding: 0 !important;
}

/* Sad and dirty CSS to maximize and align Opportunity Picker */
#opportunityPicker + span.select2 {
    width: 82% !important;
    margin-left: 65px;
}

/* Sad and dirty CSS to maximize and align Opportunity Picker */
#opportunityD365Picker + span.select2 {
    width: 82% !important;
    margin-left: 65px;
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.navbar-right {
    margin-right: 0;
}
.navbar-inverse {
    background-color: var(--primary-color);
    background-image: none;
}

.navbar-inverse .navbar-brand {
    color: var(--text-light);
}

.navbar-inverse .navbar-nav > li > a {
    color: var(--text-light);
}

.navbar-inverse .navbar-nav > .active > a,
.navbar-inverse .navbar-nav > .active > a:hover,
.navbar-inverse .navbar-nav > .active > a:focus {
    background-color: var(--secondary-color);
    background-image: none;
    box-shadow: none;
    color: #000;
}

.navbar-inverse .navbar-brand,
.navbar-inverse .navbar-nav > li > a {
    text-shadow: none;
}

.navbar > .container .navbar-brand,
.navbar > .container-fluid .navbar-brand {
    font-size: 1.5em;
    font-weight: 600;
}

.logo {
    float: left;
    margin-right: 25px;
}

.logo.thales-logo {
    height: 28px;
    margin-right: 20px;
    margin-top: 11px;
    background: white;
    padding: 5px 12px;
    border-radius: 6px;
    display: inline-block;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn-primary {
    background-image: linear-gradient(to bottom, var(--primary-light) 0, var(--primary-color) 100%);
    background-color: var(--primary-light);
    border-color: var(--primary-color);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-color);
    background-position: 0 -15px;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary.focus,
.btn-primary:active,
.btn-primary.active,
.open > .dropdown-toggle.btn-primary {
    border-color: var(--primary-color);
}

.btn-primary:active,
.btn-primary.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:disabled,
.btn-primary[disabled] {
    background-color: #2563EB;
}

.btn-primary.disabled,
.btn-primary[disabled],
fieldset[disabled] .btn-primary,
.btn-primary.disabled:hover,
.btn-primary[disabled]:hover,
fieldset[disabled] .btn-primary:hover,
.btn-primary.disabled:focus,
.btn-primary[disabled]:focus,
fieldset[disabled] .btn-primary:focus,
.btn-primary.disabled.focus,
.btn-primary.focus[disabled],
fieldset[disabled] .btn-primary.focus,
.btn-primary.disabled:active,
.btn-primary[disabled]:active,
fieldset[disabled] .btn-primary:active,
.btn-primary.disabled.active,
.btn-primary.active[disabled],
fieldset[disabled] .btn-primary.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

#btnGenerateOffer,
#btnClearAll {
    margin-top: 10px;
}

/* ==========================================================================
   Activity Components
   ========================================================================== */
#activityDescription {
    max-height: 208px;
    overflow: hidden;
    position: relative;
    text-align: justify;
}

#activityDetailsPanel {
    /* Prevent slideDown jQuery snapback glitch */
    overflow: auto;
}

#activityPreview {
    /* "Clearfix" */
    overflow: auto;
}

#activityPreview a {
    display: block;
    float: left;
    margin: 0 5px 5px 0;
    width: 74px;
    line-height: 0;
    border: 1px solid var(--border-color);
}

#activityPreview img {
    width: auto;
    max-width: 100%;
    height: auto;
    border: 0;
}

.activityItem {
    padding: 0 5px 0 8px;
    margin-bottom: 5px;
    border: 1px solid var(--border-light);
    background-color: var(--primary-color);
    color: var(--text-light);
    border-radius: 4px;
    box-shadow: 2px 2px 4px var(--shadow-color);
}

.activityItem:not(.placeholder),
.activityItem:not(.placeholder) label {
    cursor: pointer;
}

.activityItem .control-label {
    font-weight: normal;
}

.activityItem h4 {
    font-size: 13px;
    font-weight: 600;
}

.activityItem .form-group {
    margin-bottom: 5px;
    margin-left: 0;
}

/* Align left in forms */
.activityItem.form-horizontal .control-label {
    text-align: left;
    font-size: 12px;
}

#offerSummary {
    padding: 8px;
    background-color: var(--secondary-color);
    min-height: 100px;
    border-radius: 4px;
}

.placeholder {
    opacity: 0.7;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    min-height: 100px;
    text-align: center;
    padding: 25px 15px;
    margin: 10px 0;
    background-color: #fafafa;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.activityItem.placeholder h4 {
    font-size: 16px;
    font-weight: normal;
    margin-bottom: 10px;
    color: #666;
}

.placeholder p {
    font-size: 14px;
    color: #888;
    margin: 0;
    line-height: 1.4;
}

.readmore {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    margin: 0;
    padding: 30px 0;
    background-image: linear-gradient(to bottom, transparent, white);
}

/* ==========================================================================
   Forms
   ========================================================================== */
/* Get more space at the left of the forms of the first column */
.container .row div:first-child .form-horizontal .form-group {
    margin-left: -65px;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(30,58,138,.6);
}

/* Limit the space between the input fields in forms */
.form-group {
    margin-bottom: 5px;
}

.form-group.margin-left {
    margin-left: 20px;
}

/* Align the checkbox */
.control-label.form-check-label {
    padding-top: 0;
}

/* File input extended to see the complete filename */
#activityFileUpload {
    width: 100%;
}

/* Align Description */
#description,
#accountmanagername-input {
    position: relative;
    top: 7px;
}

/* Limit width of validity duration input group */
#validityduration-input {
    width: 80px !important;
}

/* Keep the input group table layout but limit its width */
.form-group:has(#validityduration-input) .input-group {
    width: 120px;
    display: table;
}

/* ==========================================================================
   Tooltips
   ========================================================================== */
.tooltip.top .tooltip-inner {
    background-color: var(--primary-color);
    opacity: 1;
}

.tooltip.top .tooltip-arrow {
    border-top-color: var(--primary-color);
}

.tooltip.in {
    opacity: 1;
}

/* ==========================================================================
   Alerts & Messages
   ========================================================================== */
.alert-warning {
    /* Make the text and the border more visible */
    color: #7a6034;
    border-color: #c69d55;
}

/* ==========================================================================
   Mobile Responsive Improvements
   ========================================================================== */
/* Mobile-first responsive design for form sections */
@media (max-width: 767px) {
    /* Reset negative margins on mobile */
    .container .row div:first-child .form-horizontal .form-group {
        margin-left: 0;
    }
    
    /* Stack form elements vertically on mobile */
    .form-horizontal .form-group .col-sm-5,
    .form-horizontal .form-group .col-sm-7 {
        width: 100%;
        float: none;
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Adjust label positioning on mobile */
    .form-horizontal .control-label {
        text-align: left;
        margin-bottom: 5px;
        padding-top: 0;
    }
    
    /* Improve spacing between form groups on mobile */
    .form-group {
        margin-bottom: 15px;
    }
    
    /* Adjust button group layout for language selection */
    .btn-group.col-sm-7 {
        width: 100%;
        display: block;
        margin-top: 5px;
    }
    
    /* Improve select2 dropdowns on mobile */
    #opportunityPicker + span.select2,
    #opportunityD365Picker + span.select2 {
        width: calc(100% - 30px) !important;
        margin-left: 0;
        margin-right: 15px;
    }
    
    /* Adjust validity duration input on mobile */
    .form-group:has(#validityduration-input) .input-group {
        width: 100%;
        max-width: 200px;
    }
    
    /* Improve form control sizing on mobile */
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Adjust container spacing on mobile */
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Improve section headers spacing on mobile */
    h2 {
        margin-top: 20px;
        margin-bottom: 15px;
    }
    
    /* First section should not have top margin */
    .form-horizontal h2:first-child {
        margin-top: 0;
    }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 991px) {
    /* Reduce negative margin on tablets */
    .container .row div:first-child .form-horizontal .form-group {
        margin-left: -30px;
    }
    
    /* Adjust select2 positioning on tablets */
    #opportunityPicker + span.select2,
    #opportunityD365Picker + span.select2 {
        width: 75% !important;
        margin-left: 40px;
    }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
/* Mirror the shopping cart */
.glyphicon.glyphicon-shopping-cart {
    transform: scaleX(-1);
}

#projectmanagement {
    margin-bottom: 0;
}

/* ==========================================================================
   Overlays & Modals
   ========================================================================== */
#signin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Quote Details & Product Tables
   ========================================================================== */
/* Quote Details Heading */
.quote-details-heading {
    line-height: 1.4;
}

.quote-details-heading-account {
    font-size: 0.9em;
    font-weight: normal;
    display: block;
    color: #666;
}

.quote-details-heading-quote {
    font-weight: bold;
    display: block;
}

.quote-details-no-products {
    text-align: center;
    padding: 20px;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    margin: 10px 0;
}

.quote-details-no-products p {
    margin: 0;
    font-style: italic;
    color: #666;
}

.quote-details-product-table {
    width: 100%;
    border: 1px solid #ccc;
    border-collapse: collapse;
}

.quote-details-product-table th {
    padding: 2px 8px 2px 2px;
    background-color: #f5f5f5;
    font-weight: bold;
    text-align: center;
    border: 1px solid #ccc;
}

.quote-details-product-table th:first-child {
    padding-left: 8px;
}

.quote-details-product-table td {
    padding: 2px;
    text-align: center;
    border: 1px solid #ccc;
}

.quote-details-work-packages {
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
}

.quote-details-work-packages h5 {
    margin: 0 0 10px 0;
}

.quote-details-work-packages select {
    width: 100%;
}

.quote-details-additional-info {
    margin: 10px 0;
    padding: 8px;
    border: 1px solid #ccc;
    background-color: #f5f5f5;
}

.quote-details-additional-info h6 {
    margin: 0 0 5px 0;
    font-weight: bold;
}

.quote-details-additional-info p {
    margin: 2px 0;
}

.quote-detail-work-package {
    margin: 5px 0;
    padding: 8px;
    border: 1px solid #ccc;
    background-color: white;
    border-radius: 3px;
}

.quote-detail-work-package-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quote-detail-work-package-info {
    flex: 1;
}

.quote-detail-work-package-info p {
    margin: 2px 0;
}

.quote-detail-work-package-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.quote-detail-work-package-controls label {
    margin: 0;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.quote-detail-work-package-controls .checkbox {
    margin-bottom: 4px;
}

.quote-detail-work-package-controls input[type="checkbox"] {
    margin-right: 5px;
}

/* ==========================================================================
   Opportunity Formatter
   ========================================================================== */
.opportunity-details {
    margin: 15px 0;
    padding: 10px;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    border-radius: 5px;
    cursor: pointer;
    user-select: none;
}

.opportunity-details-header {
    margin: 0;
    color: #333;
    font-weight: bold;
    transition: margin-bottom 0.3s ease-out;
    display: flex;
    align-items: center;
    line-height: 1;
    height: 20px;
}

.opportunity-details-toggle {
    margin-right: 5px;
    display: inline-block;
    width: 12px;
    height: 12px;
    transition: transform 0.3s ease-out;
    flex-shrink: 0;
}

.opportunity-details-content {
    margin: 0;
    padding: 0 0 0 20px;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out, margin-top 0.3s ease-out;
}

.opportunity-details-section h6 {
    margin: 10px 0 5px 0;
    color: #666;
    font-weight: bold;
    font-size: 14px;
}

.opportunity-details-section ul {
    margin: 0;
    padding: 0 0 0 20px;
}

.opportunity-details-section ul.nested {
    margin: 5px 0;
    padding-left: 20px;
}

.opportunity-details-section h6.quote-info {
    margin: 15px 0 5px 0;
    color: #666;
    font-weight: bold;
    font-size: 14px;
}

/* ==========================================================================
   Error Messages
   ========================================================================== */
.loading-text.error {
    color: #d9534f;
}

/* ==========================================================================
   Button Spacing
   ========================================================================== */
.btn-manage {
    margin-left: -15px;
}

.btn-upload {
    margin-left: -15px;
}

/* ==========================================================================
   Loader Images
   ========================================================================== */
.loader-image {
    height: 30px;
    vertical-align: middle;
}

/* ==========================================================================
   Quote Line Work Packages
   ========================================================================== */
/* Removed .quote-line-work-packages max-height limitation to allow expansion */

.quote-line-work-package {
    margin: 5px 0;
    padding: 8px;
    border: 1px solid #ccc;
    background-color: white;
    border-radius: 3px;
}

.quote-line-work-package .remove-work-package {
    font-size: 11px;
    padding: 2px 6px;
}

.quote-line-work-package label {
    font-weight: normal;
    margin-bottom: 0;
    font-size: 12px;
}

.quote-line-work-package input[type="checkbox"] {
    margin-right: 3px;
}

/* ==========================================================================
   Optional Checkbox Styling
   ========================================================================== */
input[type="checkbox"].optional,
.quote-detail-work-package-controls label,
.quote-detail-work-package-controls input[type="checkbox"] {
    cursor: pointer !important;
}

/* ==========================================================================
   Recent Quotes
   ========================================================================== */
.recent-quotes-list {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
    width: 100%;
    box-sizing: border-box;
}

#recentQuotesContainer {
    width: 100%;
    overflow: hidden;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.recent-quote-item {
    padding: 5px 8px;
    border-bottom: 1px solid #e1eaf5;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 13px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.recent-quote-item:hover {
    background-color: #e3f2fd;
}

.recent-quote-item:last-child {
    border-bottom: none;
}

.recent-quote-name {
    font-weight: 500;
    color: #2c3e50;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-quote-opportunity {
    color: #5a6c7d;
    font-size: 12px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-quote-account {
    color: #5a6c7d;
    font-size: 11px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-quote-date {
    color: #7b8a98;
    font-size: 11px;
    margin-top: 2px;
}

.loading-text {
    padding: 10px;
    text-align: center;
    color: #666;
    font-size: 12px;
}

/* Loading animation for components */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

.loading-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}


/* Quote details loading */
.quote-details-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.quote-details-loading .loading-spinner {
    width: 24px;
    height: 24px;
    border-width: 3px;
    margin-bottom: 10px;
}

/* Recent quotes loading */
.recent-quotes-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.recent-quotes-loading .loading-spinner {
    width: 20px;
    height: 20px;
    margin-bottom: 8px;
}

/* ==========================================================================
   Drag and Drop Styles
   ========================================================================== */

/* Quote Lines Container */
.quote-lines-container {
    min-height: 50px;
}


/* Work Package Drag Handle */
.work-package-drag-handle {
    color: #666;
    margin-right: 8px;
    cursor: grab;
    padding: 3px;
    border-radius: 2px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.work-package-drag-handle:hover {
    background-color: #e0e0e0;
    color: #333;
}

.work-package-drag-handle:active {
    cursor: grabbing;
}

/* Update work package header to include drag handle */
.quote-detail-work-package-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quote-detail-work-package-info {
    flex: 1;
    margin-left: 5px;
}

/* Drag States */
.work-package-being-dragged {
    opacity: 0.7;
    transform: rotate(2deg);
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    z-index: 999;
}

/* Drop Zone Highlighting */
.work-package-drop-zone {
    background-color: #e8f5e8;
    border: 2px dashed #4CAF50;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.work-package-drop-zone::before {
    content: "Drop work package here";
    display: block;
    text-align: center;
    color: #4CAF50;
    font-size: 12px;
    font-weight: bold;
    padding: 5px;
    margin: 5px 0;
    border-radius: 3px;
    background-color: rgba(76, 175, 80, 0.1);
}

/* Prevent drop zone indicator when container has work packages */
.work-package-drop-zone:not(:empty)::before {
    display: none;
}

/* Dragula mirror styling */
.gu-mirror {
    position: fixed !important;
    margin: 0 !important;
    z-index: 9999 !important;
    opacity: 0.8;
    list-style-type: none;
}

.gu-hide {
    display: none !important;
}

.gu-unselectable {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

.gu-transit {
    opacity: 0.2;
}

/* Enhance visual feedback during drag operations */
.quote-detail-work-package.gu-transit {
    border: 2px dashed #28a745;
    background-color: #f8fff8;
}

/* ==========================================================================
   Quote Line Reorder Modal
   ========================================================================== */

/* Reorder modal styling */
#reorderQuoteLinesModal .modal-dialog {
    max-width: 500px;
}

#reorderQuoteLinesModal .modal-body {
    max-height: 450px;
    overflow-y: auto;
}

/* Reorder list container */
.reorder-list {
    min-height: 100px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    background-color: #f9f9f9;
}

/* Individual reorder items */
.reorder-item {
    padding: 15px;
    margin: 8px 0;
    background-color: white;
    border: 2px solid #e3e6ea;
    border-radius: 6px;
    cursor: grab;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.reorder-item:hover {
    border-color: #007bff;
    box-shadow: 0 3px 8px rgba(0,123,255,0.2);
    transform: translateY(-1px);
    background-color: #f8fbff;
}

.reorder-item:active {
    cursor: grabbing;
}

.reorder-item-content {
    font-size: 14px;
    font-weight: 500;
}

.reorder-item-name {
    margin-bottom: 8px;
}

.reorder-item-name strong {
    color: #495057;
}

.reorder-item-details {
    margin: 0;
    padding: 0;
    list-style: none;
}

.reorder-item-details li {
    font-size: 11px;
    color: #6c757d;
    line-height: 1.4;
    font-weight: normal;
    margin: 3px 0;
    padding-left: 0;
}

/* Add drag indicator */
.reorder-item::before {
    content: "\e150";
    font-family: 'Glyphicons Halflings';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #dee2e6;
    font-size: 12px;
    line-height: 1;
    letter-spacing: 0;
    transition: color 0.2s ease;
    pointer-events: none;
}

.reorder-item:hover::before {
    color: #6c757d;
}

/* Dragging state for reorder items */
.reorder-item-dragging {
    opacity: 0.8;
    transform: rotate(3deg) scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.25);
    z-index: 1000;
    border-color: #28a745 !important;
    background-color: #f8fff8 !important;
    cursor: grabbing !important;
}

.reorder-item-dragging::before {
    color: #28a745 !important;
    content: "\e150" !important;
    font-family: 'Glyphicons Halflings' !important;
}

/* Quote line controls */
.quote-lines-controls {
    text-align: center;
}

.quote-lines-controls .btn {
    font-size: 13px;
    padding: 6px 12px;
}

/* Notification styling */
.quote-reorder-notification {
    margin-bottom: 15px;
    border-left: 4px solid #28a745;
}

.quote-reorder-notification.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

/* Mobile responsive adjustments for drag handles */
@media (max-width: 767px) {
    .work-package-drag-handle {
        padding: 2px;
        margin-right: 6px;
    }
    
    /* Adjust drop zone text for mobile */
    .work-package-drop-zone::before {
        font-size: 11px;
        padding: 3px;
    }

    /* Modal adjustments for mobile */
    #reorderQuoteLinesModal .modal-dialog {
        margin: 10px;
        max-width: none;
    }

    .reorder-item {
        padding: 12px;
        margin: 6px 0;
    }

    .reorder-item-content {
        font-size: 13px;
    }

    .reorder-item-name {
        margin-bottom: 6px;
    }

    .reorder-item-details li {
        font-size: 10px;
        line-height: 1.3;
        margin: 2px 0;
    }

    .reorder-item::before {
        right: 12px;
        font-size: 11px;
    }

    .quote-lines-controls .btn {
        font-size: 12px;
        padding: 5px 10px;
    }
}

/* Additional Services Section Styles */
#additionalServicesSection {
    border-top: 2px solid #e0e0e0;
    padding-top: 20px;
}

.additional-services-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.additional-services-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

#additionalServicesContent {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

#standaloneWorkPackageLabel {
    font-weight: normal;
}

.standalone-work-packages-container {
    min-height: 60px;
    padding: 10px;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-top: 10px;
}

.standalone-work-packages-container.work-package-drop-zone {
    background-color: #e8f5e8;
    border: 2px dashed #4CAF50;
}

.standalone-work-packages-container .quote-detail-work-package {
    margin: 8px 0;
    padding: 10px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.standalone-work-packages-container .quote-detail-work-package:hover {
    background-color: #eeeeee;
}

/* Standalone items removed from reorder modal - only quote lines can be reordered */

/* ==========================================================================
   Region Badges - Work Package Picker Integration
   ========================================================================== */
.region-badges-container {
    margin-top: 8px;
}

.region-badge {
    display: inline-block;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
    margin-right: 6px;
    margin-bottom: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.region-badge.region-global {
    background-color: #337ab7;
    color: white;
}

.region-badge.region-country {
    background-color: #5cb85c;
    color: white;
}

/* Work Package Preview Modal Styles */
.preview-thumbnail {
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
    padding: 5px;
    background: white;
}

.preview-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 2px;
    cursor: pointer;
}

.preview-thumbnail .page-number {
    text-align: center;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* Make modal body and images column use full height */
#workPackagePreviewModal .modal-body {
    height: calc(100vh - 120px);
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
}

#wp-preview-thumbnails {
    flex: 1;
    min-height: 0;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Ensure columns inside modal body stretch to full height */
#workPackagePreviewModal .modal-body > .row {
    flex: 1;
    display: flex;
}

#workPackagePreviewModal .modal-body > .row > .col-md-4,
#workPackagePreviewModal .modal-body > .row > .col-md-8 {
    display: flex;
    flex-direction: column;
}

#wp-preview-images {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

/* Preview info styles */
.info-row {
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
}

.info-label {
    font-weight: bold;
    color: #555;
    margin-right: 8px;
    min-width: 120px;
}

.info-value {
    flex: 1;
    color: #333;
}

.keyword-tag {
    display: inline-block;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 2px 8px;
    margin-right: 5px;
    margin-bottom: 5px;
    font-size: 12px;
}

.region-badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.wp-preview-actions {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}