/* Reset some default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: sans-serif;
    background-color: #121212;
    color: #eee;
    line-height: 1.6;
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "header"
        "main"
        "footer";
}

/* Top Navigation Bar */
.top-bar {
    background-color: #1a1a1a;
    padding: 8.5px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    grid-area: header;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 20px;
}

.nav-links li a {
  text-decoration: none;
  color: #eee;
  font-weight: bold;
}

.nav-links li a:hover,
.nav-links li a.active-link {
  color: #4bc0c0;
}

.nav-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-right {
    display: flex;
    align-items: center;
}

.user-account {
  display: flex;
  gap: 10px;
  align-items: center;
}

.user-account button {
  padding: 8px 12px;
  background-color: #333;
  color: white;
  border: 1px solid #555;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
}
.user-account button:hover {
  background-color: #444;
}

main.container {
    grid-area: main;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
    width: 100%;
}


/* MODAL STYLES */
.modal, .auth-modal, .sync-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.85);
}

.modal-content, .auth-modal-content, .sync-modal-content {
    background-color: #222;
    color: #eee;
    margin: 5% auto;
    padding: 25px;
    border: 1px solid #444;
    width: 90%;
    max-width: 450px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    max-height: 85vh;
    overflow-y: auto;
}

.modal-content h2, .auth-modal-content h2, .sync-modal-content h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #4bc0c0;
}

.input-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 15px;
}

.input-group label {
  margin-bottom: 5px;
  color: #ccc;
  font-size: 0.9em;
}

select, input[type="text"], input[type="password"], input[type="number"], input[type="file"] {
  width: 100%;
  padding: 10px;
  background-color: #2a2a2a;
  color: white;
  border: 1px solid #555;
  border-radius: 4px;
  font-size: 1em;
  box-sizing: border-box;
}

input[readonly] {
    background-color: #383838;
    cursor: not-allowed;
}


button {
  padding: 10px 18px;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  background-color: #007bff;
}
button:hover {
    background-color: #0056b3;
}

.close-modal, .close-auth-modal, .close-sync-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #aaa;
    font-size: 2em;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}
.close-modal:hover, .close-auth-modal:hover, .close-sync-modal:hover {
    color: #fff;
}

.close-modal-button, .close-auth-modal-button, .close-sync-modal-button {
    background-color: #6c757d;
}
.close-modal-button:hover, .close-auth-modal-button:hover, .close-sync-modal-button:hover {
    background-color: #545b62;
}

.error-message {
    margin-top: 10px;
    min-height: 1em;
    font-size: 0.9em;
    color: #ff6b6b;
    font-weight: bold;
}


/* --- SITE NOTIFIER SPECIFIC STYLES --- */

.main-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 30px;
}

.form-container, .list-container {
    background-color: #1a1a1a;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #333;
}

.form-container h2, .list-container h2 {
    color: #4bc0c0;
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

.usage-notice {
    margin-top: 25px;
    padding: 15px;
    background-color: rgba(75, 192, 192, 0.1);
    border: 1px solid #4bc0c0;
    border-radius: 6px;
    font-size: 0.9em;
}
.usage-notice p {
    margin: 0 0 10px 0;
}
.usage-notice ul {
    list-style-position: inside;
    padding-left: 0;
}

#monitorsList {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.monitor-card {
    background-color: #2a2a2a;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #4bc0c0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.monitor-card-details {
    flex-grow: 1;
    overflow: hidden;
    width: 100%;
}

.monitor-card p {
    margin: 2px 0;
    color: #ddd;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.monitor-card p strong {
    color: #aaa;
}

.monitor-card .url-link {
    font-size: 1.1em;
    font-weight: bold;
    color: #eee;
    margin-bottom: 8px;
    text-decoration: none;
    display: block;
}
.monitor-card .url-link:hover {
    color: #4bc0c0;
    text-decoration: underline;
}

.monitor-card .current-value {
    margin-top: 10px;
    padding: 8px;
    background-color: #1e1e1e;
    border-radius: 4px;
    border: 1px solid #333;
    font-size: 0.85em;
    white-space: pre-wrap;
    word-break: break-all;
}
.current-value strong {
    color: #999;
}
.current-value .value-text {
    font-family: monospace;
    color: #c5c5c5;
}

.monitor-card-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    margin-left: auto;
    flex-wrap: wrap;
}
.monitor-card-actions button {
    padding: 6px 10px;
    font-size: 0.85em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.monitor-card-actions .edit-btn {
    background-color: #ffc107;
    color: #121212;
}
.monitor-card-actions .edit-btn:hover {
    background-color: #e0a800;
}
.monitor-card-actions .cookies-btn {
    background-color: #17a2b8;
    color: white;
}
.monitor-card-actions .cookies-btn:hover {
    background-color: #138496;
}
.monitor-card-actions .delete-btn {
    background-color: #dc3545;
}
.monitor-card-actions .delete-btn:hover {
    background-color: #c82333;
}


.empty-state {
    text-align: center;
    color: #888;
    padding: 40px 20px;
    border: 2px dashed #333;
    border-radius: 8px;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: bold;
    margin-bottom: 10px;
}

.status-badge.active {
    background-color: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid #28a745;
}

.status-badge.paused {
    background-color: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid #ffc107;
}

/* Cookie indicator badge */
.cookie-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.75em;
    font-weight: bold;
    margin-left: 8px;
    background-color: rgba(23, 162, 184, 0.2);
    color: #17a2b8;
    border: 1px solid #17a2b8;
}

/* Paused monitor card styling */
.monitor-card.paused {
    opacity: 0.7;
    border-left-color: #ffc107;
}
.monitor-card.paused.change-detected {
    border-left-color: #e83e8c;
    background-color: rgba(232, 62, 140, 0.05);
}


/* Resume button */
.monitor-card-actions .resume-btn {
    background-color: #28a745;
    color: white;
}
.monitor-card-actions .resume-btn:hover {
    background-color: #218838;
}

/* Discord User Management */
.discord-user-select-container {
    display: flex;
    gap: 10px;
}

.discord-user-select-container select {
    flex-grow: 1;
}

.manage-btn {
    padding: 10px 15px;
    background-color: #6c757d;
    flex-shrink: 0;
}
.manage-btn:hover {
    background-color: #5a6268;
}

#discordUsersList {
    margin-bottom: 20px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #333;
    padding: 10px;
    border-radius: 4px;
}

.discord-user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background-color: #2a2a2a;
    border-radius: 4px;
    margin-bottom: 5px;
}
.discord-user-item p {
    margin: 0;
    color: #eee;
}
.discord-user-item span {
    font-size: 0.8em;
    color: #999;
    margin-left: 10px;
}

#addDiscordUserForm h3 {
    margin-top: 20px;
    border-top: 1px solid #444;
    padding-top: 20px;
    color: #ccc;
}

/* Checkbox Styling */
.checkbox-group {
    margin-bottom: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #ccc;
    font-size: 0.9em;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

/* Cookie Upload Area */
.cookie-upload-area {
    border: 2px dashed #555;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    background-color: #2a2a2a;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cookie-upload-area:hover {
    border-color: #4bc0c0;
    background-color: #333;
}

.cookie-upload-area.drag-over {
    border-color: #4bc0c0;
    background-color: rgba(75, 192, 192, 0.1);
}

.cookie-upload-area p {
    margin: 0;
    color: #999;
    font-size: 0.9em;
}

.cookie-filename {
    margin-top: 10px;
    color: #4bc0c0;
    font-size: 0.9em;
    font-weight: bold;
}

.cookie-status {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.9em;
}

.cookie-status.has-cookies {
    background-color: rgba(23, 162, 184, 0.1);
    border: 1px solid #17a2b8;
    color: #17a2b8;
}

.cookie-status.no-cookies {
    background-color: rgba(108, 117, 125, 0.1);
    border: 1px solid #6c757d;
    color: #999;
}