/* ===============================
   Fonts & Global Styles
=================================*/
@font-face {
    font-family: 'Lexend Deca';
    src: url('../../assets/fonts/LexendDeca-VariableFont_wght.ttf') format('truetype');
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #f5f5f5;
    font-family: 'Lexend Deca', sans-serif;
    font-size: 16px;
    width: 100%;
}

h1 {
    font-size: 1.5rem;
    line-height: 1.5;
}

p {
    font-size: 1.2rem;
    line-height: 1.2;
}

/* ===============================
   Header & Navigation
=================================*/
.header {
    background-color: hsl(270, 23%, 18%);
    position: sticky;
    top: 0;
    z-index: 1000;
    color: white;
    padding: 0.8em;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.logo-img {
    width: 40px;
    height: auto;
    object-fit: contain;
}

.brand-name {
    font-size: 2rem;
    font-weight: 700;
    color: white;
}

/* Navigation Links */
.navbar-nav {
    display: none;
    list-style: none;
    gap: 1rem;
    flex-direction: column;
    background-color: #2f243a;
    padding: 1rem;
    margin: 0;
}

.navbar-nav.show {
    display: flex;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: auto 2rem;
    padding: 1em;
}

.nav-link a {
    color: white;
    text-align: center;
    transition: color 0.3s ease;
}

.nav-link a:hover {
    color: white;
}

.nav-link a.active {
    color: #a46860;
}

/* ===============================
   Mobile Menu (Hamburger)
=================================*/
.mobile-menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    padding: 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.mobile-menu-btn span {
    width: 100%;
    height: 3px;
    background-color: hsl(0, 0%, 90%);
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover span {
    background-color: hsl(0, 0%, 100%);
    transform: scaleX(1.1);
}

/* Toggle (X animation) */
.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translateY(8px);
}
.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}
.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translateY(-8px);
}

/* ===============================
   Forms
=================================*/
.form-section {
    padding: 1em;
    margin: 1rem;
}

.form-section-msg {
    font-size: 1rem;
    font-weight: 400;
    color: hsl(0, 1%, 44%);
    margin-bottom: 1rem;
}

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-check {
    margin: 0 1rem;
}

/* Inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="radio"],
input[type="checkbox"],
input[type="file"],
select,
textarea {
    position: relative;
    display: inline-block;
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
    background-color: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

select option[disabled]{
    color: #999;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: hsl(270, 50%, 40%);
    box-shadow: 0 0 0 3px hsl(270, 50%, 90%);
}

input[type="file"] {
    border: 2px solid #ccc;
    padding: 0.5em;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: rebeccapurple;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.t-c {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.t-c label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.95rem;
}

.t-c input[type="checkbox"] {
    margin-right: 1em;
    width: 16px;
    height: 16px;
}

.t-c .error-message {
    color: red;
    font-size: 0.85rem;
    margin-top: 4px;
}

.t-c a {
    margin-left: 0.2em;
    color: rgba(66, 50, 117, 0.9);
    text-decoration: underline;
}
.t-c a:hover {
    color: hsl(270, 50%, 50%);
    text-decoration: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: hsl(270, 23%, 40%);
    color: white;
    padding: 0.5em 1em;
    border: none;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.btn:hover {
    background-color: white;
    color: black;
}

/* Errors & Help */
.error-message {
    color: red;
    font-size: 0.85rem;
    margin-top: 4px;
}

.help-text {
    font-size: 0.85rem;
    color: #555;
    margin-top: 2px;
}


/* ===============================
   Tables
=================================*/
table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    display: none;
}

tr {
    display: block;
    background: #fff;
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

td {
    display: block;
    padding: 0.4rem 0;
    font-size: 0.9rem;
}

td::before {
    content: attr(data-label);
    font-weight: bold;
    display: block;
    margin-bottom: 0.2rem;
    color: #555;
}

/* Actions */
.actions {
    display: flex;
    gap: 2rem;
    margin-top: 0.6rem;
}
.actions i {
    font-size: 1.2rem;
    cursor: pointer;
    color: #666;
}
.actions i:hover {
    color: #000;
}
.actions .fa-trash-alt,
.actions .delete {
    color: #e63946;
}

/* ===============================
   Refresh
=================================*/
.refresh-container {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    padding: 0.5em;
    margin: 0.5rem auto;
}
.icons-container{
    display: flex;
    flex-direction: row-reverse;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}
.filter-icon, .sort-icon {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.1rem;
    font-weight: 600;
}
.filter-icon:hover, .sort-icon:hover{
    cursor: pointer;


}

.refresh-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 1.3rem;
    color: rebeccapurple;
    margin: 0.5rem 2rem;
    border:none;
    background:none;
}

.refresh-icon a {
    text-decoration: none;
    color: inherit;
}

.refresh-icon:hover {
    color: #0056b3;
}

/* ===============================
   Tickets
=================================*/
.tickets-container {
    width: 100%;
    padding: 1em;
    margin: 1.5rem auto;
}

.tickets-table {
    width: 100%;
    border-collapse: collapse;
}

.tickets-table thead {
    display: none;
}

.tickets-table tr {
    display: block;
    margin: 0.5rem 0;
    padding: 0.75rem;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tickets-table td {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

.tickets-table td::before {
    content: attr(data-label);
    font-weight: 600;
    margin-right: 0.5rem;
    color: #444;
}
.disabled{
    opacity: 0.4;
    pointer-events: none;
    cursor: not-allowed;
}
/* Tooltip*/
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%; /* place above the icon */
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 5px 8px;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
}


.user-email,
.user-message {
    color: #6c6b6b;
}

/* Status Labels */
.status {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    border-radius: 999px;
}
.status.open {
    background: #e6f4ea;
    color: #2e7d32;
}
.status.closed {
    background: #ffebee;
    color: #c62828;
}
.status.pending {
    background: #fff3e0;
    color: #ef6c00;
}

/*
   Modal
*/
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    width: 100%;
    height: 100%;
    padding-top: 1em;
    background-color: rgba(0,0,0,0.5);
    overflow: auto;
    align-items: center;
    justify-content: center;

}
.modal-title {
    display:none;
    margin: 0 0 1rem;
    font-size: 1.2rem;
    text-align: center;
}

.modal-content {
    position: relative;
    background: #fff;
    margin: auto;
    padding: 1.5em;
    border-radius: 12px;
    width: fit-content;
    max-width: 100%;
}
/*.modal-body {*/
/*    flex: 1;*/
/*    padding: 1rem;*/
/*    text-align: center;*/
/*}*/

/*.modal-controls {*/
/*    display: flex;*/
/*    justify-content: space-between;*/
/*    align-items: center;*/
/*    padding: 0.75rem 1rem;*/
/*    border-radius: 0.2rem;*/
/*    background: hsl(0, 0%, 95%);*/
/*}*/
.modal-controls{
    display: none;
    position: absolute;
    bottom: 10px;
    right: 10px;
    gap: 10px;
}
.modal-textarea{
    width: 100%;
    resize: none;
    margin-bottom: 1rem;
}

.delete-modal{
    width: 70%;
    max-width: 300px;
}
.modal.delete #closeModal{
    display: none;
}
.delete-confirmation  {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.delete-btn{
    color: #fff;
    padding: 0.2rem .5rem;
    margin-left: 0.5rem;
    background: red;
    border-radius: 12px;
    border:1px solid red;
    cursor: pointer;
}

.nav-btn, .download-btn {
    background: rebeccapurple;
    border: none;
    border-radius: 12px;
    color: #fff;
    padding: .5em .5em;
    font-size: 1rem;
    cursor: pointer;
}

.close {
    float: right;
    font-size: 1.8rem;
    color: #333;
    cursor: pointer;
    border: 2px solid lightgray;
    border-radius: 50%;
    padding: 0 0.5rem;
    margin: 0 0.2rem;
}

/* Another style of other modals*/
/* Modal base styles */
.style-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    width: 800px;
    border-radius: 8px;
    box-shadow: 0   8px 20px rgba(0,0,0,0.25);
    z-index: 1000;
    display: none;
    flex-direction: column;
    font-family: Arial, sans-serif;
    overflow: auto;
}

.style-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: hsla(270, 23%, 18%, 1);
    font-weight: bold;
    color: #fff;
}
.style-modal-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1rem;
    font-weight: 600;
}
.style-modal-body { padding: 16px; }
.style-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 16px;
}
.style-modal-footer button {
    padding: .2em .8em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}
.style-modal-footer button:first-child {
    background: none;
    border: none;
    color:hsla(3, 74%, 28%, 1);

}
.style-modal-footer button:last-child {
    padding:0 1em;
    background: hsla(270, 57%, 31%, 1);
    color: white;
}
.style-modal-footer button:last-child:hover {
    background: hsla(270, 57%, 10%, 1);
}
.add-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 16px;
}

.style-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    z-index: 999;
}
/* Rows */
.filter-row, .sort-row {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .5em;
}
.filter-row label, .sort-row label {
    margin-bottom: .4rem;
}
.filter-row select, .filter-row input,
.sort-row select {
    padding: .5em;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.trash {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.3em;
    margin-top: 1.5rem;
    border-radius: 4px;
    transition: background 0.2s ease;
}
.trash:hover { color: darkred; cursor: pointer; }

.btn-add {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem 1rem;
    border: none;
    background: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 1rem;
}

.btn-add:hover {
  cursor: pointer;
}

.close-filter-sort:hover {
    cursor: pointer;
    color: red;
}


/* For the toggle switch*/
.toggle-container{
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.storage-toggle{
    position: absolute;
    top:2rem;
    right: 1rem;
    gap: .5rem;
    margin: 1rem;
}
.btn-toggle{
    padding: .5em;
    background:hsla(270, 57%, 31%, 1) ;
    color: #fff;
    border-radius: 0.2rem;
    font-size: 1rem;
}
.btn-toggle:hover {
    background-color: hsla(270, 57%, 10%, 1);
    color: #fff;
    cursor: pointer;
}


.info-header {
    font-size: 1.2rem;
    text-align: center;
    padding: 0.5em;
    margin-bottom: 0.3rem;
}
.info-item {
    padding: 0.5em;
    margin: 0.5rem auto;
}

/* Toast*/
.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 2000;
}
.toast {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    color: #fff;
    font-size: 0.9rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    opacity: 0.95;
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.toast-success { background: #28a745; }
.toast-error   { background: #dc3545; }
.toast-warning { background: #ffc107; color: #000; }
.toast-info    { background: #17a2b8; }
.toast.fade-out {
    opacity: 0;
    transform: translateX(100%);
}

/* */
.form-field {
    position: relative;
    display: inline-block;
    width: 100%;
}
/*  */
.form-field input.input-error,
.form-field select.input-error,
.form-field textarea.input-error {
    border: 2px solid var(--error) ;
    background-color: #ffe5e9;
    padding-right: 2rem;
}

.form-field .error-icon {
    position: absolute;
    right: 8px;
    top:1.2rem;
    transform: translateY(-50%);
    font-size: 1rem;
    color: red;
    pointer-events: none;
    display: none;
}
.form-field > .error-icon,
.form-field i.error-icon {
    color: red !important;
}


.form-field textarea ~ .error-icon {
    top: 1rem;
    transform: none;
}

/* File input: keep the icon aligned right */
.form-field input[type="file"] ~ .error-icon {
    top: 0.8rem;
    transform: none;
}

/* Radios & checkboxes (icons below group, left aligned) */
.form-field input[type="radio"] ~ .error-icon,
.form-field input[type="checkbox"] ~ .error-icon {
    position: static;
    margin-left: 0.5rem;
    transform: none;
    vertical-align: middle;
}
/* Delete modal container */
.delete-modal {
    text-align: center;
    padding: 1.5em;
    max-width: 400px;
    margin: auto;
}

/* Header text inside delete modal */
.delete-modal .info-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: black;
    margin-bottom: 1.5em;
}

/* Confirmation buttons wrapper */
.delete-modal .delete-confirmation {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1em;
}

/* Cancel button */
.delete-modal .btn {
    min-width: 100px;
    padding: 0.5em 1em;
    font-size: 0.95rem;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

/* Cancel button (neutral) */
.delete-modal #cancelBtn {
    background-color: rebeccapurple;
    border: 1px solid #ccc;
    color: white;
}

/* Confirm delete button (danger) */
.delete-modal .delete-btn {
    background-color: #d9534f;
    border: 1px solid #c9302c;
    color: white;
}
.delete-modal .delete-btn:hover {
    background-color: #c9302c;
}

.delete-confirmation {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-medium);
}


/*
  Responsive Breakpoints
*/
/* Tablet (>=768px) */
@media (min-width: 768px) {
    .trial-nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
    }

    .navbar-nav {
        display: flex;
        flex-direction: row;
        margin: auto 3rem;
        padding: 0;
    }

    .nav-link {
        margin: 0;
        padding: 1em 0.6em;
        font-size: 1.2rem;
    }

    .nav-link a:hover {
        color: #a683ca;
        text-decoration: none;
    }

    .mobile-menu-btn {
        display: none;
    }

    .form-row {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .form-field {
        flex: 0 0 auto;
        max-width: 500px;
        width: 100%;
    }

    .form-label {
        flex: 0 0 200px;
        margin-bottom: 0;
        text-align: left;
        display: inline-block;
    }

    .form-check {
        display: flex;
        max-width: 100px;
        margin: auto 0.8rem;
    }

    .form-hints {
        display: flex;
        flex-direction: column;
        margin-top: .5rem;
        font-size: 0.85rem;
    }

    .form-btn {
        display: flex;
        gap: 2rem;
        padding: 0.5rem 0;

    }

    /* Tickets table*/
    /* On to p of the  table*/
    /* Container holding all active tags */
    .active-tags-container {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    /* Each individual tag */
    .active-tag {
        background-color:hsla(3, 74%, 28%, 1);
        display: inline-flex;
        align-items: center;
        gap:.2rem;
        color: #fff;
        font-size: 0.9rem;
        font-weight: 500;
    }

    .tag-number{
        display: flex;
        align-items: center;
        gap: .4rem;
        padding: 0.3rem;
        background: hsla(3, 74%, 28%, 1);
    }

    /* Delete icon container */
    .delete-tag {
        background-color: hsla(3, 74%, 20%, 1);
        cursor: pointer;
        display: flex;
        align-items: center;
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    /* Tickets table view */
    .tickets-container {
        padding: 2em;
        margin: auto;
    }

    .tickets-table thead {
        display: table-header-group;
        color: hsl(270, 23%, 40%);
        border-bottom: 3px solid hsl(270, 23%, 40%);
    }

    .tickets-table tr {
        display: table-row;
        border: none;
        background: none;
        box-shadow: none;
        padding: 0.75rem;
    }

    .tickets-table th {
        font-size: 1.5rem;
        font-weight: 600;
        border-bottom: 4px solid hsl(270, 23%, 40%);
        text-align: left;
    }

    .tickets-table td {
        display: table-cell;
        padding: 0.5rem;
        border-bottom: 2px solid darkgrey;
        text-align: left;
    }

    .tickets-table td::before {
        content: none;
    }
}

/* Desktop (>=1200px) */
@media (min-width: 1200px) {
    .header {
        font-size: 1.125rem;
    }
}
