/*
 * Sensorium Main Stylesheet
 *
 * Design System imports
 * These provide CSS custom properties (variables) and reusable components
 */

/* Core - Design tokens and reset */
@import url('core/_variables.css');
@import url('core/_reset.css');
@import url('core/_utilities.css');

/* Layouts */
@import url('layouts/_grid.css');

/* Components */
@import url('components/_buttons.css');
@import url('components/_cards.css');
@import url('components/_forms.css');
@import url('components/_badges.css');
@import url('components/_modal.css');
@import url('components/_navbar.css');
@import url('components/_pagination.css');
@import url('components/_alerts.css');
@import url('components/_breadcrumb.css');

/*
 * Legacy styles below - will be gradually migrated to component files
 * See docs/CSS_CONSOLIDATION_PLAN.md for migration roadmap
 */

/* Note: Basic reset is now in core/_reset.css but keeping overrides for backwards compatibility */
* {
    box-sizing: border-box;
}

strong {
    color: var(--color-primary, #1e3a5f);
}

body {
    background-color: var(--color-bg, #f5f7fa);
}

/* Navbar styles migrated to components/_navbar.css */

h1, h2, h3 {
    font-weight: var(--font-weight-bold, bold);
    color: var(--color-primary, #1e3a5f);
}

h1 {
    font-size: var(--font-size-2xl, 1.5em);
}

h2 {
    font-size: var(--font-size-lg, 1.1em);
    margin-bottom: var(--space-2, 0.5em);
}

h3 {
    font-size: var(--font-size-3xl, 1.75em);
    margin-bottom: var(--space-2, 0.5em);
}

h4 {
    margin-top: 0;
    margin-bottom: var(--space-4, 1em);
}

p {
    font-size: var(--font-size-base, 1em);
    margin-bottom: var(--space-4, 1em);
}

a {
    color: var(--color-primary, #1e3a5f);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.main-container {
    max-width: 100%;
    margin: 0 auto;
    padding: var(--space-5, 20px);
    padding-top: var(--navbar-height, 70px); /* Account for fixed navbar height */
}

.container {
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 0;
}

.dashboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5, 20px);
    margin-bottom: var(--space-12, 60px);
}

.dashboard-card {
    background-color: var(--color-bg-card, white);
    border-radius: var(--radius-md, 8px);
    padding: var(--space-5, 20px);
    min-height: 350px;
    box-shadow: var(--shadow-sm, 0 2px 4px rgba(0, 0, 0, 0.05));
}

.dashboard-title {
    display: flex;
    align-items: center;
    gap: var(--space-3, 10px);
    font-size: var(--font-size-xl, 22px);
    color: var(--color-primary, #1e3a5f);
    margin-bottom: var(--space-5, 20px);
}

.placeholder-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 250px;
    background-color: var(--color-bg, #f5f7fa);
    border-radius: var(--radius-md, 6px);
    color: var(--color-text-light, #777);
}

@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
}

.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-1, 0.25rem);
    width: 100%;
    margin: 0 auto;
}

.collation-card {
    background: var(--color-bg-card, white);
    border-radius: var(--radius-md, 8px);
    box-shadow: var(--shadow-md, 0 2px 4px rgba(0,0,0,0.1));
    margin-bottom: var(--space-2, 0.5rem);
    padding: var(--space-2, 0.5rem);
    transition: transform var(--transition-base, 0.2s ease), box-shadow var(--transition-base, 0.2s ease);
    display: grid;
    grid-template-columns: 200px 1fr;
    grid-template-rows: auto 1fr auto;
    gap: var(--space-2, 0.5rem);
    contain: layout style paint;
}

.collation-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg, 0 4px 8px rgba(0,0,0,0.15));
}

.collation-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-1, 0.2rem);
    grid-column: 2;
}

.collation-card-body {
    color: var(--color-text, #444);
    font-size: var(--font-size-base, 1rem);
    line-height: var(--line-height-normal, 1.5);
    margin-bottom: 0;
    overflow: hidden;
    grid-column: 2;
}

.collation-card-footer {
    display: flex;
    gap: 0.2rem;
    border-top: 1px solid #eee;
    padding-top: 0.5rem;
    margin-top: auto;  /* Push to bottom */
    grid-column: 2 / -1;
    justify-content: flex-end;  /* Align content to right */
    align-self: end;  /* Align to bottom */
}

.collation-card-image {
    grid-column: 1;
    grid-row: 1 / -1;  /* Span from first to last row */
    overflow: hidden;
    border-radius: 4px;
}

.collation-card-image img {
    width: 100%;
}


.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: nowrap;
    max-width: 100%;  /* Ensure it doesn't overflow container */
}

.section-header h1 {
    margin: 0;
    flex-shrink: 0;
}

.section-title {
    font-size: 28px;
    color: #1e3a5f;
    font-weight: bold;
    margin: 0;
}

.more-link {
    color: #4a90e2;
    text-decoration: none;
    display: flex;
    align-items: center;
    margin-left: auto;
    white-space: nowrap;
}

.collation-title {
    font-size: 22px;
    color: #1e3a5f;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.collation-title h2 {
    margin: 0;
}

.collation-desc {
    color: #555;
    margin-bottom: 15px;
    line-height: 1.5;
}

.collation-meta {
    display: flex;
    gap: 15px;
    align-items: center;
    color: #666;
    font-size: 0.9em;
    justify-content: flex-start;
    margin-left: 0;
    padding-left: 0;
    margin-bottom: 20px;
}

.update-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

.publish-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.published {
    background-color: #e9f7ef;
    color: #27ae60;
    padding: 5px 10px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.published-date {
    color: #777;
}

.icon {
    display: inline-block;
}

.collations-container {
    margin-bottom: 0px;
}

.header-top {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.logo-container {
    display: flex;
    align-items: center; /* This ensures vertical alignment */
}

.logo {
    height: 35px;
    width: auto;
    margin-right: 2px;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.site-title {
    font-size: 1.2em;
    color: #fff;
    font-weight: bold;
    flex-shrink: 0;
}

.sections-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
    padding-bottom: 10px;
}

.section-tab {
    padding: 8px 16px;
    background-color: #f0f0f0;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.section-tab:hover {
    background-color: #e0e0e0;
}

.section-tab.active {
    background-color: #007BFF;
    color: white;
}

.search-and-collate-container {
    margin-bottom: 20px;
    width: 200px;
    flex-shrink: 0; /* Prevent container from shrinking */
    position: sticky;
    top: 70px; /* Account for navbar height */
    z-index: 999;
    background-color: #f5f7fa;
    height: fit-content; /* Ensure container fits its content */
}

.links-container {
    margin-top: 0px;
    overflow-y: auto;
    padding: 0px;
    flex: 1; /* Allow container to take remaining space */
}

/* Loading/empty-state/error-message styles migrated to components/_alerts.css */

.grid-container {
    display: grid;
    /*grid-template-columns: repeat(auto-fill, minmax(600px, 1fr));*/
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.grid-list-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.grid-item {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    padding: 0.5rem;
    border-radius: 2px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 5px 10px;  /* Reduced vertical gap to 5px, horizontal to 10px */
    align-items: start;
    align-content: start;  /* This squeezes content to the top */

}

.label {
    font-weight: 600;
    color: #666;
    margin-bottom: 0.1rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
}

.label span {
    flex: 0 1 auto;
}

.label .button-container {
    margin-left: 0;
    flex: 0 0 auto;
}


.value {
    word-break: break-word;
    grid-column: 2;
}

.value input[type="text"],
.value input[type="url"],
.value input[type="date"],
.value textarea {
    width: 100%;
}

.value textarea {
    height: 6em;  /* This is approximately 4 lines of text */
    min-height: 6em;  /* Ensures the textarea doesn't shrink smaller than 4 lines */
    resize: vertical;  /* Allows vertical resizing if needed */
}

.analysis-hover {
    background-color: rgba(30, 58, 95, 0.05); /* Made lighter by reducing opacity from 0.1 to 0.05 */
    position: relative;
}

.analysis-hover:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px;
    background-color: rgba(30, 58, 95, 0.9); /* Darker version of #1e3a5f */
    color: white;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 2000; /* Increased z-index to ensure it appears above other elements */
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.3)); /* Add shadow for better visibility */
}

/* New style for the title row to display elements inline */
.title-row-inline {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .title-row-inline h4 {
    margin: 0;
    display: inline;
    padding-right: 5px;
  }

@media (max-width: 1200px) {
    .grid-container {
        grid-template-columns: 1fr;
    }
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
}

th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    vertical-align: middle;
}

th {
    background-color: #f2f2f2;
    font-weight: bold;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

input[type="text"], input[type="date"] {
    width: 100%;
    padding: 5px;
    margin-bottom: 5px;
}

button[type="submit"]:not(.btn) {
    background-color: #007BFF;
    color: white;
    padding: 10px 15px;
    border: none;
    cursor: pointer;
}

button[type="submit"]:not(.btn):hover {
    background-color: #0056b3;
}

.search-container {
    background: white;
    padding: .2 rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

.panel-toggle {
    margin-bottom: 1rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.panel-toggle button:not(.btn) {
    background-color: #007BFF;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.panel-toggle button:not(.btn):hover {
    background-color: #0056b3;
}

.panel-toggle h2 {
    margin: 0;
    font-size: 0.8 em;
}

#searchToggleIcon {
    font-size: 12px;
    line-height: 1;
}

.search-inputs-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.1rem;
    align-items: flex-end;
}

.search-input {
    display: flex;
    flex-direction: column;
}

.search-input input[type="checkbox"] {
    margin-left: 0;
    margin-top: 0.5rem;
    align-self: flex-start;
}

.search-input label {
    margin-bottom: 0.5rem;
}

.search-input button:not(.btn) {
    height: 2rem;
    align-self: flex-end;
}

.hidden {
    display: none;
}

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

.id-button-container span {
    font-weight: bold;
}

.button-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: flex-start;
    align-items: center;
}

.edit-button, .delete-button, .update-button, .add-button {
    padding: var(--space-1, 4px) var(--space-3, 12px);
    border: none;
    cursor: pointer;
    border-radius: var(--radius-sm, 4px);
    font-size: var(--font-size-xs, 0.75rem);
    line-height: 1.25;
}

.edit-button {
    background-color: #4CAF50;
    color: white;
}

.delete-button {
    background-color: #f44336;
    color: white;
}

.update-button, .add-button {
    background-color: #007BFF;
    color: white;
}

.edit-button:hover {
    background-color: #45a049;
}

.delete-button:hover {
    background-color: #d32f2f;
}

.update-button:hover {
    background-color: #0056b3;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.value.title {
    font-weight: bold;
    font-size: 1.2em;
}

/* Add these rules to handle images in feed entry descriptions */
.feed-description img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.feed-description figure {
    margin: 0;
    max-width: 100%;
}

.feed-description figcaption {
    font-size: 0.9em;
    color: #666;
}

/* Commentary styles */
.commentary-container {
    margin: 8px 0;
    padding: 10px;
    background-color: #f8f9fa;
    border-left: 4px solid #1e3a5f;
    border-radius: 0 4px 4px 0;
    grid-column: 2;
}

.commentary-label {
    font-weight: bold;
    color: #1e3a5f;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.commentary-text {
    font-style: italic;
    color: #444;
    margin-bottom: 5px;
}

.edit-commentary-btn {
    padding: 2px 8px;
    background-color: #1e3a5f;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8em;
}

.edit-commentary-btn:hover {
    background-color: #2a4d79;
}

/* Active view in collation header */
.active-view {
    font-weight: bold;
    color: #1e3a5f;
}

/* Admin badge */
.admin-badge {
    display: inline-block;
    background-color: #FF6B35;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    text-align: center;
    line-height: 24px;
    margin-left: 8px;
    font-size: 14px;
    cursor: default;
}

/* Deprecated: Write permission badge - kept for backwards compatibility */
.write-permission-badge {
    display: inline-block;
    background-color: #4CAF50;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    text-align: center;
    line-height: 24px;
    margin-left: 8px;
    font-size: 14px;
    cursor: default;
}


.feed-container {
    flex: 1; /* Allow feed container to take remaining space */
    margin-left: 0;
    margin: 0;
    padding: 0;
    overflow: visible;
}

.feed-grid {
    display: grid;
    grid-template-columns: 1fr;  /* Changed from previous value to ensure single column */
    gap: 0.25rem;
    width: 100%;  /* Changed from max-width: 800px to 100% */
    margin: 0 auto;
}

.feed-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 0.1rem;
    padding: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: grid;
    grid-template-columns: 200px 1fr;
    grid-template-rows: auto auto auto auto;
    gap: 0.1rem;
    contain: layout style paint;
}

.feed-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

@keyframes loading {
    0% { background-position: -200px 0 }
    100% { background-position: 200px 0 }
}

.feed-card.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: loading 1.5s infinite linear;
}

.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    grid-column: 2;  /* Place in second column */
}

.feed-date {
    color: #666;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.feed-image {
    margin: 0;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background-color: #f0f0f0;
    position: relative;
    grid-column: 1;
    grid-row: 1 / span 7;  /* Cover all rows */
}

/* Specific styles for feed-image within title-row */
.title-row .feed-image {
    flex-shrink: 0;
    width: 200px;
    grid-column: unset;
    grid-row: unset;
}

/* Override grid layout for view_link page feed-card */
.feed-card .title-row {
    /* This selector ensures the parent feed-card is styled correctly */
}

.feed-card .title-row ~ * {
    /* Reset grid positioning for siblings after title-row */
    grid-column: unset;
    grid-row: unset;
}

/* Alternative: Create a specific override for the view_link page */
.view-link-page .feed-card {
    display: block;
    grid-template-columns: unset;
    grid-template-rows: unset;
}

.feed-image img {
    width: 100%;
    height: 100%;  /* Changed from auto */
    object-fit: cover;
    position: absolute;  /* Position within the container */
    top: 0;
    left: 0;
    transition: opacity 0.3s ease-in;
}

.feed-image img.loaded {
    opacity: 1;
}

.feed-title {
    font-size: 1.25rem;
    margin: 0 0 0.5rem 0;
}

.feed-title a {
    color: #333;
    text-decoration: none;
}

.feed-title a:hover {
    text-decoration: underline;
}

.feed-description {
    color: #444;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 10;
    -webkit-box-orient: vertical;
    overflow: hidden;
    grid-column: 2;  /* Place in second column */
}

.feed-actions {
    display: flex;
    gap: 0.5rem;
    border-top: 1px solid #eee;
    padding-top: 1rem;
    margin-top: 1rem;
    grid-column: 2 / -1;  /* Span full width */
}

.import-btn:not(.btn), .delete-btn:not(.btn), .view-link:not(.btn), .mark-read-btn:not(.btn) {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.import-btn:not(.btn), .mark-read-btn:not(.btn) {
    background: #007bff;
    color: white;
}

.import-btn.imported:not(.btn) {
    background: #4CAF50;
}

.view-link:not(.btn) {
    background: #6c757d;
    color: white;
    text-decoration: none;
}

.delete-btn:not(.btn) {
    background: #dc3545;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .feed-container {
        padding: 0.5rem;
    }

    .feed-card {
        margin-bottom: 1rem;
        /* Change from horizontal grid to vertical stacking */
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto auto auto auto !important;
    }

    .feed-image {
        /* Place image at the top, full width */
        grid-column: 1 !important;
        grid-row: 1 !important;
        width: 100%;
        max-height: 200px;
    }

    .title-row {
        /* Place title below image */
        grid-column: 1 !important;
        grid-row: 2 !important;
    }

    .card-summary {
        /* Place summary after title */
        grid-column: 1 !important;
        grid-row: 3 !important;
    }

    .tag-group {
        /* Place tags after summary */
        grid-column: 1 !important;
        grid-row: 4 !important;
    }

    .card-actions {
        /* Place actions last */
        grid-column: 1 !important;
        grid-row: 5 !important;
    }

    .feed-header {
        flex-direction: column;
        align-items: flex-start;
        grid-column: 1 !important;
    }

    .feed-content {
        /* Place feed content after image */
        grid-column: 1 !important;
        grid-row: auto !important;
    }

    .feed-title {
        /* Ensure title stays in single column */
        grid-column: 1 !important;
    }

    .feed-description {
        /* Override the grid-column: 2 rule */
        grid-column: 1 !important;
        grid-row: auto !important;
    }

    .feed-actions {
        flex-wrap: wrap;
        /* Override grid-column: 2 / -1 */
        grid-column: 1 !important;
        grid-row: auto !important;
    }

    .search-container {
        padding: 0.5rem;
    }

    .search-input {
        flex: 1 1 100%;
    }
}

/* Floating action button */
.floating-action {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
}

.summarize-btn {
    background: #007bff;
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.summarize-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.15);
}

/* Card improvements */
.card-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.card-summary {
    color: #666;
    margin-bottom: 0.4rem;
    line-height: 1.5;
    grid-column: 2;  /* Ensure it spans the content column */
    grid-row: 2;
}


.tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    grid-column: 2;
    grid-row: 3;
    margin-bottom: 0.5rem;
}

.tag-label {
    font-weight: 500;
    color: #555;
}

.tag-group a {
    background: #f0f0f0;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    color: #666;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.tag-group a:hover {
    background: #e0e0e0;
    text-decoration: none;
}

.card-footer {
    border-top: 1px solid #eee;
    padding-top: 1rem;
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

.card-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Add styles for view controls */
.view-controls {
    margin-bottom: 1rem;
    text-align: right;
}

.toggle-btn {
    background: #007bff;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.toggle-btn:hover {
    background: #0056b3;
}


.link-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.link-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.title-group {
    flex: 1;
}

.action-link {
    display: flex;
    gap: 0 rem;
    /*margin-left: auto;*/
    flex-shrink: 0;
    max-width: 100%;  /* Ensure buttons don't overflow */
}

.inline-form {
    display: inline-flex;
    margin: 0;
    padding: 0;
    vertical-align: middle;
}

/* Only override non-btn button styles in inline-form */
.inline-form button:not(.btn) {
    margin: 0;
    padding: var(--space-1, 4px) var(--space-3, 12px);
    vertical-align: middle;
    line-height: 1.25;
    height: auto;
    min-height: 0;
    border: none;
    font-size: var(--font-size-xs, 0.75rem);
    font-weight: 500;
}

.content-section {
    background: white;
    border-radius: 2px;
    padding: 0.2rem;
    margin-bottom: 0.2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.info-grid, .analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0.2rem;
}

.info-item, .analysis-item {
    margin-bottom: 0.2rem;
}

.link-url {
    word-break: break-all;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.advanced-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;  /* Reduced gap between button and heading */
    margin: 1px;
    margin-bottom: 4px;
}

.advanced-toggle h2 {
    margin: 0;  /* Remove default margins from heading */
}


.advanced-content {
    margin-top: 1rem;
}

.advanced-content textarea {
    width: 100%;
    min-height: 200px;
    margin: 1rem 0;
}

@media (max-width: 768px) {
    .link-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .info-grid, .analysis-grid {
        grid-template-columns: 1fr;
    }
}

/* Add this new style for the search toggle button */
#toggle-search:not(.btn) {
    background-color: #007BFF;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    height: 40px;
    line-height: 20px;
}

#toggle-search:not(.btn):hover {
    background-color: #0056b3;
}

.import-url-btn:not(.btn) {
    background-color: #4CAF50;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    height: 20px;
    line-height: 20px;
    display: inline-flex;
    align-items: center;
}

.import-url-btn:not(.btn):hover {
    background-color: #45a049;
    text-decoration: none;
}

/* .empty-state migrated to components/_alerts.css */

/* Pagination styles migrated to components/_pagination.css */

.formatted-list ol {
    padding-left: 20px;
    margin: 4;
    margin-top: 0;  /* Add small top margin */
    list-style-position: outside;
}

.formatted-list li {
    margin-bottom: 0.2em;
    list-style: circle;
}

.title-group .description {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 1em;
}

.raw-html-process textarea {
    width: 100%;
    height: 6em;  /* Match the height of other textareas */
    min-height: 6em;
    resize: vertical;
}

.left-column-panel {
    width: 100%;
    background-color: white;
    padding: 4px;
}

.collate-panel {
    flex: 0 0 250px;
    height: fit-content;
    margin-top: 0;
    position: sticky;
    top: 140px;
}

.collation-select {
    width: 100%;
    padding: 2px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.action-button:not(.btn) {
    background-color: #007BFF;
    color: white;
    padding: var(--space-1, 4px) var(--space-3, 12px);
    border: none;
    border-radius: var(--radius-sm, 4px);
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    font-weight: 500;
    font-size: var(--font-size-xs, 0.75rem);
    display: inline-flex;
    align-items: center;
    line-height: 1.25;
}

.action-button:not(.btn):hover {
    background-color: #0056b3;
    text-decoration: none;
}

.collation-button:hover {
    background-color: #0056b3;
}

.collation-button:disabled {
    background-color: #4CAF50;
    cursor: not-allowed;
}

.collation-selection {
    /*margin-top: 1rem;*/
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.selection-container {
    display: flex;
    gap: 1rem;
    margin-top: 0rem;
}

.collation-tag {
    background-color: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Add new styles for the container layout */
.links-layout {
    display: flex;
    gap: 20px;
    max-width: none; /* Remove max-width constraint */
    margin: 0; /* Remove auto margins */
    padding: 0 20px; /* Add some padding on the sides */
}

/* Responsive layout for mobile */
@media (max-width: 768px) {
    .content-layout {
        flex-direction: column;
    }

    .links-layout {
        flex-direction: column;
        padding: 0 10px; /* Reduce padding on mobile */
    }

    .collation-panel {
        flex: none;
        width: 100%;
    }

    .search-and-collate-container {
        width: 100%;
        position: relative;
        top: 0;
    }

    .links-container {
        margin-left: 0;
        width: 100%; /* Ensure full width on mobile */
    }
}

.entries-counter {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: rgba(51, 51, 51, 0.9);  /* Dark grey with slight transparency */
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 1000;  /* Ensure it stays above other content */
    font-size: 1.1em;
}

.section-container {
    margin-bottom: 2rem;
}

.section-heading {
    color: #333;
    border-bottom: 2px solid #ddd;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.link-item {
        background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
display: grid;
    grid-template-columns: 200px 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 0.5rem;
    contain: layout style paint;
}

/* Add this for the element in the first column */
.link-item > *:first-child {
    grid-row: 1 / -1;  /* This makes it span from row 1 to the last row */
}

.link-image {
    width: 200px;
}

.content-section .toggle-icon {
    font-size: 12px;
    line-height: 1;
}

.publisher-icon {
    width: 32px;
    height: 32px;
    vertical-align: middle;
    flex-shrink: 0;  /* Added to prevent icon from shrinking */
}

.title-row {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 0.5rem;
    grid-column: 2;
    grid-row: 1;
}

.title-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.title-header {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    justify-content: space-between;
}

.title-row .card-title {
    margin: 0;
    line-height: 1.2;
    flex: 1;  /* Added to allow title to take remaining space */
}

.card-actions {
    display: flex;
    align-items: center;
    margin-left: auto;  /* Push to the right */
}

.newsletter-button {
    padding: 8px 16px;
    margin-right: 16px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
}

.newsletter-button:hover {
    background-color: #0056b3;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7em;
    font-weight: 500;
}

.status-badge.draft {
    background-color: #ffd700;
    color: #000;
}

.status-badge.published {
    background-color: #dcfce7;  /* green-100 equivalent */
    color: #166534;  /* green-800 equivalent */
}

.published-date {
    color: #666;
    font-size: 0.7em;
}

.button {
    padding: var(--space-1, 4px) var(--space-3, 12px);
    border-radius: var(--radius-sm, 4px);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s;
    font-size: var(--font-size-xs, 0.75rem);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    margin: 2px;
    text-align: center;
    min-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    color: white;
    vertical-align: middle;
    line-height: 1.25;
    box-sizing: border-box;
}

.button.view {
    background-color: #007BFF;
}

.button.add-new {
    background-color: #4CAF50;
}

.button.add {
    background-color: #4CAF50;
}

.button.edit {
    background-color: #007BFF;
}

.button.delete {
    background-color: #dc3545;
}

.button:hover {
    opacity: 0.9;
    text-decoration: none;
    color: white;
}

/* Ensure submit buttons have consistent height with anchor buttons */
button.button[type="submit"] {
    height: auto;
    min-height: 0;
    padding: var(--space-1, 4px) var(--space-3, 12px);
    line-height: 1.25;
    vertical-align: middle;
    border: none;
    font-size: var(--font-size-xs, 0.75rem);
    font-weight: 500;
    box-sizing: border-box;
}

.button-group {
    gap: 8px;
    /*height: 36px;*/
    padding: 4px 8px;
    display: inline-flex; /*flex*/
    align-items: center;
    justify-content: center;
    box-sizing: border-box;  /* Add this to include padding in height calculation */
    margin: 0;  /* Add this to remove any default margins */
    font: inherit;  /* Add this to ensure consistent font sizing */
}

.preview-links-list {
    padding-left: 1.5em;
    margin: 0;
    list-style: disc;
}

.preview-links-list li {
    list-style: disc;
    margin-bottom: 0.1em;
}

/* Add these new styles for expand/collapse functionality */
.toggle-links {
    color: #007BFF;
    cursor: pointer;
    display: inline-block;
    margin-top: 5px;
    font-size: 0.9em;
}

.toggle-links:hover {
    text-decoration: underline;
}

.hidden-links {
    display: none;
}

.link-thumbnail {
    width: 200px;
}

/* Responsive layout for mobile */
@media (max-width: 768px) {
    .search-and-collate-container {
        float: none;
        width: 100%;
        margin-right: 0;
        margin-bottom: 20px;
    }
    
    .feed-container {
        margin-left: 0; /* Reset margin on mobile */
    }
}

/* Breadcrumb styles migrated to components/_breadcrumb.css */

.collation-header {
    display: flex;
    padding-top: 4px;
    gap: 20px;
    margin-bottom: 10px;
    align-items: center;
    background-color: white;
}

.collation-image {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.collation-thumbnail {
    width: 200px;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.collation-info {
    flex: 1;
    align-self: flex-start;
}

.collation-info h1 {
    margin: 0 0 10px 0;
    font-size: 2em;
    color: #1e3a5f;
}

.collation-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    color: #666;
    font-size: 0.9em;
    margin-left: 0;
    padding-left: 0;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-modal:hover,
.close-modal:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

.feed-image img {
    cursor: pointer;
    transition: 0.3s;
}

.feed-image img:hover {
    opacity: 0.7;
}

/* Flash/alert styles migrated to components/_alerts.css */

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.admin-grid-item {
    padding: 1rem;
    text-align: center;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.admin-grid-item:hover {
    transform: translateY(-2px);
}

.google-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 16px;
    height: 56px; /* Increased to accommodate larger logo */
    background: white;
    border: 1px solid #dadce0;
    border-radius: 4px;
    color: #3c4043;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.google-login-btn:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3);
}

.google-login-btn:active {
    background: #f1f3f4;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3);
}

.google-login-btn img {
    width: 40px;
    height: 40px;
    border: none;
}

.newsletter-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: left;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.newsletter-item > * {
    max-width: 800px;
    width: 100%;
}

/* Create a new style for feed images to be inline */
.inline-feed-image {
    margin: 1rem 0;
    overflow: hidden;
    width: 400px;
    display: block;
    background-color: #f0f0f0;
}

.inline-feed-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: opacity 0.3s ease-in;
}

/* Hide the original feed-image class in link-item */
.link-item .feed-image {
    display: none;
}

.newsletter-item .value {
    margin-bottom: 10px;
}

.newsletter-item .value:last-of-type {
    margin-bottom: 0;
}

/* Feed list styles */
.refresh-options {
    display: flex;
    align-items: center;
    gap: 10px;
}

.button.full-width {
    max-width: none;
    width: auto;
}

/* Mobile hamburger menu styles migrated to components/_navbar.css */
