/* Page Watch and Notification Styles */

/* Watch notification badge */
#watch-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--color-error, #d32f2f);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    display: none;
    z-index: 10;
}

/* Watch notification list container */
.watch-notification-items {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
}

/* Notification item */
.notification-item {
    padding: 10px;
    border-bottom: 1px solid var(--color-border-primary, #eee);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.notification-item.unread {
    background-color: var(--color-admonition-background, #e3f2fd);
    font-weight: 600;
}

.notification-item.read {
    opacity: 0.7;
}

.notification-item:hover {
    background-color: var(--color-background-secondary, #f5f5f5);
}

.notification-link {
    display: block;
    color: inherit;
    text-decoration: none;
    flex: 1;
}

.notification-link:hover {
    color: var(--color-link-hover, #1976d2);
}

.notification-link strong {
    display: block;
    margin-bottom: 4px;
}

.notification-date {
    font-size: 0.85em;
    color: var(--color-text-secondary, #666);
    font-weight: normal;
}

.notification-dismiss {
    margin-top: 0;
    padding: 4px 8px;
    font-size: 0.9em;
    background-color: var(--color-success, #4caf50);
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    flex-shrink: 0;
}

.notification-dismiss:hover {
    background-color: #45a049;
}

.no-notifications {
    padding: 20px;
    text-align: center;
    color: var(--color-text-secondary, #999);
    font-style: italic;
}

.notification-actions {
    padding: 10px;
    border-top: 1px solid var(--color-border-primary, #eee);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.notification-actions a {
    color: white;
    text-decoration: none;
    font-weight: 500;
}

.notification-actions a:hover {
    text-decoration: underline;
}

.notification-actions button {
    padding: 6px 12px;
    background-color: var(--color-secondary, #2c5282);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.notification-actions button:hover {
    background-color: #1e3a5f;
}

/* Watch page button states */
#watch-page-button {
    padding: 8px 16px;
    background-color: var(--color-secondary, #2c5282);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

#watch-page-button:hover {
    background-color: #1e3a5f;
}

#watch-page-button.watching {
    background-color: var(--color-success, #4caf50);
    color: white;
}

#watch-page-button.watching:hover {
    background-color: #45a049;
}

/* Watch list table styles */
.watch-list-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background-color: var(--color-background-primary, white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.watch-list-table th,
.watch-list-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-border-primary, #ddd);
}

.watch-list-table th {
    background-color: var(--color-secondary, #2c5282);
    color: white;
    font-weight: bold;
    position: sticky;
    top: 0;
}

.watch-list-table tbody tr:hover {
    background-color: var(--color-background-secondary, #f5f5f5);
}

.watch-list-table a {
    color: var(--color-link, #2c5282);
    text-decoration: none;
}

.watch-list-table a:hover {
    text-decoration: underline;
}

.watch-list-table button {
    padding: 6px 12px;
    background-color: var(--color-error, #d32f2f);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.watch-list-table button:hover {
    background-color: #b71c1c;
}

/* Watch actions */
.watch-actions {
    margin: 20px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.watch-actions button {
    padding: 10px 20px;
    background-color: var(--color-secondary, #2c5282);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.watch-actions button:hover {
    background-color: #1e3a5f;
}

#clear-all-watches {
    background-color: var(--color-error, #d32f2f);
}

#clear-all-watches:hover {
    background-color: #b71c1c;
}

/* Dropdown menu watch notification list */
.notifications-list {
    display: none; /* Hidden by default, shown when #notifications is clicked */
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 350px;
    max-width: 450px;
    width: 450px;
    background-color: var(--color-background-primary, white);
    border: 1px solid var(--color-border-primary, #ccc);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1;
}

.notifications-list h3 {
    margin: 0;
    padding: 10px;
    background-color: var(--color-secondary, #2c5282);
    color: white;
    font-size: 16px;
}

/* Page watching indicator */
.page-watching-indicator {
    display: inline-block;
    margin-left: 10px;
    padding: 4px 10px;
    background-color: var(--color-success, #4caf50);
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    vertical-align: middle;
}

.page-watching-indicator::before {
    content: "👁️ ";
    margin-right: 4px;
}

/* Watch button in bookmark menu */
.bookmarks-watch-link {
    position: relative;
}

.bookmarks-watch-link.watching::after {
    content: " ✓";
    color: var(--color-success, #4caf50);
    font-weight: bold;
}

/* Page header styling for watch-list and bookmarks pages */
.page-header {
    background: var(--color-background-primary, #ffffff);
    border: 1px solid var(--color-border-primary, #e2e8f0);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
}

.page-header h1 {
    font-size: 2.5rem;
    margin: 0;
    font-weight: 700;
    color: var(--color-text-primary, #1a202c);
}

/* Ensure h2 headers in main content are also properly styled */
#searchresults-grid > h2 {
    font-size: 2rem;
    color: var(--color-text-primary, #1a202c);
    margin-bottom: 1.5rem;
    font-weight: 700;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border-primary, #e2e8f0);
}

/* Button base styles - ensure all buttons have consistent styling */
button :not(.sidebar-open) :not(.search),
.button :not(.sidebar-open) :not(.search),
input[type="button"],
input[type="submit"] {
    padding: 8px 16px;
    background-color: var(--color-secondary, #2c5282); 
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

button:hover,
.button:hover,
input[type="button"]:hover,
input[type="submit"]:hover {
    background-color: #1e3a5f;
}

button:active,
.button:active,
input[type="button"]:active,
input[type="submit"]:active {
    transform: translateY(1px);
}

/* "Watch This Page" button specific styling */
.bookmarks-watch-link button,
#watch-page-button {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--color-secondary, #2c5282);
    color: white !important;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.bookmarks-watch-link button:hover,
#watch-page-button:hover {
    background-color: #1e3a5f;
}

/* Watching state */
.bookmarks-watch-link button.watching,
#watch-page-button.watching {
    background-color: var(--color-success, #4caf50);
}

.bookmarks-watch-link button.watching:hover,
#watch-page-button.watching:hover {
    background-color: #45a049;
}

/* Danger/destructive buttons (remove, delete, clear) */
button.danger,
.button-danger,
#clear-all-watches,
.remove-watch {
    background-color: var(--color-error, #d32f2f);
}

button.danger:hover,
.button-danger:hover,
#clear-all-watches:hover,
.remove-watch:hover {
    background-color: #b71c1c;
}

/* Secondary buttons (cancel, back, etc.) */
button.secondary,
.button-secondary {
    background-color: #718096;
}

button.secondary:hover,
.button-secondary:hover {
    background-color: #4a5568;
}

