/* create_invoice.css */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #ffffff, #f4f4f4);
    z-index: -1;
}

body {
    font-family: Inter, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    padding-bottom: 150px;
    position: relative; /* For proper z-index stacking */
    min-height: 100vh;
    padding-bottom: 5em;
}

/* @media (min-width: 1200px) {
    body {
        padding-left: 100px;
        padding-right: 100px;
    }
} */

.input-group-text {
    height: 46px;
}

.edit-user-container {
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
}

.edit-form-container {
    border-radius: 20px;
    padding: 40px;
    padding-left: 4em;
    padding-right: 4em;
   
    background: #ffffff;
    box-shadow: 0 8px 20px -7px rgba(0, 0, 0, .1);
}

.edit-user-form .form-group {
    margin-bottom: 20px;
    max-width: 500px;
}

.edit-user-form .form-label {
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}

.edit-user-form .form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 16px;
    max-width: -webkit-fill-available;
}

.edit-user-form .errors {
    color: #dc3545;
    list-style-type: none;
    padding: 0;
    margin-top: 5px;
}

.form-actions {
    margin-top: 30px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.button, .svebtn, .cnclebtn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
}

.svebtn {
    background-color: #4a4a4a;
    color: #fff;
}

.cnclebtn {
    background-color: #f1f2f5;
    color: #4a4a4a;
}

.button:hover,
.svebtn:hover,
.cnclebtn:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.svebtn:hover {
    background-color: #3a3a3a;
}

.cnclebtn:hover {
    background-color: #e7e9eb;
}

.h2special {
    text-align: center;
    margin: 0 0 30px 0;
    font-size: 28px;
    font-weight: 700;
}

.flash-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-weight: 600;
}

.flash-message.error {
    background-color: #ffcccc;
    border: 1px solid #ff0000;
    color: #ff0000;
}

#projects {
    margin-bottom: 20px;
}

.project-entry {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-entry input,
.project-entry select,
.project-entry textarea {
    width: 100%;
    min-width: unset;
}

.remove-project {
    align-self: flex-start;
    margin-top: 4px;
}

.price-select {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background-color: #f1f2f5;
    color: black;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23131313%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 10px top 50%;
    background-size: 12px auto;
    white-space: normal;
    text-overflow: ellipsis;
    overflow: hidden;
    font-size: 16px;
    font-weight: 500;
}

.price-select option {
    white-space: normal;
    min-height: 2em;
    padding: 5px;
}

.price-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(71, 71, 71, 0.2); /* Adjust color and size as needed */
}

.marginbottom {
    margin-bottom: 1em;
}



.button.full-width {
    width: 100%;
    box-sizing: border-box;
}

.plus-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: #888888;
    border-radius: 6px;
    position: relative;
    margin-right: 8px;
}

.plus-icon::after {
    content: '+';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -58%);
    color: white;
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
}

.addprojectbutton {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 4px;
    background-color: #ffffff;
    border-radius: 8px;
    color: #888888;
    font-weight: 600;
    transition: background-color 0.2s ease;
    border: none !important;
}



.addprojectbutton svg {
    width: 20px;
    height: 20px;
    margin-top: -1px;
}




.project-buttons {
    display: flex;
    gap: 12px;
}

.minus-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: #888888;
    border-radius: 6px;
    position: relative;
    margin-right: 8px;
}

.minus-icon::after {
    content: '-';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -58%);
    color: white;
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
}





.button.full-width {
    width: 100%;
    box-sizing: border-box;
}

.margin-top {
    margin-top: 10px;
}

.form-check.form-switch {
    padding-left: 2.5em;
}

.form-check-input {
    cursor: pointer;
}

/* Remove all focus styles and blue highlights */
.form-check-input {
    outline: none !important;
    box-shadow: none !important;
}

.form-check-input:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.form-check-input:focus {
    outline: 0 !important;
    box-shadow: none !important;
    border-color: rgba(0, 0, 0, 0.25) !important;
}

/* Override Bootstrap's default focus states */
.form-check .form-check-input:focus {
    box-shadow: none !important;
    border-color: rgba(0, 0, 0, 0.25) !important;
}

.form-switch .form-check-input:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%280, 0, 0, 0.25%29'/%3e%3c/svg%3e") !important;
}

.form-switch .form-check-input:checked:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e") !important;
}



 .form-control {
    box-shadow: none !important;
    
}

.price-select {
    outline: none !important;
    box-shadow: none !important;
    border-color: rgba(0, 0, 0, 0.25) !important;
}






/* Custom validation tooltip */
/* Validation tooltip */
.validation-tooltip {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    font-size: 12px;
    background-color: white;
    color: black;
    padding: 6px 10px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15),
                0 8px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease-out;
    z-index: 1000;
    font-weight: 500;
    white-space: nowrap;
}

/* Add specific styling for invoice number tooltip */
.invoice-number .validation-tooltip {
    width: auto;
    white-space: nowrap;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
}

.invoice-number .show-validation-tooltip .validation-tooltip {
    transform: translateX(-50%) translateY(0);
}

.invoice-number .validation-tooltip::before {
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
}

@media (max-width: 767px) {
    .invoice-number .validation-tooltip {
        white-space: normal;
        width: 200px;
        text-align: center;
        left: 50%;
        transform: translateX(-50%) translateY(-4px);
    }

    .invoice-number .show-validation-tooltip .validation-tooltip {
        transform: translateX(-50%) translateY(0);
    }

    .invoice-number .validation-tooltip::before {
        left: 50%;
        transform: translateX(-50%) rotate(45deg);
    }
}

/* Add the caret */
.validation-tooltip::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 10px;
    width: 8px;
    height: 8px;
    background-color: white;
    transform: rotate(45deg);
    box-shadow: -1px -1px 1px rgba(0, 0, 0, 0.05);
}

.show-validation-tooltip .validation-tooltip {
    opacity: 1;
    transform: translateY(0);
}

.form-group, .project-entry {
    position: relative;
    margin-bottom: 24px;
}

.input-wrapper {
    position: relative;
}
.price-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.dollar-sign {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: black;
    z-index: 1;
    font-weight: 500;
}

/* Add more left padding to inputs with dollar signs */
.price-input-wrapper input[type="number"] {
    padding-left: 24px;
}


.price-input-wrapper .item-price {
    padding-left: 21px;
}

textarea.agreement-text-default {
    color: black !important;
    transition: color 0.2s ease-out;
}

textarea.agreement-text-default::placeholder {
    color: #A1A3A7 !important;
}

textarea.agreement-text-active {
    color: black !important;
    transition: color 0.2s ease-out;
}

#template_title::placeholder,
#agreement_text::placeholder {
    color: #A1A3A7 !important;
}


label {
font-weight: 600 !important;
margin-bottom: 5px;
}


.invoice-number {
    text-align: center;
    margin-bottom: 30px;
    margin-top: 1em;
}

.invoice-number h2 {
    font-size: 26px;
    font-style: normal;
    font-weight: 690 !important;
    letter-spacing: -0.8px;
}

.invoice-number-input {
    border: none;
    background: none;
    font-size: inherit;
    font-weight: inherit;
    font-family: inherit;
    width: 1ch;
    min-width: 1ch;
    text-align: left;
    padding: 0;
    margin: 0;
    -moz-appearance: textfield;
}

.invoice-number-input + .validation-tooltip {
    font-family: Inter, sans-serif;
    font-weight: 500;
    font-size: 12px;
    line-height: 1.5;
    letter-spacing: normal;
}

.invoice-number-input::-webkit-outer-spin-button,
.invoice-number-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.invoice-number-input:hover {
    outline: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.invoice-number-input:focus {
    outline: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}


@media (max-width: 475px) {
    .edit-form-container {
        padding-left: 2.4em;
        padding-right: 2.4em;
    }
}


.item-number h3{
    font-size: 23px;
    font-style: normal;
    font-weight: bold !important;
    letter-spacing: -0.8px;
}

.customurl {
    font-size: 23px;
    font-style: normal;
    font-weight: bold !important;
    letter-spacing: -0.8px;
}

.agreement-text {
    font-size: 23px;
    font-style: normal;
    font-weight: bold !important;
    letter-spacing: -0.8px;
}


.h2special h2 {
    font-style: normal;
    font-weight: 690 !important;
    letter-spacing: -0.8px;
    margin-bottom: 2em;
    margin-top: 1em;
}



.item-buttons {
    margin-top: 0.4em;
    display: flex;
    gap: 12px;
}


.additembutton {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 4px;
    background-color: #ffffff;
    border-radius: 8px;
    color: #888888;
    font-weight: 600;
    transition: background-color 0.2s ease;
    border: none !important;
    font-size: 14px;
}

.removeitembutton {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 4px;
    background-color: #ffffff;
    border-radius: 8px;
    color: #888888;
    font-weight: 600;
    transition: background-color 0.2s ease;
    border: none !important;
    font-size: 14px;
}


.minus-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    background-color: #888888;
    border-radius: 6px;
    position: relative;
    margin-right: 8px;
}

.minus-icon::after {
    content: '-';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -58%);
    color: white;
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
}

.plus-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    background-color: #888888;
    border-radius: 6px;
    position: relative;
    margin-right: 8px;
}

.plus-icon::after {
    content: '+';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -58%);
    color: white;
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
}


.input-group {
    display: flex;
    width: 100%;
    gap: 10px; /* This creates the gap between the username and input */
    align-items: center;
}

.input-group-prepend {
    flex-shrink: 0; /* Prevents the prepend from shrinking */
}

.input-group .input-wrapper {
    flex-grow: 1; /* Makes the input wrapper take up remaining space */
    width: auto; /* Allows the wrapper to flex */
}

.input-group-text {
    height: 46px;
    padding: 10px;
    background-color: #f1f2f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

/* This ensures the form-group maintains the same max-width as others */
.form-group .input-group {
    max-width: 500px;
}



.agreementtext {
    padding-top: 14px !important;
    padding-bottom: 14px !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
}


/* Remove blue outline on focus for all input types */
input:focus,
select:focus,
textarea:focus {
    outline: none !important;
    box-shadow: none !important;
    border-color: #ced4da !important;
}

/* Override autofill styles */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px white inset !important;
    -webkit-text-fill-color: black !important;
    transition: background-color 5000s ease-in-out 0s;
    background-color: white !important;
}

/* Ensure consistent border color */
.form-control {
    border: 1px solid #ced4da !important;
}

/* Remove focus ring from select elements */
select:focus {
    outline: none !important;
    box-shadow: none !important;
    border-color: #ced4da !important;
}


.price-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.dollar-sign {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    color: #000;
    pointer-events: none;
}

.item-price {
    padding-left: 25px !important;
}


.price-fields-wrapper {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 1em;
}

.price-fields-wrapper .input-wrapper {
    position: relative;
    width: 100%;
}

.price-fields-wrapper input {
    width: 100%;
}

/* Responsive styling for mobile */
@media (max-width: 768px) {
    .price-fields-wrapper {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.qty-field {
    margin-top: 1em;
    margin-bottom: 1em;
}

.qty-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
}

.qty-input {
    border: none;
    width: 5ch;
    min-width: 5ch;
    text-align: center;
    font-size: 16px;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    padding: 2px 4px;
    transition: width 0.15s ease-out, outline 0.2s ease-out;
    outline: 1px solid transparent;
    border-radius: 4px;
    box-sizing: border-box;
}

.qty-input:focus {
    outline: 1px solid rgba(0, 0, 0, 0.2);
}

.qty-input:hover:not(:focus) {
    outline: 1px solid rgba(0, 0, 0, 0.1);
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}



.qty-btn:hover {
    background-color: #e7e9eb;
}


.template-tags {
    margin-top: 12px;
    width: 100%;
}

.template-tags-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.template-tags-scroll::-webkit-scrollbar {
    display: none;
}

.template-tag {
    padding: 6px 16px;
    background-color: #f1f2f5;
    border: none;
    border-radius: 8px;
    color: #000000;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s ease;
    height: 32px;
    display: flex;
    align-items: center;
}



.template-tag:hover {
    background-color: #e7e9eb;
}



/* Agreement editor container */
.agreement-editor {
    position: relative;
}

.agreement-editor textarea[readonly] {
    cursor: default;
}

/* Editor action buttons container */
.editor-actions {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 2;
}

.editor-buttons {
    display: flex;
    gap: 8px;
}

/* Save template button */
.save-template-btn {
    padding: 6px 16px;
    background-color: #4a4a4a;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.save-template-btn:hover {
    background-color: #3a3a3a;
}

/* Delete template button */
.delete-template-btn {
    padding: 6px 12px;
    background-color: #f1f2f5;
    border: none;
    border-radius: 8px;
    color: #000;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.delete-template-btn:hover {
    background-color: #e7e9eb;
}

/* Close template button */
/* Close template button */
.close-template-btn {
    padding: 6px 16px;
    background-color: #f1f2f5;
    border: none;
    border-radius: 8px;
    color: #000;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.close-template-btn:hover {
    background-color: #e7e9eb;
}

.tooltip-container {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
}

/* Template chip/pill when in edit mode */
.template-tag.editing {
    background-color: #f1f2f5;
    color: black;
}


/* Template tag container */
.template-tag-container {
    position: relative;
    display: flex;
    align-items: center;
}


.agreement-editor {
    position: relative;
}

.edit-template-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background-color: #f1f2f5;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    padding: 0;
    transition: background-color 0.2s ease;
}

.edit-template-btn:hover {
    background-color: #e7e9eb;
}

.edit-template-btn svg {
    width: 16px;
    height: 16px;
}

.template-mode,
.editor-mode {
    display: flex;
    gap: 8px;
    position: absolute;
    bottom: 12px;
    right: 12px;
}

.template-mode .edit-template-btn,
.template-mode .delete-template-btn,
.editor-mode .save-template-btn,
.editor-mode .close-template-btn {
    position: static;
    padding: 6px 16px;
    background-color: #f1f2f5;
    border: none;
    border-radius: 8px;
    color: #000;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 80px;
}

.editor-mode .save-template-btn {
    background-color: #4a4a4a;
    color: white;
}

.editor-mode .save-template-btn:hover {
    background-color: #3a3a3a;
}

.template-mode .edit-template-btn:hover,
.template-mode .delete-template-btn:hover,
.editor-mode .close-template-btn:hover {
    background-color: #e7e9eb;
}

.template-mode .edit-template-btn svg {
    width: 14px;
    height: 14px;
}


.editor-buttons .input-wrapper {
    position: relative;
    margin-bottom: 0;
}

.editor-buttons .input-wrapper .validation-tooltip {
    top: auto;
    bottom: calc(100% + 5px);
}

.editor-buttons .input-wrapper .validation-tooltip::before {
    top: auto;
    bottom: -4px;
    transform: rotate(225deg);
}

.template-tag {
    background-color: #f1f2f5;
    transition: background-color 0.2s ease;
}

.template-tag.selected {
    background-color: #e7e9eb;
}




.qty-btn.add-template-btn .template-btn-text {
    font-size: 14px;
    font-weight: 500;
}

/* When button has text content */
.qty-btn.add-template-btn:has(.template-btn-text:not(:empty)) {
    width: auto;
    padding: 0 12px;
    justify-content: space-between;
    gap: 6px;
}

/* When button is just the plus */
.qty-btn.add-template-btn:has(.template-btn-text:empty) {
    width: 32px; /* Changed from 30px to 32px */
    padding: 0;
    aspect-ratio: 1; /* Added this */
}


.qty-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: none;
    background-color: #f1f2f5;
    color: #000;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    padding-top: 0;
    padding-bottom: 1px;
    line-height: 0;
}

.qty-btn.add-template-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 0;
    padding-bottom: 1px;
    transition: all 0.2s ease;
    height: 32px;
    line-height: 0;
    min-width: 32px; /* Added this */
}

.plus-container {
    line-height: 0;
    margin-top: -2px;
}

/* When there's no text, center the plus vertically */
.template-btn-text:empty + .plus-container {
    margin-top: -1px;
}


#template_title {
    padding: 10px 20px;
}

.widthspecific {
    min-width: 4px !important;
    max-width: 50px !important;
    padding: 6px 12px !important;
}