﻿html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-top: 10px;
    margin-bottom: 0px;
}

/* Ensure all form fields align perfectly on the left */
.form-group {
    display: flex;
    align-items: center;
    gap: 8px; /* Spacing between label and input */
    width: 100%;
    margin-bottom: 4px; /* Reduce space between fields */
}

/* Labels get a fixed width but text is left-aligned */
.form-group label {
    width: 100px; /* Adjust width as needed */
    text-align: left; /* Left-align text */
    font-weight: bold;
    font-size: 14px;
    margin-right: 5px; /* Small gap between label & input */
}

/* Inputs align to the same start position */
.form-group input[type="text"] {
    flex-grow: 1;
    max-width: 400px;
    height: 24px;
    padding: 2px 5px;
    font-size: 14px;
    border: 1px solid #ccc; /* Restore border */
    border-radius: 3px; /* Smooth edges */
    background-color: white; /* Ensure it's not transparent */
}

/* ---------- UPDATED: Move action buttons to the right ---------- */
.button-container {
    display: flex;
    justify-content: flex-start; /* Move buttons to the left */
    gap: 10px;
    margin-bottom: 15px; /* Keep space below */
}

.button-container button {
    background: none;
    border: none;
    cursor: pointer;
}

.button-container button img {
    width: 32px;
    height: 32px;
}

/* ---------- NO CHANGES: Attachments section styling ---------- */
/* Right side: Attachments (50%) */
.attachments-container {
    flex: 2; /* Takes 75% of the space */
    max-width: 75%; /* Ensures balance with the input fields */
    background: #f9f9f9;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 10px; /* Add space below attachments box */
}

.attachments-container .attachments-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px; /* Adjust size as needed */
    font-weight: bold;
    margin: 0;
}

/* Make attachments scrollable */
#attachmentList {
    max-height: 180px; /* Slightly more space for scrolling */
    overflow-y: auto;
    list-style-type: none;
    padding: 0;
    margin: 0;
}

/* Ensure attachments use full width */
#attachmentList li {
    display: flex;
    align-items: center;
    gap: 10px; /* Space between icon & text */
    padding: 6px;
    border-bottom: 1px solid #ddd;
    white-space: nowrap; /* Prevents wrapping */
    overflow: hidden;
    text-overflow: ellipsis; /* Show '...' if text overflows */
}

#addAttachmentBtn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

#addAttachmentBtn img {
    width: 16px; /* Adjust size */
    height: 16px;
}

/* Styling icons */
#attachmentList img {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

/* Ensure links don’t wrap and use available space */
#attachmentList a {
    flex-grow: 1;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

#attachmentList a:hover {
    text-decoration: underline;
}

/* Styling the delete icon (bin) */
.deleteAttachment {
    width: 16px; /* Adjust size as needed */
    height: 16px;
    margin-left: auto; /* Ensures delete icon is always at the right */
    cursor: pointer; /* Show a pointer cursor for clarity */
    vertical-align: middle; /* Align it properly with the text */
    opacity: 0.7;
}

.deleteAttachment:hover {
    opacity: 1;
}

/* ---------- UPDATED: Align email fields upwards ---------- */
.email-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
}

/* Left side: Email input fields (50%) */
.email-fields {
    flex: 1; /* Takes 50% of the space */
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 50%; /* Ensures it does not take more space */
}

/* ---------- ADDED: New additional fields below email inputs ---------- */
.divider {
    width: 83%; /* Match the width of the email fields */
    height: 1px;
    background-color: #ccc; /* Light gray line */
    margin: 10px 0; /* Add spacing above and below */
}


.additional-fields {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Adjust the new additional fields to match email fields spacing */
.additional-fields .form-group {
    margin-bottom: 4px; /* Ensure same spacing as existing fields */
}

/* Ensure new form inputs match styling */
.additional-fields label {
    font-weight: bold;
    width: 100px;
}

.additional-fields input,
.additional-fields select {
    flex-grow: 1;
    max-width: 400px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Duration & Priority */

/* Ensure Duration and Priority sit properly */
.priority-duration-container {
    display: flex;
    align-items: center;
    gap: 15px; /* Adjust space between elements */
}

/* Ensure Duration aligns with DateTime and Regarding */
.duration-wrapper {
    display: flex;
    align-items: center;
}

.duration-wrapper label {
    flex-shrink: 0;
    width: 80px; /* Same width as other labels */
    text-align: left;
}

/* Move Duration input right */
#Duration {
    flex-grow: 1;
    min-width: 80px; /* Align with Date & Time */
    max-width: 200px;
    margin-left: 20px; /* Creates spacing without affecting label */
}

/* Adjust Priority to be closer */
.priority-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: .1px !important;
    margin-left: 5px !important;
    /* border: 1px solid red !important;  TEMPORARY - to check if it applies */
}

/* Priority label stays consistent */
.priority-wrapper label {
    font-weight: bold;
    white-space: nowrap;
    margin-right: -20px !important; /* Reduce unnecessary gap */
}

/* Reduce Priority dropdown width */
#Priority {
    min-width: 100px;
    max-width: 100px;
}

/* Move Priority label away from Duration */
.priority-label {
    white-space: nowrap;
    margin-left: 0px; /* Extra space from Duration */
    font-weight: bold;
}

/* Priority Dropdown - Align properly */
.priority-wrapper select {
    width: 120px;
    min-width: 110px;
    padding: 3px;
}

/*And Template Picker*/
/* New Template Wrapper aligned to the right */
.template-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Aligns vertically with other fields */
    margin-left: 35%; /* Pushes it to the right */
    min-width: 280px;
    max-width: 300px;
}

#templatePicker {
    width: 100%;
    padding: 5px;
    height: 32px;
    font-size: 14px;
}

/* end of priority & duration */

/* Ensure #email_from always has a visible border, even when empty */
#email_from {
    border: 1px solid #ccc; /* Consistent border */
    background-color: white; /* Prevent transparency issues */
    padding: 4px 5px;
    height: 26px; /* Ensure stable height */
    display: block;
    box-shadow: none; /* Remove unwanted shadows */
    outline: none; /* Remove hidden outlines */
}

#suggestions {
    position: absolute;
    background: #f9f9f9;
    border: none; /* No border unless items exist */
    max-height: 200px;
    overflow-y: auto;
    width: calc(100% - 2px);
    z-index: 1000;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
    padding: 0;
    display: none; /* Hidden when empty */
}

/* Show border only when suggestions exist */
#suggestions:not(:empty) {
    border: 1px solid #ccc;
    display: block;
}

/* Prevent any margin/border that might be affecting layout */
#suggestions div {
    padding: 8px;
    cursor: pointer;
    border-bottom: 1px solid #ddd;
    margin: 0;
}

#suggestions div:last-child {
    border-bottom: none;
}

/* ---------- NO CHANGES: Jodit read-only styling ---------- */
.jodit_readonly .jodit-wysiwyg {
    background-color: #f9f9f9; /* Light gray background for read-only mode */
    cursor: not-allowed; /* Show that it's not editable */
}

/* Disable buttons visually when needed */
button:disabled img {
    opacity: 0.5;
    cursor: not-allowed;
}

input[readonly], textarea[readonly] {
    background-color: #f0f0f0;
    color: #666;
}

/* Loading Notification Banner */
.loading-notification {
    position: relative;
    width: 100%;
    background-color: #d4edda; /* Light green background */
    color: #155724; /* Dark green text */
    padding: 10px;
    text-align: center;
    font-weight: bold;
    border: 1px solid #c3e6cb;
    margin-bottom: 10px;
    display: none; /* Initially hidden */
}



