/* Custom styles for the announcement section */
/* Custom styles for the announcement section */
#announcement-section {
  font-family: 'Arial', sans-serif;
}

/* Position the 'Add New Announcement' button to the right and increase its size */
#announcement-section .btn-primary {
  float: right; /* Move the button to the right */
  font-size: 14px; /* Larger font size */
  background-color: #007bff;
  color: white;
  padding: 12px; /* Larger padding */
  border: none;
/*  margin-bottom: 1rem;*/
  border-radius: 4px;
  box-shadow: none;
}

/* Clear float for subsequent elements */
#announcement-section:after {
  content: "";
  display: table;
  clear: both;
}

/* Custom styles for buttons inside the card */
#existing-announcements .btn {
  font-size: 16px; /* Increased font size for better visibility */
  padding: 10px 15px; /* Larger padding for a bigger button */
  margin: 5px; /* Add margin around buttons */
}

/* Modify styles for the 'Edit' and 'Enable/Disable' buttons */
#existing-announcements .btn-secondary,
#existing-announcements .toggle-status {
  font-size: 16px; /* Larger font size */
  padding: 10px 20px; /* Increased padding for a larger touch area */
}

/* Ensure these buttons are also floated to the right if needed */
#existing-announcements .card-body .text-right {
  display: flex;
  justify-content: flex-end; /* Align buttons to the right */
  gap: 10px; /* Add space between buttons */
}

/* Modal custom styles */
.modal-content {
  background-color: #fff;
  padding: 20px;
  border-radius: 4px;
}

.modal-header {
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
  margin-bottom: 20px;
  flex-direction: column;
}

.header-titles{
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.live-preview-main {
    position: relative;
    margin-top: 10px;
}

.modal-header .close {
  padding: 1rem;
  margin: -1rem -1rem -1rem auto;
}

.modal-footer {
  border-top: 1px solid #eee;
  padding-top: 10px;
  margin-top: 20px;
}

.modal-footer .btn {
  background-color: #28a745;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.modal-footer .btn:hover {
  background-color: #218838;
}

/* Live preview styles */
#live-preview {
  border: 1px solid #ddd;
  background-color: #f9f9f9;
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 15px;
  position: relative;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Optional shadow for depth */
}

/* Styles for title and description inside live preview */
#live-preview .title,
#live-preview .description {
  font-size: 1rem;
  color: #333;
}

#live-preview .description {
  font-size: 0.9rem;
  color: #666;
}

/* Style for the call to action button inside the live preview */
.cta-button {
  background-color: #ff4500;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 5px 15px;
  cursor: pointer;
  position: absolute;
  top: 15px;
  right: 15px;
}

.cta-button:hover {
  background-color: darken(#ff4500, 10%); /* Darken the button on hover */
}

/* Additional styles for existing announcements */
#existing-announcements .announcement {
  padding: 10px;
  border: 1px solid #e9ecef;
  border-radius: 0.25rem;
  margin-bottom: 0.5rem;
  background-color: #fff;
}

/* Styles for form labels */
#announcement-modal label {
  font-weight: bold;
  color: #555;
}

/* Custom styles for form elements */
#announcement-modal input[type="text"],
#announcement-modal input[type="url"],
#announcement-modal textarea,
#announcement-modal select {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  height: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.075); /* Optional: for some inner shadow to input fields */
}

/* Handling focus state for form elements */
#announcement-modal input[type="text"]:focus,
#announcement-modal input[type="url"]:focus,
#announcement-modal textarea:focus,
#announcement-modal select:focus {
    border-color: #6c1cff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgb(108 28 255 / 42%);
}

#loader {
    display: none; /* Hidden by default */
    position: fixed; /* Use fixed to position relative to the viewport */
    top: 50%; /* Center vertically */
    left: 50%; /* Center horizontally */
    transform: translate(-50%, -50%); /* Align center perfectly */
    z-index: 1051; /* Ensure it's above Bootstrap modal overlay */
}

.button-loader {
    display: inline-block;
    vertical-align: middle;
    width: 1.5em;
    height: 1.5em;
    border: 0.2em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: button-spin 0.75s linear infinite;
}

@keyframes button-spin {
    100% {
        transform: rotate(360deg);
    }
}


/* Toggle container that will hold both the switch and the loader */
.toggle-container {
    display: flex;
    align-items: center;
}

/* Loader Styles */
.toggle-loader {
    border: 4px solid #f3f3f3; /* Light grey */
    border-top: 4px solid #3498db; /* Blue */
    border-radius: 50%;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    animation: spin 2s linear infinite;
    display: none; /* Hidden by default */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


.notification-setting {
    display: flex;
    align-items: center;
    justify-content: space-between; /* This will push the label and switch apart */
    margin-bottom: 10px; /* Adjust as needed for spacing between settings */
}

.notification-label {
    flex-grow: 1;
    margin-right: 10px; /* Give some space between the text and the toggle */
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px; /* Width of the switch */
    height: 34px; /* Height of the switch */
    margin-left: auto; /* Push the toggle to the right */
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* For accessibility, focus styles are important */
input:focus + .slider {
    box-shadow: 0 0 1px #2196F3;
}


/* Optional: sizes for the slider */
.slider.small { width: 50px; height: 25px; }
.slider.small:before { width: 18px; height: 18px; }
.slider.large { width: 80px; height: 48px; }
.slider.large:before { width: 40px; height: 40px; }


/* Error Modal Style */
/* Modal size and centering */
#errorModal .modal-dialog {
    max-width: 400px;
    margin: 10% auto; /* Center vertically and horizontally */
}

#errorModal .modal-content {
    height: auto;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: center; /* Center the text */
}

/* Header styles */
#errorModal .modal-header {
    background-color: #d9534f; /* Red background */
    color: #fff; /* White text */
    padding: 15px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#errorModal .modal-title {
    font-size: 1.25rem;
    font-weight: bold;
}

/* Close button in the header */
#errorModal .close-modal-btn {
    background: none;
    border: 1px solid #fff;
    border-radius: 50%;
    font-size: 1rem;
    color: #fff;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal body styling */
#errorModal .modal-body {
    font-size: 1rem;
    color: #333;
    padding: 20px;
}

#errorModal .modal-footer {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Footer button styling */
#errorModal .modal-footer .btn {
    background-color: #6c757d;
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    border-radius: 5px;
    cursor: pointer;
    width: 30%;
}

#errorModal .modal-footer .btn:hover {
    background-color: #5a6268;
}

@media (max-width: 991px) {
    #announcement-live-preview {
        text-align: center;
        padding: 15px;
        margin: 0 auto;
    }

    .live-preview-title {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }

    .card.mb-3 {
        margin-bottom: 15px;
        border: 1px solid #e5e5e5;
        border-radius: 10px;
        padding: 15px;
    }

    .card-body {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .announcement-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .card-title {
        font-size: 1rem;
        font-weight: bold;
        margin-bottom: 5px;
    }

    .card-text {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }

    .buttons {
        width: auto;
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .modal-title {
        font-size: 1.5rem;
        text-align: center;
        margin-bottom: 20px;
    }

    /* Center elements in the modal */
    .modal-body {
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    #announcement-form {
        width: 100%;
        margin-top: 20px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    #dynamic-btn {
        text-align: center;
    }
}


/* General styling for the announcement cards */
/*.card.announcement {
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    margin-bottom: 20px;
    background-color: #fff;
    padding: 15px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
}*/

/* Left section (content) */
/*.card-left {
    flex: 1;
    min-width: 60%;
    padding-right: 15px;
}*/

/* Right section (buttons) */
/*.card-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
    gap: 10px;
}*/

/* Button styling */
/*.card-right .btn {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 10px;
    font-size: 0.9rem;
    border-radius: 5px;
    text-align: center;
    cursor: pointer;
    color: #fff;
    border: none;
    width: 100%;
}*/

/*.btn.view-listing {
    background-color: #6c1cff;
}

.btn.edit-announcement {
    background-color: #007bff;
}

.btn.delete-announcement {
    background-color: #dc3545;
}

.btn.toggle-status.btn-success {
    background-color: #28a745;
}

.btn.toggle-status.btn-danger {
    background-color: #ffc107;
    color: #333;
}*/

/* Responsive styling for mobile and tablet (below 992px) */
@media (max-width: 991px) {
    .card.announcement {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .card-left {
        width: 100%;
        padding-right: 0;
    }

    #existing-announcements .card-right {
        width: 100%;
        display: flex;
        flex-wrap: wrap; /* Allows buttons to wrap if there isn’t enough space */
        justify-content: center; /* Centers the buttons in the row */
        gap: 10px; /* Adds spacing between buttons */
        margin-top: 10px;
        flex-direction: row !important;
    }

    .card-right .btn {
        flex: 1 1 auto; /* Allows buttons to grow and shrink as needed */
        max-width: calc(25% - 10px); /* Ensures up to four buttons fit in one row */
        padding: 10px 15px;
        font-size: 0.9rem;
        text-align: center;
    }
}





/* Responsive styling for large screens (above 1200px) */
/*@media (min-width: 1200px) {
    .card.announcement {
        flex-wrap: nowrap;
        padding: 20px;
    }

    .card-left {
        padding-right: 30px;
    }

    .card-right {
        flex-direction: column;
        align-items: flex-end;
        gap: 15px;
    }
}*/

/*.marketing-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
}
.marketing-email-toggle {
    appearance: none;
    width: 40px;
    height: 20px;
    background: #ccc;
    border-radius: 20px;
    position: relative;
    outline: none;
    cursor: pointer;
    transition: background 0.3s;
}
.marketing-email-toggle:checked {
    background: #28a745;
}
.marketing-email-toggle:before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}
.marketing-email-toggle:checked:before {
    transform: translateX(20px);
}
.toggle-label {
    margin-left: 10px;
    font-weight: bold;
}
*/
/*.marketing-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 10px;
}

.marketing-email-toggle {
    appearance: none;
    width: 36px;
    height: 18px;
    background: #ccc;
    border-radius: 18px;
    position: relative;
    outline: none;
    cursor: pointer;
    transition: background 0.3s ease-in-out;
}

.marketing-email-toggle:checked {
    background: #28a745;
}

.marketing-email-toggle:before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease-in-out;
}

.marketing-email-toggle:checked:before {
    transform: translateX(18px);
}

.toggle-label {
    font-size: 14px;
    font-weight: bold;
    color: #333;
}
*/

