/* ========== Base Layout ========== */
html, body {
    height: 100%;
    margin: 0;
}

body {
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 0;
}

main {
    flex: 1;
    position: relative;
    z-index: 1;
}

/* ========== Navigation Bar ========== */
.navbar .nav-link {
    position: relative;
    color: gray;
}

.navbar .nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 0%;
    background-color: #0056b3;
    transition: width 0.3s ease;
}

.navbar .nav-link:hover::after {
    width: 100%;
}

.nav-link.active::after {
    width: 100%;
    background-color: black;
}

/* ========== Common Components ========== */
.hero {
    border-bottom: 1px solid #e5e5e5;
}

.card {
    background-color: #F5F5F5;
    transition: transform 0.3s ease-in-out, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    transform: scale(1.05);
}

.login-box {
    background-color: #F5F5F5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.dashboard-search {
    background-color: #e0e0e0;
    color: #333;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.btn-search {
    background-color: #212529;
    color: white;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.btn-search:hover {
    background-color: #343a40;
    color: #fff;
}

.list-group-item:hover {
    background-color: #f0f0f0;
    color: #000;
}

.themed-table {
    background-color: #fff;
    color: #000;
    border-color: #dee2e6;
}

.themed-table th {
    color: #212529;
}

.themed-table td,
.themed-table th {
    background-color: transparent;
}

.themed-table a {
    color: #0d6efd;
}

.themed-table a:hover {
    text-decoration: underline;
}

.collection-preview-box {
    background-color: #f5f5f5;
    color: #333;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ========== Dark Mode ========== */
.dark-mode body {
    background-color: #1e1e1e;
    color: #f0f0f0;
}

.dark-mode .navbar {
    background-color: #2c2c2c !important;
}

.dark-mode .navbar-brand,
.dark-mode .navbar-brand:hover {
    color: #fff !important;
}

.dark-mode .nav-link {
    color: #ddd !important;
}

.dark-mode .nav-link.active::after {
    background-color: #f0f0f0;
}

.dark-mode footer {
    background-color: #2c2c2c;
    color: #aaa;
}

.dark-mode .card {
    background-color: #2a2a2a;
    color: #fff;
    border-color: #444;
}

.dark-mode .login-box {
    background-color: #2a2a2a;
    color: #fff;
}

.dark-mode .dashboard-search {
    background-color: #3a3a3a;
    color: #f0f0f0;
    border-color: #555;
}

.dark-mode .btn-search {
    background-color: #444;
    color: white;
}

.dark-mode .btn-search:hover {
    background-color: #5a5a5a;
    color: #fff;
}

.dark-mode .list-group-item {
    background-color: #2a2a2a;
    color: #f0f0f0;
    border-color: #444;
}

.dark-mode .list-group-item:hover {
    background-color: #3a3a3a;
    color: #fff;
}

.dark-mode .themed-table {
    background-color: #1e1e1e;
    color: #f0f0f0;
    border-color: #444;
}

.dark-mode .themed-table th {
    color: #ccc;
}

.dark-mode .themed-table td,
.dark-mode .themed-table th {
    background-color: transparent;
}

.dark-mode .themed-table a {
    color: #4ea8ff;
}

.dark-mode .themed-table a:hover {
    color: #90caff;
    text-decoration: underline;
}

.dark-mode .themed-table tr:hover {
    background-color: #333;
    color: #fff;
}

.dark-mode .collection-preview-box {
    background-color: #2c2c2c;
    color: #f0f0f0;
}

/* Inputs in general */
.dark-mode input,
.dark-mode textarea,
.dark-mode select {
    background-color: #333;
    color: #f0f0f0;
    border-color: #555;
}

/* Inputs when focused */
.dark-mode .form-control:focus {
    background-color: #3a3a3a;
    border-color: #666;
    color: #fff;
    box-shadow: none;
}

/* Placeholder in dark mode */
.dark-mode .form-control::placeholder {
    color: #aaa;
}

/* Inputs that are readonly or disabled */
.dark-mode input[readonly],
.dark-mode select[disabled],
.dark-mode textarea[readonly] {
    background-color: #2c2c2c;
    color: #ccc;
    border-color: #555;
    opacity: 1;
}

/* ========== Transitions ========== */
html, body,
.navbar,
.nav-link,
.list-group-item,
.themed-table,
.themed-table th,
.themed-table td,
.themed-table a,
footer,
input,
textarea,
select {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ========== Icons ========== */
#darkModeIcon {
    min-width: 1em;
}
