body { font-family: 'Segoe UI', Arial, sans-serif; background: #181c20; color: #f3f3f3; margin: 0;}
.container { max-width: 1200px; margin: 40px auto; background: #23272b; padding: 32px; border-radius: 10px; box-shadow: 0 2px 12px #0006; }
h1, h2 { text-align: center; margin-bottom: 32px; }
h2 { margin-top: 0; color: #f3f3f3; }
table { width: 100%; border-collapse: collapse; margin-top: 20px; }
th, td { padding: 15px; text-align: left; border-bottom: 1px solid #3a3f44;}
th { background: #2c3136; color: #aee; font-weight: 600; }
tr:nth-child(even) { background-color: #2c3136; }
tr:hover { background: #3a3f44; }
a { color: #6cf; text-decoration: none; }
a:hover { text-decoration: underline; color: #ffb347; }

#admin-panel input {
  padding: 8px;
  border: 1px solid #333;
  border-radius: 5px;
  background: #181c20;
  color: #f3f3f3;
}

#admin-panel button {
  padding: 8px 12px;
  border: none;
  border-radius: 5px;
  background: #6cf;
  color: #181c20;
  font-weight: bold;
  cursor: pointer;
  margin-left: 10px;
  transition: background-color 0.3s;
}

#admin-panel button:hover {
  background: #ffb347;
}

#back-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    background: #6cf;
    color: #181c20;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 20px;
    transition: background-color 0.3s;
}

#back-btn:hover {
    background: #ffb347;
}

.site-header {
  background: #23272b;
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 12px #0006;
}

#admin-panel {
    display: flex;
    align-items: center;
    gap: 20px;
}

.site-header h1 {
  margin: 0;
  font-size: 1.5em;
}

#admin-panel input {
  padding: 8px;
  border: 1px solid #333;
  border-radius: 5px;
  background: #181c20;
  color: #f3f3f3;
}

#admin-panel .toggle-button {
  padding: 8px 12px;
  border: none;
  border-radius: 5px;
  background: #6cf;
  color: #181c20;
  font-weight: bold;
  cursor: pointer;
  margin-left: 10px;
  transition: background-color 0.3s;
}

#admin-panel .toggle-button:hover {
  background: #ffb347;
}

/* Series Management Section */
#series-management-container {
    margin-top: 40px;
}

#add-series-form {
    display: flex;
    margin-bottom: 30px;
}

#add-series-form input {
    flex-grow: 1;
    padding: 12px;
    border: 1px solid #333;
    border-radius: 5px 0 0 5px;
    background: #181c20;
    color: #f3f3f3;
}

#add-series-form button {
    padding: 12px 20px;
    border: none;
    border-radius: 0 5px 5px 0;
    background: #6cf;
    color: #181c20;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

#add-series-form button:hover {
    background: #ffb347;
}

#add-series-form button.loading {
    color: transparent;
    pointer-events: none;
    position: relative;
}

#add-series-form button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid #181c20;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#series-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

#series-list li {
    background: #2c3136;
    padding: 15px;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#series-list button {
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    background: #e74c3c;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

#series-list button:hover {
    background: #c0392b;
}

.series-overview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px; /* Add some space below the header */
}

.series-overview-header h2 {
    margin: 0; /* Remove default margin for better flex alignment */
}

#series-count {
    color: #aaa;
    font-size: 0.9em;
    margin-left: 8px;
    font-weight: normal;
}

#show-all-btn {
    padding: 8px 16px;
    border: 1px solid #6cf;
    border-radius: 5px;
    background: transparent;
    color: #6cf;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

#show-all-btn:hover {
    background: #6cf;
    color: #181c20;
}

#pagination-container {
    text-align: center;
    margin-top: 20px;
}

.page-link {
    background: transparent;
    border: 1px solid #444;
    color: #f3f3f3;
    padding: 8px 12px;
    margin: 0 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.page-link:hover {
    background: #6cf;
    color: #181c20;
    border-color: #6cf;
}

.page-link.active {
    background: #6cf;
    color: #181c20;
    border-color: #6cf;
    font-weight: bold;
}

/* Login Page Styles */
.login-container {
  max-width: 400px;
  margin: 100px auto;
  padding: 40px;
  background: #23272b;
  border-radius: 10px;
  box-shadow: 0 2px 12px #0006;
  text-align: center;
}

.lock-icon {
  width: 48px;
  height: 48px;
  stroke: #6cf;
  margin-bottom: 20px;
}

.login-container h1 {
  margin-bottom: 24px;
  font-size: 2em;
  color: #f3f3f3;
}

#login-form input {
  width: 100%;
  padding: 12px;
  margin-bottom: 20px;
  border: 1px solid #333;
  border-radius: 5px;
  background: #181c20;
  color: #f3f3f3;
  box-sizing: border-box;
}

#login-form button {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 5px;
  background: #6cf;
  color: #181c20;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
}

#login-form button:hover {
  background: #ffb347;
}

.login-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #6cf;
    color: #181c20;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    text-align: center;
    margin-top: 10px;
}

.login-button:hover {
    background-color: #ffb347;
}

#overview-table th, #overview-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #333;
    text-align: left;
}

#overview-table td:last-child a {
    text-decoration: none;
    display: block;
}

#overview-table tbody tr {
    /* No longer clickable, so remove cursor pointer */
}

#overview-table .details-btn {
    cursor: pointer;
    display: inline-block;
    width: 100%;
}

#details-table td:nth-child(3) { /* Dirname column */
    max-width: 400px; /* Adjust as needed */
    word-wrap: break-word;
    white-space: normal;
}

#details-view {
    display: none;
    padding: 20px;
}

#manage-view {
    display: none;
    padding: 20px;
}

#interactive-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

#background-toggle {
    position: fixed;
    bottom: 10px;
    left: 10px;
    z-index: 1000;
}

#toggle-bg-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    background: #6cf;
    color: #181c20;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

#toggle-bg-btn:hover {
    background: #ffb347;
}

#overview-table tbody tr:hover {
    background-color: #3a3a3a;
}

/* Auth Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#auth-modal .modal-content {
    background: #2c2c2c;
    padding: 30px 40px;
    border-radius: 8px;
    text-align: center;
    color: #f1f1f1;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

#auth-modal h2 {
    margin-top: 0;
    color: #00aaff;
}

#auth-modal p {
    margin-bottom: 20px;
}

.logout-button {
    background-color: #d9534f;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
}

.logout-button:hover {
    background-color: #c9302c;
}

.header-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Responsive styles for mobile */
@media screen and (max-width: 768px) {
    #overview-table thead {
        display: none; /* Hide table headers on mobile */
    }

    #overview-table tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #444;
        border-radius: 8px;
        padding: 10px;
    }

    #overview-table td {
        display: grid;
        grid-template-columns: 100px 1fr;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px dotted #555;
        text-align: right;
    }

    #overview-table td:before {
        content: attr(data-label);
        font-weight: bold;
        text-align: left;
    }

    #overview-table td:last-child {
        border-bottom: 0;
    }

    #overview-table td[data-label="Poster"] {
        justify-content: center;
    }

    #overview-table td[data-label="Poster"]:before {
        display: none;
    }

    #overview-table td img {
        max-width: 100px;
        border-radius: 4px;
    }

    #interactive-background,
    #background-toggle {
        display: none !important; /* Hide background and toggle on mobile */
    }
}
