/* Apply new dark theme color palette */
html, body {
    background-color: #0D1117 !important;
    color: #C9D1D9 !important;
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    height: 100%;
}

div.navbar {
    background-color: #161B22 !important;
    padding: 0.75rem !important;
    border-bottom: 1px solid #30363D !important;
}

div.navbar div.container {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

div.navbar div.container a.navbar-brand {
    color: #C9D1D9 !important;
    font-size: 1.25rem !important;
    text-decoration: none !important;
}

div.navbar div.container a.navbar-brand:hover {
    color: #79C0FF !important;
}

div.navbar div.container div.nav-links ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    gap: 0.75rem !important;
}

div.navbar div.container div.nav-links ul li {
    display: inline !important;
}

div.navbar div.container div.nav-links ul li a {
    color: #C9D1D9 !important;
    text-decoration: none !important;
    font-size: 0.95rem !important;
    padding: 0.3rem 0.5rem !important;
    transition: color 0.3s !important;
}

div.navbar div.container div.nav-links ul li a:hover {
    color: #79C0FF !important;
}

div.navbar div.container div.nav-links ul li a.active {
    color: #79C0FF !important;
    border-bottom: 2px solid #79C0FF !important;
}

main {
    padding: 1rem 0;
}

/* Login page specific styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 60px);
    padding: 1rem 0;
}

.login-box {
    background-color: #161B22;
    padding: 1.5rem;
    border: 1px solid #30363D;
    border-radius: 6px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 0;
}

.login-form .form-item {
    display: flex;
    flex-direction: column;
}

.login-form input {
    padding: 0.5rem;
    background-color: #1A1F27 !important;
    color: #C9D1D9 !important;
    border: 1px solid #30363D !important;
    border-radius: 4px;
    font-size: 1rem;
}

.login-form label {
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
    color: #8B949E;
}

.login-form .btn {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    background-color: #3E5480 !important;
}

.login-form .btn:hover {
    background-color: #4A5E61 !important;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.welcome, .vmxss, .settings, .whitelist {
    background-color: #161B22;
    padding: 0.75rem;
    border: 1px solid #30363D;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.whitelist-note {
    font-size: 0.9rem;
    color: #C9D1D9;
    margin: 0.5rem 0;
}

.summary-box {
    background-color: #1A1F27;
    border: 1px solid #30363D;
    border-radius: 6px;
    padding: 0.5rem;
    margin-bottom: 1rem;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.95rem;
    color: #C9D1D9;
}

.summary-box span {
    font-weight: bold;
    color: #79C0FF;
}

.summary-box .btn {
    margin-left: 1rem;
}

.vmxss-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.search-form input {
    flex-grow: 1;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.form-item {
    display: flex;
    flex-direction: column;
}

.form-button {
    align-self: center;
}

.folder-list, .file-list, .whitelist-list {
    list-style: none;
    padding: 0;
}

.folder-list li, .file-list li, .whitelist-list li {
    margin: 0.15rem 0;
    padding: 0.3rem;
    border-bottom: 1px solid #30363D;
    line-height: 1.3;
    font-size: 0.9rem;
}

/* Alternating backgrounds for folders (list view) */
.folder-list li:nth-child(odd) {
    background-color: #1A1F27;
}

.folder-list li:nth-child(even) {
    background-color: #14171D;
}

/* Folder table styling */
.folder-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.75rem;
    table-layout: fixed;
}

.folder-table th,
.folder-table td {
    padding: 0.3rem;
    border: 1px solid #30363D;
    text-align: left;
    font-size: 0.9rem;
}

/* Define fixed column widths */
.folder-table th:nth-child(1),
.folder-table td:nth-child(1) {
    width: 40%;
}

.folder-table th:nth-child(2),
.folder-table td:nth-child(2) {
    width: 15%;
}

.folder-table th:nth-child(3),
.folder-table td:nth-child(3) {
    width: 15%;
}

.folder-table th:nth-child(4),
.folder-table td:nth-child(4) {
    width: 15%;
}

.folder-table th:nth-child(5),
.folder-table td:nth-child(5) {
    width: 15%;
}

.folder-table th {
    background-color: #1A1F27;
    color: #79C0FF;
}

.folder-table tbody tr:nth-child(odd) {
    background-color: #1A1F27;
}

.folder-table tbody tr:nth-child(even) {
    background-color: #14171D;
}

.folder-table a {
    color: #79C0FF !important;
    text-decoration: none;
}

.folder-table a:hover {
    color: #D2E6FF !important;
}

/* File table styling */
.file-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.75rem;
}

.file-table th,
.file-table td {
    padding: 0.02rem 0.1rem;
    border: 1px solid #30363D;
    text-align: left;
    font-size: 0.9rem;
}

.file-table th {
    background-color: #1A1F27;
    color: #79C0FF;
}

.file-table tbody tr:nth-child(odd) {
    background-color: #1A1F27;
}

.file-table tbody tr:nth-child(even) {
    background-color: #14171D;
}

.file-table .btn {
    margin-right: 0.02rem;
}

.file-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.folder-list a {
    color: #79C0FF !important;
    text-decoration: none;
}

.folder-list a:hover {
    color: #D2E6FF !important;
}

/* Match table styling */
.match-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.75rem;
    table-layout: fixed;
    font-size: 0.85rem; /* Smaller font size for compactness */
}

.match-table th,
.match-table td {
    padding: 0.2rem 0.3rem; /* Reduced padding for compactness */
    border: 1px solid #30363D;
    text-align: center; /* Center-align for better readability */
    white-space: nowrap; /* Prevent text wrapping */
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Define fixed column widths */
.match-table th:nth-child(1),
.match-table td:nth-child(1) {
    width: 20%; /* MERON */
}

.match-table th:nth-child(2),
.match-table td:nth-child(2) {
    width: 10%; /* WT */
}

.match-table th:nth-child(3),
.match-table td:nth-child(3) {
    width: 10%; /* LB */
}

.match-table th:nth-child(4),
.match-table td:nth-child(4) {
    width: 10%; /* WB */
}

.match-table th:nth-child(5),
.match-table td:nth-child(5) {
    width: 10%; /* Fight # */
}

.match-table th:nth-child(6),
.match-table td:nth-child(6) {
    width: 20%; /* WALA */
}

.match-table th:nth-child(7),
.match-table td:nth-child(7) {
    width: 10%; /* WT */
}

.match-table th:nth-child(8),
.match-table td:nth-child(8) {
    width: 10%; /* LB */
}

.match-table th:nth-child(9),
.match-table td:nth-child(9) {
    width: 10%; /* WB */
}

.match-table th {
    background-color: #1A1F27;
    color: #79C0FF;
}

.match-table tbody tr:nth-child(odd) {
    background-color: #1A1F27;
}

.match-table tbody tr:nth-child(even) {
    background-color: #14171D;
}

/* Ensure table fits within vmxss section */
.vmxss .match-table {
    overflow-x: auto; /* Allow horizontal scrolling if needed */
    display: block;
}

h1, h2, h3, h4 {
    color: #79C0FF !important;
    margin: 0.5rem 0;
}

.btn {
    background-color: #2A3D66 !important;
    color: #DDE1E5 !important;
    border: 1px solid #4A5E61 !important;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 0.85rem;
}

.btn:hover {
    background-color: #3E5480 !important;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

.pagination .btn {
    padding: 0.3rem 0.6rem;
}

.pagination .btn.active {
    background-color: #3E5480 !important;
    font-weight: bold;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8) !important;
    z-index: 1000;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    text-align: center;
}

.close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    color: #C9D1D9 !important;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-buttons {
    margin-top: 0.5rem;
    text-align: center;
}

.close-btn {
    background-color: #2A3D66 !important;
    color: #DDE1E5 !important;
    border: 1px solid #4A5E61 !important;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.close-btn:hover {
    background-color: #3E5480 !important;
}

#video-player, #image-viewer {
    max-width: 100%;
    max-height: 80vh;
}

form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

input, select, textarea {
    padding: 0.3rem;
    background-color: #161B22 !important;
    color: #C9D1D9 !important;
    border: 1px solid #30363D !important;
    border-radius: 4px;
    font-size: 0.85rem;
}

textarea {
    resize: vertical;
}

label {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.8rem;
    color: #8B949E;
}

/* Grid layout for forms with compact styling */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.grid-item {
    padding: 0.3rem;
    background-color: #1A1F27;
    border: 1px solid #30363D;
    border-radius: 4px;
}

/* Error messages */
.error {
    color: #F85149;
    font-size: 0.85rem;
}

/* Success messages */
.success {
    color: #2ECC71;
    font-size: 0.85rem;
}