/* Theme CSS for Stargazer Cloud
-------------------------------------------------- */

/* Table styling improvements */
.table-card {
    border-radius: 8px;
    background-color: #1C1C3A; /* Dark background for tables */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); /* Darker shadow for contrast */
    overflow: hidden;
}

.table-hover tbody tr:hover {
    background-color: rgba(90, 26, 117, 0.2); /* Subtle purple hover effect */
    transition: background-color 0.2s ease;
}

/* Add specific hover effect for sortable table headers in dark mode */
table.sortable > thead th:hover:not([data-defaultsort="disabled"]) {
    background-color: rgba(
        90,
        26,
        117,
        0.3
    ); /* Subtle purple hover effect for sortable headers */
    transition: background-color 0.2s ease;
}

.table th {
    background-color: #2a2a4a; /* Slightly lighter dark background for headers */
    border-top: none;
    font-weight: 500;
    color: #ffffff; /* White text for headers */
    padding: 12px 15px;
    vertical-align: middle;
}

.table td {
    padding: 10px 15px;
    vertical-align: middle;
    border-color: #3a3a5a; /* Darker border color */
    color: #cccccc; /* Light gray text for table data */
}

/* Highlighted event row */
body:not(.light-mode) .table-responsive .table tbody tr.highlighted-event {
    background-color: #4a1560; /* Darker purple, similar to btn-primary:hover */
    color: #ffffff; /* White text */
}

.table-responsive {
    border-radius: 8px;
    overflow-x: auto;
    width: 100%;
}

/* Make tables fill available space */
.table {
    width: 100%;
    table-layout: auto;
}

/* Distribute column widths more evenly */
.table th {
    min-width: 100px;
    white-space: nowrap;
}

/* Equipment table specific styles */
#equipment th,
#equipment td {
    width: auto;
}

#equipment th:first-child,
#equipment td:first-child {
    width: 20%;
}

#equipment th:nth-child(2),
#equipment td:nth-child(2) {
    width: 15%;
}

#equipment th:nth-child(3),
#equipment td:nth-child(3) {
    width: 20%;
}

/* Places table specific styles */
#places th,
#places td {
    width: auto;
}

/* Common table column distribution */
.table tbody td {
    white-space: nowrap;
}

.table a {
    color: #007447; /* Vibrant green for links */
    text-decoration: none;
    font-weight: 500;
}

.table a:hover {
    color: #005a35; /* Darker green on hover */
    text-decoration: underline;
}

/* Responsive table improvements */
@media (max-width: 768px) {
    .table-responsive {
        padding-bottom: 5px;
    }

    .table th,
    .table td {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
}

/* Table sorting icons */
table.sortable th:after {
    margin-left: 5px;
    opacity: 0.7;
}

/* Pagination styling */
.pagination {
    margin-top: 1rem;
}

.pagination .page-item.active .page-link {
    background-color: #5a1a75; /* Bright purple active pagination */
    border-color: #5a1a75;
}

.pagination .page-link {
    color: #5a1a75; /* Bright purple pagination links */
    background-color: #1C1C3A; /* Match card background */
    border-color: #3a3a5a; /* Match table border */
}

/* Button styling in tables */
.table .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Default primary button styling override */
.btn-primary {
    background-color: #5a1a75; /* Bright purple */
    border-color: #5a1a75; /* Bright purple */
    color: #ffffff; /* White text */
}

.btn-primary:hover {
    background-color: #4a1560; /* Darker purple on hover */
    border-color: #4a1560; /* Darker purple on hover */
    color: #ffffff; /* White text */
}

.btn-primary:focus,
.btn-primary.focus {
    box-shadow: 0 0 0 0.2rem rgba(90, 26, 117, 0.5); /* Purple focus outline */
}

.btn-primary.disabled,
.btn-primary:disabled {
    background-color: #5a1a75;
    border-color: #5a1a75;
    opacity: 0.65;
}

.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active,
.show > .btn-primary.dropdown-toggle {
    background-color: #4a1560;
    border-color: #4a1560;
}

/* Input field styling for dark mode */
body:not(.light-mode) .form-control {
    background-color: #2a2a4a; /* Darker background */
    color: #cccccc; /* Light gray text */
    border-color: #3a3a5a; /* Darker border */
}

body:not(.light-mode) .form-control::placeholder {
    /* Style placeholder text */
    color: #888e9a; /* Muted gray */
    opacity: 1; /* Ensure placeholder is visible */
}

body:not(.light-mode) .form-control:focus {
    background-color: #2a2a4a; /* Keep dark background on focus */
    color: #cccccc; /* Keep light gray text on focus */
    border-color: #5a1a75; /* Purple border on focus */
    box-shadow: 0 0 0 0.2rem rgba(90, 26, 117, 0.25); /* Subtle purple focus shadow */
}

/* Card styling for dark mode (e.g., on changelog page) */
body:not(.light-mode) .card {
    background-color: #1C1C3A; /* Dark background for cards */
    color: #cccccc; /* Light text for readability */
    border-color: #3a3a5a; /* Darker border */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* Darker shadow */
}

body:not(.light-mode) .card-body {
    color: #cccccc; /* Ensure text in card body is light */
}

body:not(.light-mode) .card-header {
    background-color: #171730; /* Darker background for card headers */
    border-bottom-color: #3a3a5a;
    color: #ffffff;
}

/* Dark mode modal styling */
body:not(.light-mode) .modal-content {
    background-color: #1C1C3A;
    color: #cccccc;
    border-color: #3a3a5a;
}

body:not(.light-mode) .modal-header {
    background-color: #171730;
    border-bottom-color: #3a3a5a;
}

body:not(.light-mode) .modal-footer {
    border-top-color: #3a3a5a;
}

body:not(.light-mode) .close {
    color: #cccccc;
    text-shadow: none;
}

body:not(.light-mode) .close:hover {
    color: #ffffff;
}

.carousel-container {
    background-color: #2a2a4a;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.carousel-item {
    height: 400px; /* Or any other fixed height */
}

.carousel-item img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

/* Dark mode styles for friend list in observation details */
body:not(.light-mode) .list-group-item {
    background-color: #1C1C3A !important; /* Match card background */
    color: #cccccc; /* Light text */
    border-color: #3a3a5a; /* Match card border */
}

body:not(.light-mode) .list-group-item a.btn-outline-danger {
    color: #dc3545;
    border-color: #dc3545;
}

body:not(.light-mode) .list-group-item a.btn-outline-danger:hover {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
}