/* Add theme variables at the top of the file */
:root {
    /* Light theme colors */
    --bg-color: #ffffff;
    --text-color: #333333;
    --nav-bg: #4A3650;
    --primary-color: #B17B97;
    --nav-text: white;
    --column-bg: #f5f5f5;
    --column-header-bg: #e0e0e0;
    --link-bg: white;
    --link-hover-bg: #f9f9f9;
    --link-border: #ddd;
    --border-color: #ccc;
    --modal-bg: white;
    --modal-overlay: rgba(0, 0, 0, 0.5);
    --button-bg: #3498db;
    --button-text: white;
    --button-hover: #2980b9;
    --menu-bg: white;
    --menu-hover: #f1f1f1;
    --description-color: #666;
    --link-url-color: #0066cc;
    --border-color-subtle: rgba(204, 204, 204, 0.3);
    --text-special-1: #B17B97; 
    --text-special-2: #B17B97;
}

/* Dark theme colors */
[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --nav-bg: #362739;
    --primary-color: #B17B97;
    --nav-text: #ffffff;
    --column-bg: #2d2d2d;
    --column-header-bg: #444444;
    --link-bg: #2a2a2a;
    --link-hover-bg: #333333;
    --link-border: #3a3a3a;
    --border-color: #444444;
    --modal-bg: #2d2d2d;
    --modal-overlay: rgba(0, 0, 0, 0.7);
    --button-bg: #2980b9;
    --button-text: white;
    --button-hover: #3498db;
    --menu-bg: #2d2d2d;
    --menu-hover: #383838;
    --description-color: #999;
    --link-url-color: #66b3ff;
    --border-color-subtle: rgba(68, 68, 68, 0.3);  /* Dark subtle border */
    --text-special-1: #f8d7da; 
    --text-special-2: #f8d7da;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Navigation Bar */
.nav-bar {
  background: var(--nav-bg);
  color: var(--nav-text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.75rem 1rem 0.75rem 0rem;
  display: flex;
  flex-wrap: wrap;  /* Allow wrapping on small screens */
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 1rem;  /* Add gap between wrapped elements */
}
[data-theme="dark"] .nav-bar {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);  /* Subtle depth */
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  text-decoration: none;
  margin-left: 10px;
}

.menu-container {
  position: relative;
  margin-right: 0;  /* Remove right margin */
}

.menu-button {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 8px 15px;
  font-size: 1rem;
}

.menu-content {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;  /* Position below the menu button */
  background-color: var(--menu-bg);
  min-width: 160px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  border-radius: 4px;
  z-index: 1000;  /* Ensure it appears above other content */
}
[data-theme="dark"] .menu-content {
    background: #2d2d2d;  /* Slightly lighter than bg-color */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-content.show {
  display: block;
}

.menu-item {
  display: block;
  padding: 10px 15px;
  text-decoration: none;
  color: var(--text-color);
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font: inherit;
}

.menu-item:hover {
  background-color: var(--hover-bg);
}

/* Main Content Area */
.main-content {
  /*padding: 20px;*/
  padding-bottom: 10px; /* Add space for footer */
  padding-top: 10px;  /* Reduce top padding since we have the header now */
}

/* Column Layout */
.columns-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    /*padding: 20px;*/
    justify-content: center;
}

/* Base column styles - all columns visible by default */
.column {
    flex: 1 1 325px;
    min-width: 325px;
    max-width: calc(33.333% - 14px);
    background: var(--bg-color);
    padding: 2px;
    margin: 0;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color-subtle);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
}

/* Empty column styles - dashed border by default */
.column:not(:has(.link-group)) {
    border: 1px dashed var(--border-color-subtle);
}

/* Hide empty columns when NOT dragging */
.columns-container:not(.is-dragging) .column:not(:has(.link-group)) {
    flex: 0 0 0;
    min-width: 0;
    width: 0;
    padding: 0;
    margin: 0;
    border: none;
    overflow: hidden;
}

/* Show empty columns when dragging */
.is-dragging .column:not(:has(.link-group)) {
    flex: 1 1 325px;
    min-width: 325px;
    max-width: calc(33.333% - 14px);
    width: auto;
    padding: 2px;
    margin: 0;
    border: 1px dashed var(--border-color-subtle);
    overflow: visible;
}

/* Column content styles */
.column-content {
    min-height: 100px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    padding: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Visual feedback for drag-over state */
.column-content.drag-over {
    background-color: rgba(52, 152, 219, 0.1);
    outline: 2px dashed var(--border-color);
}

/* Remove the column header styles */
.column-header {
    display: none;
}

.column-title {
    color: var(--text-color);
    font-size: 1.3rem;
    font-weight: bold;
}

.add-link-btn {
    width: 100%;
    margin: 0;
    padding: 8px;
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.add-link-btn:hover {
    background: var(--button-hover);
}

/* Rest of existing styles */
.link-item {
  background: var(--link-bg);
  border: 1px solid var(--link-border);
  border-radius: 4px;
  margin-top: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;  /* For positioning the timestamp */
}

.link-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.edit-btn {
  position: absolute;
  top: 0px;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  opacity: 0.6;
  color: var(--text-color);
}

.edit-btn:hover {
  opacity: 1;
}

.link-title {
  /*font-weight: bold;
  margin-bottom: 5px;*/
  margin-right: 25px;
}

.link-url {
  color: var(--link-url-color);
  margin-bottom: 5px;
  word-break: break-all;
}

.link-description {
  color: var(--description-color);
  margin-bottom: 10px;
}

.link-description-tooltip {
  display: inline-block;
}

.link-description-below {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid #eee;
}

.settings-section + .settings-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

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

.modal-content {
  position: relative;
  background-color: var(--modal-bg);
  margin: 15% auto;
  padding: 20px;
  width: 80%;
  max-width: 500px;
  border-radius: 5px;
  color: var(--text-color);
}

.close-modal {
  position: absolute;
  right: 10px;
  top: 10px;
  font-size: 24px;
  cursor: pointer;
}

.modal-form input, .modal-form textarea {
  width: 100%;
  margin-bottom: 10px;
  padding: 8px;
  box-sizing: border-box;
}

.radio-group {
  margin: 10px 0;
}

.radio-group label {
  margin-right: 15px;
  cursor: pointer;
}

.radio-group input[type="radio"] {
  margin-right: 5px;
  width: auto;
}

.modal-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

.delete-btn {
  background: #ff4444;
  color: white;
  border: none;
}

.dragging {
  opacity: 0.5;
}

.column-drop-zone {
  flex-grow: 1;
  min-height: 100px;
}

.nav-bar svg {
  margin-right: 10px;
  vertical-align: middle;
}

/* Footer Styles */
.footer {
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background-color: var(--bg-color);
  border-top: 1px solid var(--link-border);
  z-index: 2;
  position: static;  /* Default to static for app pages */
  margin-top: auto;  /* Push to bottom of content */
}

/* For brochure pages */
body:not(.app-page) .footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  margin-top: 0;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  align-items: center;
}

.footer-links a {
  text-decoration: none;
  color: var(--text-color);
  padding: 0.25rem 0.5rem;
  opacity: 0.8;
  font-size: 0.85em;  /* Made slightly smaller */
}

.footer-copyright {
  margin-left: auto;
  font-size: 0.85em;
  color: var(--description-color);
  white-space: nowrap;
  padding-right: 32px;
}

/* Responsive layout */
@media (max-width: 768px) {
  .footer {
    flex-direction: column;
    padding: 0.5rem;
    gap: 0.25rem;  /* Made gap smaller */
  }

  .footer-copyright {
    margin: 0;
    padding-top: 0.25rem;  /* Made padding smaller */
    border-top: 1px solid var(--link-border);
    width: 100%;
    text-align: center;
  }
}

#settingsModal .modal-content {
  max-width: 400px;
}

.settings-section {
  margin-bottom: 20px;
}

.settings-section h3 {
  margin-bottom: 10px;
  /*color: #2c3e50;*/
  color: var(--button-bg);
}

/* Cloud Backup Modal Styles */
.action-button {
  background-color: #3498db;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 10px;
}

.action-button:hover {
  background-color: #2980b9;
}

/* Cloud Backup Modal URL Display */
#cloudBackupUrl {
    display: block;
    margin: 10px 0;
    padding: 8px;
    /*background: #f5f5f5;*/
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
    word-break: break-all;
    white-space: pre-wrap;
    max-height: 60px;
    overflow-y: auto;
}

.cloud-backup-url-container {
    margin: 15px 0;
}

.cloud-backup-url-label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

/* Add these styles */
.sync-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    font-size: 11px;
    color: #aaa;
}

.sync-icon {
    font-size: 12px;
    transition: transform 0.5s;
}

.sync-status.syncing .sync-icon {
    animation: spin 1s linear infinite;
}

.sync-status.error {
    color: #e74c3c;
}

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

.sync-error-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #e74c3c;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    z-index: 1000;
    display: none;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* Add these styles */
.edit-column-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 10px;
    opacity: 0.6;
    font-size: 1.1em;
}

.edit-column-btn:hover {
    opacity: 1;
}

/* Add transition for smooth theme switching */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Update link styles */
.link-item a {
    color: inherit;
    text-decoration: none;
}

.link-item a:visited {
    color: inherit;
}

.link-item a:hover {
    text-decoration: underline;
}

.link-url {
    color: var(--link-url-color);
    margin-bottom: 5px;
    word-break: break-all;
    text-decoration: none;
}

.link-url:visited {
    color: var(--link-url-color);
}

/* Make sure link items use the theme background */
.link-item {
    background: var(--link-bg);
    border: 1px solid var(--link-border);
    padding: 8px;
    border-radius: 5px;
    position: relative;
    cursor: move;
    margin-top: 8px;
}

.link-item:hover {
    background: var(--link-hover-bg);
}

.link-item:first-of-type {
  margin-top: 0;
}

.cloud-backup-url-container {
  margin: 15px 0;
}

.url-section {
  margin-bottom: 10px;
}

.url-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.url-label {
  font-weight: bold;
}

.url-display {
  display: block;
  padding: 8px;
  background: var(--column-bg);
  border: 1px solid var(--link-border);
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9em;
  word-break: break-all;
  white-space: pre-wrap;
  max-height: 60px;
  overflow-y: auto;
}

.copy-link-btn {
  background: none;
  border: none;
  color: var(--link-url-color);
  padding: 2px 6px;
  font-size: 0.9em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 4px;
}

.copy-link-btn:hover {
  background: var(--column-bg);
}

/* Modal Display States */
#cloudBackupEmailForm,
#cloudBackupVerification,
#cloudBackupSuccess,
#viewOnlyUrlSection,
#emailChangeVerification,
#recoverySuccess {
    display: none;
}

/* Import File Input */
#importFile {
    display: none;
}

/* Modal Form Elements */
.modal-form input[type="text"],
.modal-form input[type="email"],
.modal-form input[type="url"],
.modal-form textarea {
    width: 100%;
    margin-bottom: 10px;
    padding: 8px;
    box-sizing: border-box;
}

/* Email Change Verification */
#emailChangeVerification div {
    margin-bottom: 15px;
}

#emailChangeVerification label {
    display: block;
    margin-bottom: 5px;
}

#emailChangeVerification input {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
}

/* Link Group Styles */
.link-group {
    background: var(--surface-color);
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 2;
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: var(--column-header-bg);
    border-bottom: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.group-title {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: 600;
}

.edit-group-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    opacity: 0.6;
    font-size: 1.1em;
    color: var(--text-color);
}

.edit-group-btn:hover {
    opacity: 1;
}


/* Drag and drop visual feedback */
.group-drop-zone.drag-over {
    background-color: var(--column-header-bg);
    border-radius: 4px;
}

/* Add page header styles */
.page-header {
    padding: 0px 20px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color-subtle);
}

.page-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-color);
}

/* Add responsive styles */
@media (max-width: 1024px) {
    .column, .is-dragging .column {
        max-width: calc(50% - 10px);
    }
}

@media (max-width: 768px) {
    .column, .is-dragging .column {
        max-width: 100%;
    }

    .nav-bar {
        padding: 0.5rem 0.5rem 0.5rem 0rem;
        flex-wrap: wrap;
    }

    .nav-left {
        flex-grow: 0;  /* Don't grow on mobile */
        order: 1;      /* Keep on left */
    }

    .nav-center {
        order: 3;
        width: 100%;
        margin: 0.5rem 0;
    }

    .user-control {
        order: 2;
        /*margin-left: auto;*/
    }

    .storage-type {
        font-size: 0.9em;  /* Slightly smaller on mobile */
    }

    .menu-content {
        left: 0;
        right: auto;
        /* Ensure menu doesn't go off-screen on mobile */
        max-width: calc(100vw - 2rem);
    }
}

.validation-message {
    color: #dc3545;
    font-size: 0.9em;
    margin: 10px 0;
    min-height: 1.2em;
}

.primary-button:disabled {
    background: var(--button-bg);
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal button group styles */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.primary-button {
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.secondary-button {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.delete-btn {
    margin-left: auto;  /* This will push the delete button to the right */
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.delete-btn:hover {
    background: #c82333;
}

/* Add this CSS */
.link-group[data-add-link-button="hide"] .add-link-btn,
.link-group[data-add-link-button="default"][data-default-add-link-button="hide"] .add-link-btn {
    display: none;
}

/* Add styles for group selector */
#groupSelectorContainer {
    margin-bottom: 15px;
}

#groupSelector {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-color);
    color: var(--text-color);
}

#groupSelector option {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.nav-center {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-right: auto;  /* Push menu to the right */
    justify-content: flex-start;
}

.storage-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
}
[data-theme="dark"] .storage-type {
    background: rgba(255, 255, 255, 0.05);  /* More subtle in dark mode */
}

.storage-icon {
    font-size: 10px;
}

.storage-icon.cloud {
    color: #4CAF50;  /* Green for cloud */
}

.storage-icon.local {
    color: #FFC107;  /* Yellow for local */
}

.user-status {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    order: 2;  /* Keep menu on the right */
}

.restore-link {
    color: white;
    text-decoration: none;
    font-size: 0.9em;
    padding: 0.25rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 1rem;
    transition: all 0.2s;
}

.restore-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Only show restore link on index.php for anonymous users */
body.cloud-backup .restore-link {
    display: none;
}

.backup-options {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: flex-end;
}

.backup-options .primary-button,
.backup-options .secondary-button {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.backup-options .primary-button {
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
}

.backup-options .primary-button:hover {
    background: var(--button-hover);
}

.backup-options .secondary-button {
    background: none;
    border: 1px solid var(--button-bg);
    color: var(--button-bg);
}

.backup-options .secondary-button:hover {
    background: rgba(0, 0, 0, 0.05);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-message {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.user-status span {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.9);
}

/* Add to existing modal styles */
.upgrade-content {
    padding: 20px;
}

.upgrade-content ul {
    list-style-type: none;
    padding: 0;
    margin: 20px 0;
}

.upgrade-content li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
}

.upgrade-content li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #4CAF50;
}

.time-ago {
    position: absolute;
    right: 32px;  /* Leave space for edit button */
    top: 6px;
    transform: translateY(-50%);
    font-size: 0.7em;
    color: var(--description-color);
    text-align: center;
    line-height: 1.1;
}

.days-ago {
    display: inline-block;
    text-align: center;
}

/* Import Modal Styles */
.import-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

/* Add new styles for the updated import options */
.import-option {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    background: var(--card-bg, #f5f5f5);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.import-option:hover {
    background: var(--hover-bg, #e9e9e9);
    transform: translateY(-2px);
}

.import-option-icon {
    font-size: 24px;
    margin-right: 15px;
    width: 30px;
    text-align: center;
    color: var(--primary-color, #B17B97);
}

.import-option-content {
    flex: 1;
}

.import-option-content h3 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: var(--text-color, #333);
}

.import-option-content p {
    margin: 0;
    font-size: 14px;
    color: var(--text-color-secondary, #666);
}

/* Dark mode adjustments for import options */
[data-theme="dark"] .import-option {
    background: var(--card-bg, #2a2a2a);
    border-color: var(--border-color, #444);
}

[data-theme="dark"] .import-option:hover {
    background: var(--hover-bg, #3a3a3a);
}

.import-mode-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
    padding: 10px;
    background-color: var(--card-bg, #f5f5f5);
    border-radius: 8px;
}

.import-mode-selector label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.import-mode-selector input[type="radio"] {
    margin-right: 8px;
}

.import-json-btn,
.import-edge-btn,
.import-csv-btn {
    padding: 12px 15px;
    background-color: var(--card-bg, #f5f5f5);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    text-align: left;
    transition: background-color 0.2s;
}

.import-json-btn:hover,
.import-edge-btn:hover,
.import-csv-btn:hover {
    background-color: var(--hover-bg, #e9e9e9);
}

.import-description {
    margin: 5px 0 15px 0;
    font-size: 14px;
    color: var(--text-color-secondary, #666);
}

.import-summary {
    margin-top: 20px;
    padding: 15px;
    background-color: var(--card-bg, #f5f5f5);
    border-radius: 8px;
}

.import-note {
    margin-top: 15px;
    font-style: italic;
    color: var(--text-color-secondary, #666);
}

.import-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Import Modal Styles */
.import-selection {
    padding: 20px 0;
}

.import-selection .btn-block {
    width: 100%;
    margin-bottom: 10px;
    padding: 15px;
    font-size: 16px;
    transition: transform 0.2s ease;
}

.import-selection .btn-block:hover {
    transform: translateY(-2px);
}

.import-status {
    text-align: center;
    padding: 20px 0;
}

.loading-spinner {
    border: 4px solid var(--column-bg);
    border-top: 4px solid var(--button-bg);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin: 0 auto 15px;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: var(--text-color);
    margin-bottom: 10px;
}

.status-message {
    margin: 15px 0;
    padding: 10px;
    border-radius: 4px;
}

.status-message.success {
    background-color: rgba(46, 204, 113, 0.1);
    color: #27ae60;
}

.status-message.error {
    background-color: rgba(231, 76, 60, 0.1);
    color: #c0392b;
}

.import-summary {
    margin-top: 20px;
    padding: 15px;
    background: var(--column-bg);
    border-radius: 4px;
}

.import-summary h5 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--text-color);
    font-size: 16px;
}

.summary-content {
    font-size: 14px;
    line-height: 1.5;
}

.summary-content ul {
    list-style-type: none;
    padding: 0;
    margin: 10px 0;
}

.summary-content li {
    padding: 4px 0;
}

.modal-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.import-selection .radio-group {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--column-bg);
    border-radius: 4px;
}

.import-selection .radio-group label {
    display: block;
    margin: 8px 0;
    color: var(--text-color);
}

.import-selection .radio-group label:first-child {
    font-weight: bold;
    margin-bottom: 12px;
}

.page-portal-list {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--column-bg);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    width: 200px;
    pointer-events: auto;
}

.page-portal {
    padding: 15px;
    margin: 5px 0;
    border-radius: 4px;
    background: var(--bg-color);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease;
}

/* Add these new styles */
.page-portal-list.drag-over {
    background: var(--hover-bg);
}

.page-portal.drag-over {
    background: var(--button-bg);
    color: white;
}

.page-portal.drag-over .portal-name {
    color: white;
}

.portal-name {
    color: var(--text-color);
    font-weight: 500;
}

.portal-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
}

.portal-progress-bar {
    height: 100%;
    width: 0;
    background: var(--button-bg);
    transition: width 0.1s linear;
}

.portal-active .portal-progress-bar {
    width: 100%;
}

/* User Control Styles */
.user-control {
    /*margin-left: auto;*/  /* Push to the right */
    margin-right: 0;    /* Remove right margin */
}

.user-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border: none;
    background: none;
    color: white;
    cursor: pointer;
}

.user-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-icon svg {
    fill: currentColor;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.user-email {
    font-size: 14px;
    line-height: 1.2;
}

.storage-type {
    font-size: 12px;
    color: #ccc;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
    min-width: 200px;
    display: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-dropdown.show {
    display: block;
}

.user-email-display {
    display: block;
    padding: 0.5rem;
    color: var(--text-color);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.user-dropdown button {
    width: 100%;
    padding: 0.5rem;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
}

.user-dropdown button:hover {
    background: var(--hover-color);
}



/* Sign In Modal Styles */
#signInModal .modal-content {
    max-width: 400px;
    padding: 25px;
}

#signInModal h3 {
    margin-bottom: 20px;
    color: var(--button-bg);
    font-size: 1.3rem;
}

#signInModal .modal-form {
    margin-top: 15px;
}

/* Update input styles to match Cloud Backup modal */
#signInModal input[type="email"],
#signInModal input[type="password"],
#signInModal input[type="text"] {  /* Added text input for verification code */
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 0.9em;
    box-sizing: border-box;
}

#signInModal input[type="email"]:focus,
#signInModal input[type="password"]:focus,
#signInModal input[type="text"]:focus {
    outline: none;
    border-color: var(--button-bg);
}

#signInModal label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-color);
    font-size: 0.9em;
}

/* Update button styles to match Cloud Backup modal */
#signInModal .button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

#signInModal .action-button,
#signInModal button[type="submit"],
#signInModal .primary-button {
    background-color: var(--button-bg);
    color: var(--button-text);
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s ease;
}

#signInModal .action-button:hover,
#signInModal button[type="submit"]:hover,
#signInModal .primary-button:hover {
    background-color: var(--button-hover);
}

#signInModal .secondary-button,
#signInModal button[type="button"] {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s ease;
}

#signInModal .secondary-button:hover,
#signInModal button[type="button"]:hover {
    background: var(--menu-hover);
}

/* Error message styling */
#signInModal .error-message,
#signInModal .validation-message {
    color: #e74c3c;
    font-size: 0.9em;
    margin: 10px 0;
    display: none;
}

#signInModal .error-message.show,
#signInModal .validation-message.show {
    display: block;
}

/* Close button styling */
#signInModal .close-modal {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 24px;
    color: var(--text-color);
    opacity: 0.6;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

#signInModal .close-modal:hover {
    opacity: 1;
}

/* Verification section styles */
#signInModal .verification-section {
    margin-top: 20px;
}

#signInModal .verification-code {
    letter-spacing: 1px;
    font-family: monospace;
}

/* Update Sign In Modal button styles to match Cloud Backup exactly */
#signInModal button {
    background-color: var(--button-bg);
    color: var(--button-text);
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

#signInModal button:hover {
    background-color: var(--button-hover);
}

/* Remove any conflicting button styles */
#signInModal .action-button,
#signInModal .primary-button,
#signInModal .secondary-button,
#signInModal button[type="submit"],
#signInModal button[type="button"] {
    /* Reset any specific button styles */
    all: unset;
    /* Inherit from the general button styles above */
    background-color: var(--button-bg);
    color: var(--button-text);
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

/* Remove button group styles that might affect alignment */
#signInModal .button-group {
    display: block;
    margin-top: 20px;
}

/* Cloud Backup Modal input styles to match Sign In */
#cloudBackupModal input[type="email"],
#cloudBackupModal input[type="text"] {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 0.9em;
    box-sizing: border-box;
}

#cloudBackupModal input[type="email"]:focus,
#cloudBackupModal input[type="text"]:focus {
    outline: none;
    border-color: var(--button-bg);
}

#cloudBackupModal label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-color);
    font-size: 0.9em;
}

/* Ensure consistent button styles between modals */
#cloudBackupModal button {
    background-color: var(--button-bg);
    color: var(--button-text);
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

#cloudBackupModal button:hover {
    background-color: var(--button-hover);
}

.sync-status-line {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    z-index: 9999;
    transform: scaleX(0);
    transition: transform 0.3s ease-out;
}

.sync-status-line.syncing {
    transform: scaleX(0.3);
    background-color: #3498db;
}

.sync-status-line.synced {
    transform: scaleX(1);
    background-color: #2ecc71;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sync-error-banner {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #e74c3c;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 9999;
    display: none;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.announcement {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    max-width: 600px;
    margin: 0 auto;
}
[data-theme="dark"] .announcement {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.announcement.white {
    background-color: white;
    color: black;
}

.announcement.yellow {
    background-color: #fff3cd;
    color: #664d03;
}

.announcement.red {
    background-color: #dc3545;
    color: white;
}


/* Editable Page Header and Description */

.editable {
    cursor: pointer !important;
    padding: 4px;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all 0.2s ease;
    position: relative;
}

.editable::after {
    content: '✎';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.editable:hover {
    background-color: var(--hover-bg-color);
    border-color: var(--border-color);
}

.editable:hover::after {
    opacity: 0.5;
}

.editing {
    padding: 4px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-color);
    min-width: 200px;
    min-height: 1.5em;
    outline: none;
    box-shadow: 0 0 0 2px var(--button-bg);
}

[contenteditable="true"] {
    outline: none;
}

.group-link-count {
    font-size: 0.8rem;
    font-weight: normal;
    color: #777;
    margin-left: 5px;
}

/* Page visibility toggle */
.page-visibility-control {
    display: flex;
    align-items: center;
    margin: 20px 0;
    gap: 10px;
    padding: 15px;
    background: var(--card-bg, #f5f5f5);
    border-radius: 8px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.visibility-label {
    font-size: 14px;
    color: var(--text-color-secondary);
}

.public-link-container {
    display: flex;
    align-items: center;
    flex: 1;
}

#publicLinkInput {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background: var(--input-bg);
    color: var(--text-color);
}

#copyPublicLinkBtn {
    margin-left: 5px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-color);
    padding: 4px;
}

#copyPublicLinkBtn:hover {
    color: var(--primary-color-hover);
}

/* Dark mode styles */
[data-theme="dark"] .toggle-slider {
    background-color: #555;
}

[data-theme="dark"] .page-visibility-control {
    background: var(--card-bg, #2a2a2a);
}

/* Page stats section */
.stats-background-container,
.stats-chart,
.stats-table {
    display: flex;
    align-items: center;
    margin: 20px 0;
    gap: 10px;
    padding: 15px;
    background: var(--card-bg, #f5f5f5);
    border-radius: 8px;
}

[data-theme="dark"] .stats-background-container,
[data-theme="dark"] .stats-chart,
[data-theme="dark"] .stats-table {
    background: var(--card-bg, #2a2a2a);
}

.page-stats-section {
    margin: 30px 0;
    display: none; /* Hidden by default, shown when page is public */
}

.stats-container {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stats-header {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-color);
}

.refresh-stats-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-color);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.refresh-stats-btn:hover {
    color: var(--primary-color-hover);
    background-color: rgba(177, 123, 151, 0.1);
    border-radius: 4px;
}

.refresh-stats-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Hide the second refresh button */
.stats-chart .refresh-stats-btn,
.stats-table .refresh-stats-btn {
    display: none;
}

.stats-summary {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background: var(--bg-color);
    border-radius: 6px;
    padding: 15px;
    flex: 1;
    text-align: center;
    border: 1px solid var(--border-color-subtle);
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-color-secondary);
}

.stats-chart {
    margin-bottom: 30px;
    height: 250px;
}

.stats-table {
    margin-top: 20px;
}

.stats-table h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1rem;
}

.stats-table table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table th, .stats-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color-subtle);
}

.stats-table th {
    font-weight: 600;
    color: var(--text-color-secondary);
}

/* Dark mode adjustments */
[data-theme="dark"] .stat-box {
    background: var(--card-bg-dark, #2a2a2a);
}

/* Stats message for empty state */
.stats-message {
    padding: 20px;
    text-align: center;
    color: var(--text-color-secondary);
    font-style: italic;
}

/* Page visibility section */
.page-visibility-section {
    margin: 30px 0;
    padding: 0 15px;
}

.visibility-header {
    margin-bottom: 20px;
}

.visibility-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-color);
}

.visibility-note {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-color-secondary);
    font-style: italic;
}

/* Hide the note when the page is public */
body[data-page-public="true"] .visibility-note {
    display: none;
}

/* Custom Page Slug Section */
.page-slug-section {
    margin: 30px 0;
    padding: 0 15px;
}

.slug-header {
    margin-bottom: 20px;
}

.slug-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-color);
}

.slug-description {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-color-secondary);
}

.slug-control {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    background: var(--card-bg, #f5f5f5);
    border-radius: 8px;
}

[data-theme="dark"] .slug-control {
    background: var(--card-bg, #2a2a2a);
}

.slug-input-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slug-input-container label {
    font-size: 14px;
    color: var(--text-color);
    min-width: 80px;
}

#customPageSlug {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background: var(--input-bg, white);
    color: var(--text-color);
    width: 20rem;
    max-width: 20rem;
}

[data-theme="dark"] #customPageSlug {
    background: var(--input-bg, #333);
}

#saveCustomSlugBtn {
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

#saveCustomSlugBtn:hover {
    background-color: var(--primary-color-hover, #9a6a83);
}

.permalink-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.permalink-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
    flex-direction: column;
}

.permalink-row input {
    flex-grow: 1;
    margin-right: 8px;
}

.permalink-row .copy-btn {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.permalink-row .copy-btn:hover {
    background-color: #f0f0f0;
    color: #495057;
}

.permalink-row .copy-btn svg {
    vertical-align: middle;
}
.permalink-value {
    font-size: .85rem;
}


.premium-message {
    background-color: #f8f9fa;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.stats-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stats-card {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    width: 30%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.stats-value {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #4A3650;
}

.stats-label {
    font-size: 14px;
    color: #6c757d;
}

.chart-container {
    height: 200px;
    margin-bottom: 20px;
}

.loading-spinner {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

[data-theme="dark"] .premium-message {
    background-color: #2c2c2c;
    border-left-color: #ffc107;
}

[data-theme="dark"] .stats-card {
    background-color: #2c2c2c;
}

[data-theme="dark"] .stats-value {
    color: #B17B97;
}

[data-theme="dark"] .permalink-row .copy-btn:hover {
    background-color: #3a3a3a;
    color: #e0e0e0;
}

/* Page modals styling */
.permalink-row {
    display: flex;
    align-items: flex-starts;
    margin-bottom: 10px;
}

.permalink-row input {
    flex-grow: 1;
    margin-right: 8px;
}

.permalink-row .copy-btn {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.permalink-row .copy-btn:hover {
    background-color: #f0f0f0;
    color: #495057;
}

.permalink-row .copy-btn svg {
    vertical-align: middle;
}

.premium-message {
    background-color: #f8f9fa;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.stats-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stats-card {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    width: 30%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.stats-value {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #4A3650;
}

.stats-label {
    font-size: 14px;
    color: #6c757d;
}

.chart-container {
    height: 200px;
    margin-bottom: 20px;
}

.loading-spinner {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

[data-theme="dark"] .premium-message {
    background-color: #2c2c2c;
    border-left-color: #ffc107;
}

[data-theme="dark"] .stats-card {
    background-color: #2c2c2c;
}

[data-theme="dark"] .stats-value {
    color: #B17B97;
}

[data-theme="dark"] .permalink-row .copy-btn:hover {
    background-color: #3a3a3a;
    color: #e0e0e0;
}

/* New Navbar Styles */
.navbar-nav {
    display: flex;
    align-items: center;
}

.navbar-nav.left-actions {
    margin-right: auto;
}

.navbar-nav.right-actions {
    margin-left: auto;
}

.nav-spacer {
    width: 8px;
}

.nav-action-button {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    color: white;
    background-color: transparent;
    border: none;
    text-decoration: none;
}

.nav-bar ul {
    margin-top: 0px;
    margin-bottom: 0px;
}
.nav-action-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

li.nav-item {
    list-style-type: none;
}

.nav-action-button .nav-icon {
    margin-right: 6px;
}

/* SVG icon styling */
.nav-icon {
    margin-right: 6px;
    vertical-align: middle;
    fill: currentColor;
}

.menu-icon {
    width: 20px;
    height: 20px;
    text-align: center;
    margin-right: 8px;
    vertical-align: middle;
    fill: currentColor;
}

.nav-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    height: 36px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    color: white;
    background-color: transparent;
    border: none;
}

.nav-icon-button .nav-icon {
    margin-right: 6px;
}

.nav-icon-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Custom dropdown styling */
.custom-dropdown {
    position: relative;
    display: inline-block;
}

.custom-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    min-width: 200px;
    padding: 8px 0;
    margin: 0;
    margin-top: 4px;
    font-size: 14px;
    color: #212529;
    text-align: left;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,.1);
}

[data-theme="dark"] .custom-dropdown-menu {
    background-color: #2c2c2c;
    color: #e0e0e0;
    border-color: rgba(255,255,255,0.1);
}

.custom-dropdown-menu.show {
    display: block;
}

.custom-dropdown-menu.right-aligned {
    left: auto;
    right: 0;
}

.custom-dropdown-item {
    display: block;
    width: 100%;
    padding: 8px 16px;
    clear: both;
    font-weight: 400;
    color: #212529;
    text-align: inherit;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    cursor: pointer;
}

[data-theme="dark"] .custom-dropdown-item {
    color: #e0e0e0;
}

.custom-dropdown-item:hover {
    color: #16181b;
    text-decoration: none;
    background-color: #f8f9fa;
}

[data-theme="dark"] .custom-dropdown-item:hover {
    color: #ffffff;
    background-color: #3a3a3a;
}

.custom-dropdown-divider {
    height: 0;
    margin: 8px 0;
    overflow: hidden;
    border-top: 1px solid #e9ecef;
}

[data-theme="dark"] .custom-dropdown-divider {
    border-top-color: rgba(255,255,255,0.1);
}

.custom-dropdown-header {
    display: block;
    padding: 8px 16px;
    margin-bottom: 0;
    font-size: 12px;
    color: #6c757d;
    white-space: nowrap;
}

[data-theme="dark"] .custom-dropdown-header {
    color: #aaaaaa;
}

/* Responsive adjustments for navbar */
@media (max-width: 768px) {
    .nav-action-button span {
        display: none;
    }
    
    .custom-dropdown-menu {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 70vh;
        overflow-y: auto;
        margin: 0;
        border-radius: 12px 12px 0 0;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    }
    
    .custom-dropdown-menu.right-aligned {
        left: 0;
        right: 0;
    }
}