@import '_navigation.css';
@import '_typography.css';
@import '_variables.css';
@import '_transport_animation.css';
@import '_view_switcher.css';

/* Smooth transition */
.theme-transition * {
    transition:
        background-color 0.25s ease,
        color 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        fill 0.25s ease,
        stroke 0.25s ease;
}

.no-theme-transition * {
    transition: none !important;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* Global scrollbar (dark-mode friendly) */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--primary-color-rgb), 0.4) var(--bg-elevated);
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: var(--bg-elevated);
    border-radius: 10px;
}

*::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-color-rgb), 0.35);
    border-radius: 10px;
    border: 2px solid var(--bg-elevated);
}

.page-content {
    position: relative;
    z-index: 2;
    padding-bottom: 140px;
}

footer {
    position: relative;
    z-index: 1;
}

/* Page slide transitions */
.admin-page .page-content,
.nav-transition .page-content {
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
    will-change: transform, opacity;
}

.admin-page.admin-transition-enter .page-content,
.nav-transition.admin-transition-enter .page-content {
    transform: translateX(60px);
    opacity: 0;
}

.admin-page.admin-transition-back.admin-transition-enter .page-content,
.nav-transition.admin-transition-back.admin-transition-enter .page-content {
    transform: translateX(-60px);
    opacity: 0;
}

.admin-page.admin-transition-exit-forward .page-content,
.nav-transition.admin-transition-exit-forward .page-content {
    transform: translateX(-60px);
    opacity: 0;
}

.admin-page.admin-transition-exit-back .page-content,
.nav-transition.admin-transition-exit-back .page-content {
    transform: translateX(60px);
    opacity: 0;
}

/* Compact SweetAlert2 styling */
.swal2-popup {
    background: var(--bg-elevated) !important;
    color: var(--text-color) !important;
    border: 1px solid var(--border-color) !important;
}

.swal2-title,
.swal2-html-container {
    color: var(--text-color) !important;
}

.swal2-popup.swal2-sm {
    font-size: 0.85rem !important;
    border-radius: 8px;
}
.swal2-title.swal2-title-sm {
    font-size: 1rem !important;
    font-weight: 500;
}
.swal2-btn-sm {
    font-size: 0.8rem !important;
    padding: 6px 14px !important;
}

footer {
    /* position: fixed; REMOVED */
    /* bottom: 0; REMOVED */
    margin-top: auto;
    /* color: black; REMOVED */
    text-align: center;
    padding: 0;
    background-color: var(--bg-elevated); /* Added for theme consistency */
    color: var(--text-muted); /* Inherit from body or specific for footer */
    position: relative; /* Added for child absolute positioning */
    min-height: 100px; /* Added to ensure space for animation */
}

#main-nav {
    background-color: #206996 !important;
}

.card {
    background-color: var(--bg-elevated);
}

/* === Admin Database Info Bubble === */
.db-info-bubble {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 150px;
    right: 15px;
    background-color: var(--bg-elevated) !important;
    color: var(--text-color) !important;
    border-color: var(--border-color);
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-family: "Segoe UI", Roboto, sans-serif;
    z-index: 5000; /* stay above most UI */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    align-items: center;
    gap: 8px;
    transition: top 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

.db-info-bubble.dropdown-open {
    transform: translateY(var(--dropdown-height, 0px));
}

.db-info-bubble i {
    font-size: 1rem;
    transition: color 0.3s ease;
}

.db-info-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.db-info-text .db-name {
    font-weight: 600;
    color: var(--text-color);
}

.db-info-text .db-env {
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
}


.db-ok {
    color: #27ae60; /* green */
}

.db-fail {
    color: #e74c3c; /* red */
}

.status-ok {
    color: #27ae60;
    font-weight: 600;
}

.status-fail {
    color: #e74c3c;
    font-weight: 600;
}

#db-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}


/* Warning Database CSS */
.db-floating-warning {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 230, 0, 0.15);
    border: 1px solid rgba(255, 230, 0, 4);
    color: #ffe97a;
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 9999;
    box-shadow: 0 0 10px rgba(255, 230, 0, 0.3);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.db-floating-warning.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.db-floating-warning.visible {
    opacity: 1;
    transform: translateY(0);
}

.db-floating-warning svg {
    color: #ffd700;
    flex-shrink: 0;
}

#navbar-company-logo {
    height: 100px;
    width: auto;
    margin-left: 12px;
}

a,
.btn-link {
    color: var(--primary-color);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--primary-contrast);
}
.btn-add{
    height: 27px;
    display: flex;
    align-items: center;
    font-size: 12px;
    width: 27px;
    justify-content: center;
    margin-top: 12px;
    border: solid 2.3px var(--primary-color);
    transition: box-shadow 0.3s ease-in-out;
    position: relative;
    text-decoration: none;
}
.btn-add::before {
    font-family: "Font Awesome 6 Free";
    content: "\f067";
    font-weight: 900;
    color: var(--primary-color);
    transition: transform 0.3s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}
.btn-add:hover {
    box-shadow: 0 0 15px 5px rgba(var(--primary-color-rgb), 0.5);
}
.btn-add:hover::before {
    transform: rotate(90deg);
}
.btn-add.--text{
    margin-left: 116px;
    padding-top: 2px;
    padding-bottom: 3px;
}
.btn-add.--text h2 {
    position: absolute;
    left: -134px;
    top: -5px;
    transition: all 0.4s ease;
    border-radius: 11px;
    padding-inline: 3px;
    width: 150px;

}
.btn-add.--text:hover h2 {
    color: #111827;
}
.btn-add.--text p {
    position: absolute;
    left: -114px;
    top: -18px;
    color: red;
}

.blur-card {
    background: rgba(2, 6, 23, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* === Dropdown Styling === */
.dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
    background-color: var(--bg-elevated);
    /* Animation handled by Animate.css classes in HTML */
}

/* Ensure the menu clears the toggle icon */
.dropdown-hover .dropdown-menu {
    margin-top: 12px !important;
}

.dropdown-item {
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-color);
    transition: all 0.2s;
    font-weight: 500;
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-color);
}

.dropdown-item.text-danger:hover {
    background-color: #fee2e2;
    color: #dc2626;
}

/* === Password Toggle === */
.password-field {
    position: relative;
    display: block;
    width: 100%;
}

.password-field input[type="password"],
.password-field input[type="text"] {
    padding-right: 2.6rem;
}

.password-toggle {
    all: unset;
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    box-shadow: none;
    appearance: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 1.25rem;
    height: 1.25rem;
    display: grid;
    place-items: center;
}

.password-toggle:hover {
    color: var(--text-color);
}

.password-toggle,
.password-toggle:focus,
.password-toggle:active,
.password-toggle-icon {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* === Select Arrow (Single Icon) === */
.select-field {
    position: relative;
    display: block;
    width: 100%;
}

.select-field select {
    appearance: none;
    background-image: none !important;
    padding-right: 2.4rem;
}

.select-arrow {
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
    line-height: 1;
}

.select-arrow i {
    font-size: 0.85rem;
}


.db-bubble-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

#db-bubble-hide-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 2px 6px;
}

#db-bubble-show-btn {
    position: fixed;
    top: 150px;
    right: 15px;
    z-index: 4999;
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    border-right: none;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.db-info-bubble {
    transition: transform 0.4s ease-in-out;
}

.db-info-bubble.is-hidden {
    transform: translateX(calc(100% + 20px));
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 15px 5px rgba(var(--primary-color-rgb), 0.5);
    color: var(--primary-contrast) !important;
}

/* Custom Glow Button Style */
.btn-glow {
    background-color: var(--primary-color);
    color: var(--primary-contrast);
    border: 1px solid var(--primary-color);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: box-shadow 0.3s ease-in-out, background-color 0.3s;
}

.btn-glow i {
    transition: transform 0.3s ease-in-out;
    display: inline-block;
    width: 14px; /* Fixed width to prevent shifting */
    text-align: center;
    transform-origin: center;
}

.btn-glow:hover {
    box-shadow: 0 0 15px 5px rgba(var(--primary-color-rgb), 0.5);
    color: var(--primary-contrast);
    text-decoration: none;
}

.btn-glow:hover i {
    transform: rotate(90deg);
}
