/* /assets/css/styles.css */

/* -------------------------------------------------------------------------- */
/*                                Base Styles                                 */
/* -------------------------------------------------------------------------- */

*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --primary-color: #4b89c5; /* Blue */
    --primary-hover: #3c77b3;
    --green-color: #4CAF50; /* Green */
    --green-hover: #45A049;
    --red-color: #f44336; /* Red */
    --red-hover: #e53935;
    --gray-color: #555555; /* Gray */
    --gray-hover: #333333;
    --error-color: #ff4d4d;
    --font-family: 'Open Sans', Arial, sans-serif;
    --font-size: 16px;
}

body,
h1, h2, h3, h4, h5, h6,
p,
label,
input, textarea, select,
button,
.error-message {
    font-family: var(--font-family);
}

body {
    margin: 0;
    padding: 0;
    font-size: var(--font-size);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f5f5f5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h2.section-content {
    margin-top: 0;
    text-align: center;
}

/* -------------------------------------------------------------------------- */
/*                                Header Styles                               */
/* -------------------------------------------------------------------------- */

header {
    background-color: #ecf0f1;
    padding: 1rem;
    width: 100%;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 73em;
    margin: 0 auto;
    height: 5em;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1rem;
}

.nav-links a {
    color: #000;
    text-decoration: none;
    font-weight: 600;
}

accountStatus {
    display: flex;
    justify-content: center;
    padding: 1rem;
}
accountStatus .notification {
    background-color: #fff8e1; /* Mild yellow background */
    border: 1px solid #ffecb3; /* Slightly darker yellow border */
    border-radius: 12px;
    padding: .5em 1em;
    color: #795548; /* Muted dark tone for text */
    font-size: .9em;
    max-width: 90%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}
accountStatus .notification a {
    color: #795548;
    text-decoration: underline;
}

accountStatus .notification-red {
    background-color: #ffebee; /* Mild red background */
    border: 1px solid #ef9a9a; /* Slightly darker red border */
    border-radius: 12px;
    padding: .5em 1em;
    color: #c62828; /* Darker red tone for text */
    font-size: .9em;
    max-width: 90%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

accountStatus .notification-red a {
    color: #b71c1c; /* Stronger red shade for links */
    text-decoration: underline;
}



/* -------------------------------------------------------------------------- */
/*                               Footer Styles                                */
/* -------------------------------------------------------------------------- */

footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 1rem;
    width: 100%;
    position: relative;
}

/* -------------------------------------------------------------------------- */
/*                             Main Content Styles                            */
/* -------------------------------------------------------------------------- */

main {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 1rem;
}

body.logged-in main {
    flex: 1;
    display: flex;
}

h2.section-content {
    margin-top: 0;
}

/* -------------------------------------------------------------------------- */
/*                             Login Page Styles                              */
/* -------------------------------------------------------------------------- */

.login-container {
    max-width: 400px;
    width: 100%;
    height: fit-content;
    padding: 2rem;
    margin: 0 auto;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.create-account-container {
    max-width: 400px; /* Match the login container's width */
    width: 100%;
    height: fit-content;
    padding: 2rem;
    margin: 20px auto; /* Adds spacing and centres the container */
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.container-wrapper {
    width: 100%;
    display: block; /* Ensures block layout for parent container */
}


.h1-title {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    margin-top: 0;
    font-size: 1.5rem;
    color: #333;
    font-weight: 600;
}

.logo-img {
    padding: .4em;
    height: 100px;
}

.login-logo {
    width: 40px;
    height: auto;
    margin-right: 0.5rem;
}

/* -------------------------------------------------------------------------- */
/*                               Form Styles                                  */
/* -------------------------------------------------------------------------- */

.form-group {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #555;
    font-weight: 600;
}

.form-group input, textarea,
.input-field,
.alias-input {
    width: 100%;
    padding: 0.8rem;
    font-size: 0.9rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-weight: 400;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
    margin-right: 1rem;
}

.form-row .form-group:last-child {
    margin-right: 0;
}

.section-content {
    position: relative;
}

/* Fieldset and Legend Styles */
.widget-settings-section {
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    background-color: #fff;
}

.widget-settings-section legend {
    font-weight: 600;
    font-size: 1rem;
    padding: 0 0.5rem;
}

.domain-settings-section {
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    background-color: #fff;
}

.domain-settings-section legend {
    font-weight: 600;
    font-size: 1rem;
    padding: 0 0.5rem;
}

/* -------------------------------------------------------------------------- */
/*                             Button Styles                                  */
/* -------------------------------------------------------------------------- */

.button {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: 600;
    text-align: center;
    width: fit-content;
}

.button:hover {
    opacity: 0.9;
}

.button-primary {
    background-color: var(--primary-color);
}

.button-primary:hover {
    background-color: var(--primary-hover);
}

.button-green {
    background-color: var(--green-color);
}

.button-green:hover {
    background-color: var(--green-hover);
}

.button-red {
    background-color: var(--red-color);
}

.button-red:hover {
    background-color: var(--red-hover);
}

.button-gray {
    background-color: var(--gray-color);
}

.button-gray:hover {
    background-color: var(--gray-hover);
}

.button-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

.button-large {
    padding: 0.6rem 1.2rem;
    font-size: 1.1rem;
}

/* -------------------------------------------------------------------------- */
/*                           Error and Success Messages                       */
/* -------------------------------------------------------------------------- */

.success-message,
.error-message {
    margin-top: 1rem;
    font-size: 0.9rem;
    text-align: center;
    font-weight: 600;
}

.success-message {
    color: green;
}

.error-message {
    display: none;
    color: var(--error-color);
    text-align: center;
    font-weight: 400;
    font-size: 0.85rem;
}

/* -------------------------------------------------------------------------- */
/*                            Dashboard Layout                                */
/* -------------------------------------------------------------------------- */

.dashboard-container {
    display: flex;
    flex: 1;
    min-height: calc(50vh - 60px);
    max-width: 80em;
}

.sidebar {
    width: 250px;
    background-color: #7f7f7f;
    color: #ecf0f1;
    flex-shrink: 0;
    transition: width 0.3s;
    border-top-left-radius: 1em;
    border-bottom-left-radius: 1em;
}

.menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu li {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #9c9c9c;
    color: #fff;
    position: relative;
}

.menu li.active,
.menu li:hover {
    background-color: #9c9c9c;
}

.menu > li:first-child:hover,
.menu > li:first-child.active {
    background-color: #9c9c9c;
    border-top-left-radius: 1em;
}


.menu li svg {
    margin-right: 10px;
    width: 15px;
    height: 15px;
}

.menu li span {
    flex: 1;
}

.content-area {
    flex: 1;
    padding: 20px;
    background-color: #ecf0f1;
    overflow-y: auto;
    border-top-right-radius: 1em;
    border-bottom-right-radius: 1em;
}

.loading-message {
    text-align: center;
    color: #7f8c8d;
}

/* Divider style */
.menu li.divider {
height: 3px;
}

.has-submenu {
    position: relative;
}

.has-submenu .arrow {
    display: inline-block;
    width: 12px;
    height: 12px;
    line-height: 12px;
    font-size: 20px;
    text-align: center;
    transform-origin: center center; /* Rotate from its exact centre */
    transition: transform 0.3s ease-in-out;
}


.has-submenu.open .arrow {
    transform: rotate(180deg);
}

/* Initially hide submenu */
.submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    background: #7f7f7f;
    transition: max-height 0.3s ease;
    border-bottom: 1px solid #9c9c9c;
}

/* When open, show submenu */
.submenu.open {
    max-height: 500px; /* Enough space for all submenu items */
}

.submenu li {
    display: flex;
    padding: 15px 20px;
    border-bottom: 1px solid #9c9c9c;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    padding-left: 35px;
}

.submenu li:hover {
    background-color: #9c9c9c;
}

/* -------------------------------------------------------------------------- */
/*                             Spinner Styles                                 */
/* -------------------------------------------------------------------------- */

.spinner {
    width: 40px;
    height: 40px;
    margin: 50px auto;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.form-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.form-loading-overlay .spinner {
    width: 50px;
    height: 50px;
    border-width: 5px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* -------------------------------------------------------------------------- */
/*                             Toggle Switch Styles                           */
/* -------------------------------------------------------------------------- */

.switch {
    position: relative;
    display: inline-block;
}

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

.switch .slider {
    position: absolute;
    cursor: pointer;
    transition: .4s;
    border-radius: 34px;
}

.switch .slider:before {
    position: absolute;
    content: "";
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.switch input:checked + .slider {
    background-color: var(--green-color);
}

.switch input:not(:checked) + .slider {
    background-color: var(--red-color);
}

.switch input:checked + .slider:before {
    transform: translateX(calc(100% + 4px));
}

.switch input:not(:checked) + .slider:before {
    transform: translateX(0);
}

.switch-small {
    width: 40px;
    height: 20px;
}

.switch-small .slider {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.switch-small .slider:before {
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
}

.switch-large {
    width: 60px;
    height: 30px;
}

.switch-large .slider {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.switch-large .slider:before {
    height: 26px;
    width: 26px;
    left: 2px;
    bottom: 2px;
}

/* -------------------------------------------------------------------------- */
/*                             Color Picker Styles                            */
/* -------------------------------------------------------------------------- */

input[type="color"] {
    padding: 0;
    border: none;
    background: none;
    height: 34px;
    width: 60px;
    cursor: pointer;
}

.pickr .pcr-button {
    margin-right: .5em;
    height: 2.5em !important;
    width: 2.5em !important;
    border: 1px solid #000;
}

/* -------------------------------------------------------------------------- */
/*                              Select Styles                                 */
/* -------------------------------------------------------------------------- */

.styled-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

/* -------------------------------------------------------------------------- */
/*                              Table Styles                                  */
/* -------------------------------------------------------------------------- */

.styled-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.styled-table th, .styled-table td {
    border: 1px solid #ccc;
    padding: 0.8rem;
    text-align: left;
}

.styled-table th {
    background-color: #f5f5f5;
    font-weight: 600;
}

.styled-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.styled-table tr:hover {
    background-color: #eaeaea;
}

/* -------------------------------------------------------------------------- */
/*                           Domain Settings Styles                           */
/* -------------------------------------------------------------------------- */

.domain-row {
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 1rem;
    padding-bottom: .5em;
    background-color: #fff;
    margin-bottom: 1rem;
}

.domain-header {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.domain-info {
    flex: 1;
}

.domain-name {
    font-weight: bold;
}

.domain-alias {
    margin-top: 5px;
    color: #666;
}

.arrow-icon {
    width: 24px;
    height: 24px;
    margin-left: auto;
    transition: transform 0.3s ease;
}

.arrow-icon.rotated {
    transform: rotate(180deg);
}

.action-panel {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    margin-top: 10px;
}

.action-panel.open {
    max-height: 1000px;
    opacity: 1;
}

.action-panel div {
    /*margin-bottom: 10px;
    display: flex;*/
    justify-content: flex-start;
    gap: 10px;
}


.action-panel .save-button {
    margin-top: 1rem;
}

/* -------------------------------------------------------------------------- */
/*                             Agents Settings Styles                         */
/* -------------------------------------------------------------------------- */

.salesperson-row {
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 1rem;
    padding-bottom: .5em;
    background-color: #fff;
    margin-bottom: 1rem;
}

.salesperson-header {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.salesperson-info {
    flex: 1;
}

.salesperson-name {
    font-weight: bold;
    font-size: 1.1rem;
}

.salesperson-email {
    margin-top: 5px;
    color: #666;
    font-size: 0.9rem;
}

.domains-list {
    display: flex;
    flex-direction: column;
}

.domains-list .option {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.domains-list .option input[type="checkbox"] {
    display: none;
}

.domains-list .custom-checkbox {
    position: relative;
    width: 40px;
    height: 20px;
    background-color: var(--red-color);
    border-radius: 10px;
    margin-right: 10px;
    cursor: pointer;
    flex-shrink: 0;
}

.domains-list .custom-checkbox:before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

.domains-list .option input[type="checkbox"]:checked + .custom-checkbox {
    background-color: var(--green-color);
}

.domains-list .option input[type="checkbox"]:checked + .custom-checkbox:before {
    transform: translateX(20px);
}

.domains-list .option span:last-child {
    font-size: 0.9rem;
    color: #333;
}

.action-panel .switch {
    margin-left: 0;
}

.action-panel .save-button {
    margin-top: 1rem;
}

.section-content {
    position: relative;
    overflow: visible;
}

.content-area {
    overflow: visible;
}

/* -------------------------------------------------------------------------- */
/*                                 Modal Styles                               */
/* -------------------------------------------------------------------------- */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 5px;
    position: relative;
}

.cancel-button {
    margin: 20px auto 0 auto;
    display: block;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 15px;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.modal h3 {
    margin-top: 0;
}

.modal .styled-table {
    width: 100%;
    margin-top: 1rem;
}

.modal .form-group {
    margin-bottom: 1rem;
}

.edit-salesperson-form .form-row {
    justify-content: center;
}

/* -------------------------------------------------------------------------- */
/*                             Widget Settings                                */
/* -------------------------------------------------------------------------- */

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

.color-picker-button {
    width: 34px;
    height: 34px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-right: 10px;
    background-color: #ffffff;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-container input[type="text"] {
    flex: 1;
    padding: 0.8rem;
    font-size: 0.9rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-weight: 400;
}

/* New styles for widget logo section */
.widget-logo-row {
    align-items: center;
}

.file-input-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.widget-logo-preview img {
    display: block;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: #fff;
    padding: 5px;
}

/* -------------------------------------------------------------------------- */
/*                             Responsive Styles                              */
/* -------------------------------------------------------------------------- */

@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .menu {
        display: block;
        padding: 0;
    }

    .menu li {
        width: 100%;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        padding: 10px 15px;
        border-bottom: 1px solid #34495e;
        height: 3em;
    }

    .menu li svg {
        margin-right: 10px;
    }

    .content-area {
        padding: 10px;
    }

    .form-row {
        flex-direction: column;
    }

    .form-row .form-group {
        margin-right: 0;
    }

    h2.section-content {
        margin-top: 1em;
    }

    .domain-row {
        padding: 0.5rem;
    }

    .domain-name {
        margin-bottom: 0.5rem;
    }

    .domain-alias {
        text-align: left;
    }

    .button {
        font-size: 0.9rem;
    }

    .button-small {
        padding: 8px 12px;
        font-size: 14px;
    }

    .salesperson-row {
        padding: 0.5rem;
    }

    .salesperson-name {
        font-size: 1rem;
    }

    .salesperson-email {
        font-size: 0.85rem;
    }

    .action-panel .form-row {
        flex-direction: column;
    }

    .action-panel .form-group {
        margin-right: 0;
    }

    .file-input-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .widget-logo-preview img {
        max-width: 100%;
        height: auto;
    }
}

@media (max-width: 480px) {
    .nav-links {
        display: none;
    }

    .menu li {
        font-size: 14px;
        padding: 8px 10px;
    }

    .menu li svg {
        width: 20px;
        height: 20px;
    }

    .content-area {
        padding: 5px;
    }
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    width: auto;
    max-width: 300px;
    padding: 10px 20px;
    border-radius: 5px;
    color: #fff;
    z-index:100010; 
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* ------------------------------ */
/* Centre the header logo on mobile */
/* ------------------------------ */
@media (max-width: 768px) {
  /* Make the whole nav row centre its primary content */
  nav {
    justify-content: center; /* desktop remains left via default rules */
  }

  /* Ensure the logo block can centre the image */
  .logo {
    width: 100%;
    text-align: center;
  }

  /* Prevent the <a> from stretching; keep image nicely centred */
  .logo a {
    display: inline-block;
  }
}

/* Optional: slightly reduce logo size on very small screens */
@media (max-width: 480px) {
  .logo-img {
    height: 100px;
  }
}

