/* ------------------------------------------------------
   Global resets and variable definitions
   ------------------------------------------------------ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/*noinspection CssUnresolvedCustomProperty*/
:root {
    --active-link-color: gray;
    --background-color: white;
    --border-color: lightgray;

    --button-bg: var(--bs-gray-400);
    --button-border: darkgray;
    --button-hover-bg: silver;
    --button-hover-border: darkgray;

    --primary-text-color: var(--bs-gray-800);
    --readonly-bg: whitesmoke;
    --secondary-button-bg: var(--bs-gray-200);
    --secondary-text-color: lightgray;
}

/* ------------------------------------------------------
   Typography and base styles
   ------------------------------------------------------ */
html, body {
    background-color: var(--background-color);
    color: var(--primary-text-color);
    font-family: "Helvetica", "Arial", sans-serif;
    font-size: clamp(0.85rem, 1vw, 1rem);
    letter-spacing: 0.03em;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

h1, p {
    margin-block-start: 0;
    margin-block-end: 0;
}

h1:not(:last-child), p:not(:last-child) {
    margin-block-end: 0.33em;
}

/* ------------------------------------------------------
   Links and interactive elements
   ------------------------------------------------------ */
a {
    color: gray;
    text-decoration: none;
}

a:focus, a:active {
    outline: none;
    text-decoration: underline;
}

a:hover {
    text-decoration: underline;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ------------------------------------------------------
   Form styles
   ------------------------------------------------------ */
.form-container {
    max-width: 480px;
    margin: 0 auto;
}

.form-wrapper {
    position: relative;
}

input::placeholder {
    color: var(--secondary-text-color);
}

input[readonly] {
    background-color: var(--readonly-bg);
    border: 1px solid var(--border-color);
    color: var(--secondary-text-color);
}

input[readonly]:focus {
    background-color: var(--readonly-bg);
    box-shadow: none;
    border-color: var(--border-color);
    color: var(--secondary-text-color);
}

.flatpickr-day.highlight-yellow {
   background: yellow;
   border-radius: 50%;
}

.flatpickr-day.highlight-yellow-dark {
    background: #fbc02d;
    border-radius: 50%;
}

/* ------------------------------------------------------
   Layout: header, main, and footer
   ------------------------------------------------------ */
body {
    display: flex;
    flex-direction: column;
    max-width: 100%;
}

header {
    color: white;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    padding: 10px 20px;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 100;
}

header nav {
    display: flex;
    justify-content: center;
}

header nav ul {
    display: flex;
    gap: 15px;
    justify-content: space-between;
}

header nav ul li a {
    display: inline-block;
    line-height: 1;
}

header nav ul li a.active {
    border-bottom: 3px solid currentColor;
    font-weight: bold;
    text-decoration: none;
}

header nav ul li a:hover {
    border-bottom: 3px solid currentColor;
    text-decoration: none;
}

.dropdown-menu {
    width: auto;
    min-width: unset;
}

.dropdown-item {
    color: gray;
    line-height: 1.6;
    width: auto;
    padding: 0.375rem 2rem 0.375rem 1rem;
}

.dropdown-item:hover {
    background-color: white;
    border-bottom: none;
    color: gray;
}

main {
    flex: 1;
    padding: 20px;
}

main .content-centered {
    margin: 0 auto;
    max-width: 800px;
}

main .content-centered#book {
    max-width: 480px;
}

main .content-centered#login {
    max-width: 240px;
}

footer {
    font-size: 14px;
    padding: 20px;
    position: static;
    text-align: center;
    width: 100%;
}

/* ------------------------------------------------------
   Buttons and interactive elements
   ------------------------------------------------------ */
.button-container {
    text-align: center;
    margin: 20px 0;
}

.btn.btn-primary {
    background-color: var(--button-bg);
    border-color: var(--button-border);
    color: var(--primary-text-color);
}

.btn.btn-primary:hover {
    background-color: var(--button-hover-bg);
    border-color: var(--button-hover-border);
    text-decoration: none;
}

.btn.btn-secondary {
    background-color: var(--secondary-button-bg);
    border-color: var(--button-border);
    color: var(--primary-text-color);
}

.btn.btn-secondary:hover {
    background-color: var(--button-hover-bg);
    border-color: var(--button-hover-border);
    text-decoration: none;
}

.collection-date[readonly] {
    background-color: white !important;
    color: var(--primary-text-color) !important;
    cursor: pointer;
    opacity: 1;
    pointer-events: auto;
}


/* ------------------------------------------------------
   Alerts & animations
   ------------------------------------------------------ */
.custom-msgbox-left-layout {
    display: flex;
    align-items: flex-start;
    text-align: left;
}

.custom-icon {
    align-items: center;
    display: flex;
    flex-shrink: 0;
    font-size: 1.875em;
    justify-content: center;
    padding: 1em 0.3em 0 0.8em;
}

.custom-icon i {
    font-size: 5rem;
}

.msg-box {
    border-radius: 15px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.8);
}

.shimmer-overlay {
    align-items: center;
    animation: shimmer 1.5s infinite linear;
    background: linear-gradient(
        90deg,
        #dddddd 25%,
        #eeeeee 50%,
        #dddddd 75%
    );
    border-radius: 15px;
    background-size: 200% 100%;
    color: #666666;
    display: flex;
    height: 100%;
    justify-content: center;
    left: 0;
    position: absolute;
    text-shadow: 1px 1px 2px white;
    top: 0;
    width: 100%;
    z-index: 10;

}

@keyframes shimmer {
    0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.swal2-actions button + button {
    margin-left: 0.5rem;
}

/* ------------------------------------------------------
   Logo and language switcher
   ------------------------------------------------------ */
#logo {
    margin-right: auto;
}

#logo img {
    filter: invert(66%);
    height: 40px;
}

#lang-switcher {
    color: gray;
    margin-left: auto;
    padding-left: 10px;
}

#lang-switcher li {
    margin-right: 0;
    display: inline-block;
}

#lang-switcher li + li {
    border-left: 1px solid gray;
    margin-left: 2px;
    padding-left: 6px;
    line-height: 0.9rem;
}

/* ------------------------------------------------------
   DataTables
   ------------------------------------------------------ */
table.dataTable th.no-sort {
    pointer-events: none;
    cursor: default;
}

table.dataTable th.no-sort::after,
table.dataTable th.no-sort::before {
    display: none;
}

table.dataTable td.actions-cell {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    align-items: center;
}

table.dataTable .action-btn {
    background: transparent;
    border: none;
    color: var(--primary-text-color);
    font-weight: 100;
}

/* ------------------------------------------------------
   Responsive design
   ------------------------------------------------------ */
@media (max-width: 768px) {
    body {
        font-size: 0.85rem;
    }

    header {
        padding: 10px 4%;
    }

    #logo img {
        height: 30px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 0.75rem;
        letter-spacing: 0.02em;
    }

    header {
        padding: 8px 3%;
    }

    #logo img {
        height: 25px;
    }
}
