/* ClipScribe Main Stylesheet - Updated for note display fix */

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base Layout */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    height: 100vh;
    display: flex;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: #3a3a3a;
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #4a4a4a;
}

.sidebar-header h1 {
    font-size: 1.4em;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: block;
    padding: 12px 20px;
    color: #e0e0e0;
    text-decoration: none;
    border-bottom: 1px solid #4a4a4a;
    transition: background-color 0.2s;
}

.nav-item:hover {
    background-color: #4a4a4a;
    color: white;
}

.nav-item.active {
    background-color: #007bff;
    color: white;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #4a4a4a;
}

.user-info {
    font-size: 0.9em;
    color: #b0b0b0;
    margin-bottom: 10px;
}

.logout-link {
    color: #ff6b6b;
    text-decoration: none;
    font-size: 0.9em;
}

.logout-link:hover {
    text-decoration: underline;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 250px;
    background-color: white;
    overflow-y: auto;
}

.content-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #fafafa;
}

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

.header-text {
    flex: 1;
}

.content-header h2 {
    font-size: 1.8em;
    color: #333;
    margin-bottom: 5px;
}

.content-header p {
    color: #666;
    font-size: 0.95em;
}

/* Search Bar Styles */
.header-search {
    flex-shrink: 0;
}

.search-form {
    margin: 0;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 4px;
    transition: border-color 0.2s;
}

.search-container:focus-within {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.search-input {
    border: none;
    background: none;
    padding: 8px 12px;
    font-size: 14px;
    width: 300px;
    outline: none;
    color: #333;
}

.search-input::placeholder {
    color: #6c757d;
}

.search-type {
    border: none;
    background: none;
    padding: 8px 12px;
    font-size: 14px;
    color: #495057;
    cursor: pointer;
    outline: none;
}

.search-button {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

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

/* Responsive search */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-input {
        width: 250px;
    }
}

.content-body {
    padding: 30px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }
    .main-content {
        margin-left: 200px;
    }
}

/* Base text sizing */
body {
    font-size: 14px; /* Reduced from default browser 16px */
}

.content, .main-content, .article-content, .note-content {
    font-size: 14px;
}

/* Button Styles */
.btn {
    display: inline-block !important;
    padding: 10px 20px !important;
    border: none !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    font-size: 14px !important;
}

.btn-primary {
    background-color: #007bff !important;
    color: white !important;
}

.btn-primary:hover {
    background-color: #0056b3 !important;
    transform: translateY(-1px) !important;
    text-decoration: none !important;
}

.btn-danger {
    background-color: #dc3545 !important;
    color: white !important;
    border: none !important;
}

.btn-danger:hover {
    background-color: #c82333 !important;
    transform: translateY(-1px) !important;
    text-decoration: none !important;
}

.btn-small, .btn-sm {
    padding: 6px 12px !important;
    font-size: 0.8em !important;
}

.btn-small.btn-danger, .btn-sm.btn-danger {
    padding: 6px 10px !important;
}

.btn-outline {
    background: transparent !important;
    border: 1px solid #007bff !important;
    color: #007bff !important;
}

.btn-outline:hover {
    background: #007bff !important;
    color: white !important;
}

.btn-outline-secondary {
    background: transparent !important;
    border: 1px solid #6c757d !important;
    color: #6c757d !important;
}

.btn-outline-secondary:hover {
    background: #6c757d !important;
    color: white !important;
}

/* Success Message */
.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

/* Filter Tabs */
.filter-tabs-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.filter-tabs {
    display: flex;
    gap: 10px;
}

.filter-tab {
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    color: #666;
    text-decoration: none;
    font-size: 0.9em;
    transition: all 0.2s;
}

.filter-tab.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.filter-tab:hover {
    background: #f8f9fa;
    border-color: #007bff;
    text-decoration: none;
}

.filter-tab.active:hover {
    background: #0056b3;
}

/* Notes Styles */
.notes-grid {
    display: grid;
    gap: 20px;
}

.note-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s;
    position: relative;
}

.note-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.note-type-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.note-type-standalone {
    background-color: #e8f4f8;
    color: #0c5460;
}

.note-type-article-linked {
    background-color: #fff3cd;
    color: #856404;
}

.category-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.category-work, .category-WORK {
    background-color: #e3f2fd;
    color: #1976d2;
}

.category-personal, .category-PERSONAL {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.category-article, .category-ARTICLE {
    background-color: #fff3e0;
    color: #ef6c00;
}

.note-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.4;
    padding-right: 80px; /* Make room for badge */
}

/* Note content in LIST view (truncated) */
.note-card .note-content {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
    max-height: 150px;
    overflow: hidden;
    position: relative;
}

.note-card .note-content.long-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(transparent, white);
}

.article-context {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 0.9em;
}

.article-context strong {
    color: #495057;
}

.article-context a {
    color: #495057;
    text-decoration: none;
    transition: color 0.2s;
}

.article-context a:hover {
    color: #007bff;
    text-decoration: underline;
}

.article-context .article-url {
    color: #6c757d;
    font-size: 0.85em;
    margin-top: 4px;
    word-break: break-all;
}

.note-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85em;
    color: #888;
    border-top: 1px solid #f0f0f0;
    padding-top: 15px;
}

.note-actions {
    display: flex;
    gap: 8px;
}

/* Todos Styles */
.todos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.todos-container {
    display: flex;
    gap: 30px;
    margin-top: 25px;
}

.todos-section {
    flex: 1;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.section-title {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

.todo-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.todo-item:last-child {
    border-bottom: none;
}

.todo-checkbox {
    margin-top: 3px;
}

.todo-content {
    flex: 1;
}

.todo-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.4;
}

.todo-title.completed {
    text-decoration: line-through;
    color: #666;
}

.todo-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85em;
    color: #666;
    margin-bottom: 8px;
}

.priority-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
}

.priority-high {
    background-color: #dc3545;
    color: white;
}

.priority-medium {
    background-color: #ffc107;
    color: #333;
}

.priority-low {
    background-color: #28a745;
    color: white;
}

.todo-description {
    color: #666;
    font-size: 0.9em;
    line-height: 1.4;
    margin-top: 6px;
}

.todo-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #333;
}

.empty-state p {
    margin-bottom: 25px;
    line-height: 1.6;
}

/* Note Detail Styles */
.note-detail {
    max-width: 800px;
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.note-meta {
    color: #666;
    font-size: 0.9em;
}

.note-actions {
    display: flex;
    gap: 10px;
}

.article-context {
    background-color: #e8f4f8;
    border: 1px solid #bee5eb;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.article-context h4 {
    margin: 0 0 8px 0;
    color: #0c5460;
    font-size: 1em;
}

.article-context .article-url {
    font-size: 0.9em;
    color: #0c5460;
    word-break: break-all;
    margin-bottom: 10px;
}

.article-context .article-actions {
    margin-top: 10px;
}

/* Note content in DETAIL view (full content) */
.note-detail .note-content {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    line-height: 1.7;
    color: #333;
    font-size: 1.05em;
    max-height: none !important;
    overflow: visible !important;
    position: static !important;
}

.note-detail .note-content p {
    margin-bottom: 1em;
    display: block;
}

.note-detail .note-content h1,
.note-detail .note-content h2,
.note-detail .note-content h3,
.note-detail .note-content h4,
.note-detail .note-content h5,
.note-detail .note-content h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: #222;
}

.note-detail .note-content ul,
.note-detail .note-content ol {
    margin-bottom: 1em;
    padding-left: 1.5em;
}

.note-detail .note-content li {
    margin-bottom: 0.5em;
}

.note-detail .note-content blockquote {
    border-left: 4px solid #007bff;
    margin-left: 0;
    padding-left: 1em;
    color: #555;
    font-style: italic;
}

.note-detail .note-content code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9em;
}

.note-detail .note-content pre {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1em 0;
}

.note-detail .note-content pre code {
    background: none;
    padding: 0;
}

/* Tags Styles */
.tags-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.stats-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 1.5em;
    font-weight: bold;
    color: #007bff;
}

.stat-label {
    font-size: 0.8em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.popular-tags {
    margin-bottom: 25px;
}

.popular-tags h4 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.1em;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    color: white;
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 500;
    transition: all 0.2s;
}

.tag-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    color: white;
    text-decoration: none;
}

.tags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.tag-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s;
    position: relative;
}

.tag-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.tag-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 10px;
    border: 2px solid white;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    min-width: 16px;
    min-height: 16px;
}

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

.tag-name {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
    flex: 1;
    white-space: nowrap;
    word-break: normal;
    hyphens: none;
}

.tag-actions {
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s;
}

.tag-card:hover .tag-actions {
    opacity: 1;
}

.btn-outline-danger {
    background: transparent !important;
    border: 1px solid #dc3545 !important;
    color: #dc3545 !important;
}

.btn-outline-danger:hover {
    background: #dc3545 !important;
    color: white !important;
}

.tag-description {
    color: #666;
    font-size: 0.9em;
    line-height: 1.4;
    margin-bottom: 15px;
    min-height: 20px;
}

.tag-stats {
    display: flex;
    gap: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    font-size: 0.85em;
    color: #888;
}

.tag-stat {
    display: flex;
    align-items: center;
    gap: 5px;
}

.tag-stat-number {
    font-weight: 600;
    color: #333;
}

/* HTMX Indicators and Transitions */
.htmx-indicator {
    display: none;
    color: #666;
    font-style: italic;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

/* Loading indicator for infinite scroll */
#loading-indicator, #notes-loading-indicator {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.htmx-request.read-later-toggle {
    opacity: 0.6;
    cursor: wait;
}

.htmx-swapping {
    opacity: 0.5;
    transition: opacity 200ms ease-in-out;
}

.htmx-settling {
    opacity: 1;
    transition: opacity 200ms ease-in-out;
}

/* Tag removal animation */
.tag.htmx-swapping {
    transform: scale(0.8);
    opacity: 0;
    transition: all 200ms ease-out;
}

/* Authentication Pages */
.auth-page {
    font-family: Arial, sans-serif; 
    max-width: 400px; 
    margin: 50px auto; 
    padding: 20px;
}

.auth-page .form-group { 
    margin-bottom: 15px; 
}

.auth-page label { 
    display: block; 
    margin-bottom: 5px; 
}

.auth-page input { 
    width: 100%; 
    padding: 8px; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
}

.auth-page button { 
    background: #007bff; 
    color: white; 
    padding: 10px 20px; 
    border: none; 
    border-radius: 4px; 
    cursor: pointer; 
}

.auth-page .error { 
    color: red; 
    margin-top: 10px; 
}

.auth-page .header { 
    text-align: center; 
    margin-bottom: 30px; 
}

/* Articles Pages */
.articles-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.articles-table {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow-x: auto; /* Allow horizontal scroll if needed */
    overflow-y: visible; /* Don't clip vertical overflow */
}

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

.articles-table th {
    background-color: #f8f9fa;
    color: #555;
    font-weight: 600;
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.articles-table td {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
    position: relative; /* Ensure proper stacking context */
    overflow: visible; /* Don't clip content */
}

.articles-table tr:hover {
    background-color: #f8f9fa;
}

.articles-table tr:last-child td {
    border-bottom: none;
}

.article-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.4;
}

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

.article-title a:hover {
    color: #007bff;
    text-decoration: underline;
}

.article-summary {
    color: #666;
    font-size: 0.85em;
    line-height: 1.4;
    margin-top: 4px;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    background-color: #e9ecef;
    color: #495057;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 24px;
    box-sizing: border-box;
    transform: translateZ(0); /* Create stacking context */
    backface-visibility: hidden; /* Prevent flickering */
    -webkit-font-smoothing: antialiased;
}

.tag::after {
    content: "✕";
    opacity: 0;
    transition: opacity 0.2s ease;
    font-weight: bold;
    font-size: 0.9em;
    color: inherit;
    margin-left: 2px;
    pointer-events: none; /* Prevent hover issues with pseudo-element */
}

.tag:hover {
    background-color: #dc3545;
    color: white;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
    /* Removed transform to prevent boundary issues */
}

.tag:hover::after {
    opacity: 1;
}

/* Ensure parent container doesn't cause overflow issues */
.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    overflow: visible; /* Ensure tags aren't clipped */
    padding: 2px; /* Small padding to prevent edge clipping */
}

.date-added {
    color: #666;
    font-size: 0.9em;
    white-space: nowrap;
}

.read-later-toggle {
    background: none;
    border: 2px solid #ddd;
    border-radius: 20px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.2s;
    min-width: 60px;
}

.read-later-toggle.active {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.read-later-toggle.inactive {
    background-color: #f8f9fa;
    border-color: #ddd;
    color: #666;
}

.read-later-toggle:hover {
    transform: scale(1.05);
}

.read-later-toggle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.notes-button {
    background: none;
    border: 2px solid #ddd;
    border-radius: 20px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.2s;
    min-width: 60px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.notes-button.add {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

.notes-button.add:hover {
    background-color: #218838;
    border-color: #1e7e34;
    color: white;
    text-decoration: none;
    transform: scale(1.05);
}

.notes-button.view {
    background-color: #6f42c1;
    border-color: #6f42c1;
    color: white;
}

.notes-button.view:hover {
    background-color: #5a32a3;
    border-color: #512c96;
    color: white;
    text-decoration: none;
    transform: scale(1.05);
}

/* Form Styles */
.form-container {
    max-width: 600px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 30px;
}

.article-form, .note-form, .tag-form {
    max-width: 600px;
}

.note-form {
    max-width: 800px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-input, .form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-textarea {
    min-height: 300px;
    resize: vertical;
    font-family: 'Monaco', 'Menlo', 'SF Mono', monospace;
    line-height: 1.6;
}

.todos-new .form-input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.todos-new .form-textarea {
    min-height: 100px;
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.todos-new .form-input:focus {
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.form-help {
    margin-top: 6px;
    font-size: 14px;
    color: #666;
}

.todos-new .form-help {
    font-size: 0.85em;
    margin-top: 5px;
}

.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    background-color: white;
    cursor: pointer;
}

.todos-new .form-select {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.todos-new .btn {
    font-size: 14px;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

.info-box {
    background-color: #e8f4f8;
    border: 1px solid #bee5eb;
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
}

.info-box h4 {
    margin-top: 0;
    color: #0c5460;
}

.info-box ul {
    margin-bottom: 0;
    padding-left: 20px;
}

.info-box li {
    margin-bottom: 8px;
    color: #0c5460;
}

.url-preview {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 15px;
    border-radius: 6px;
    margin-top: 10px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 14px;
    word-break: break-all;
}

/* Color Picker Styles */
.color-picker-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.color-input {
    width: 60px;
    height: 40px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
}

.color-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-preset {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
}

.color-preset:hover {
    transform: scale(1.1);
    border-color: #007bff;
}

.color-preset.active {
    border-color: #007bff;
    transform: scale(1.1);
}

.tag-preview {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    color: white;
    font-weight: 500;
    margin-top: 10px;
    transition: all 0.2s;
}

.tag-preview-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
}

/* Tag Detail Styles */
.tag-detail {
    max-width: 900px;
}

.tag-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.content-sections {
    display: grid;
    gap: 30px;
}

.content-section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.section-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
}

.section-count {
    background: #f8f9fa;
    color: #666;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
}

.content-grid {
    display: grid;
    gap: 15px;
}

.content-item {
    padding: 15px;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    transition: all 0.2s;
}

.content-item:hover {
    border-color: #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.item-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.item-title a {
    color: inherit;
    text-decoration: none;
}

.item-title a:hover {
    color: #007bff;
}

.item-meta {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 8px;
}

.item-content {
    color: #555;
    line-height: 1.5;
    max-height: 100px;
    overflow: hidden;
    position: relative;
}

.item-content.long-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(transparent, white);
}

.item-url {
    color: #666;
    font-size: 0.85em;
    word-break: break-all;
    margin-bottom: 8px;
}

.status-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-processing {
    background-color: #cce5ff;
    color: #004085;
}

.status-completed {
    background-color: #d4edda;
    color: #155724;
}

.status-failed {
    background-color: #f8d7da;
    color: #721c24;
}

.note-type-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: #e8f4f8;
    color: #0c5460;
}

.empty-section {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-style: italic;
}

.quick-actions {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    text-align: center;
}

/* Dashboard Styles */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.section {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2em;
}

.item {
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
}

.item:last-child {
    border-bottom: none;
}

.item-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.item-meta {
    font-size: 0.85em;
    color: #666;
}

.api-info {
    margin-top: 30px;
    padding: 20px;
    background: #e8f4f8;
    border-radius: 8px;
    text-align: center;
}

.api-info code {
    background: #333;
    color: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
}

/* Note Type Selector */
.note-type-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.note-type-option {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.note-type-option.selected {
    border-color: #007bff;
    background-color: #f0f8ff;
}

.note-type-option h5 {
    margin: 0 0 5px 0;
    color: #333;
}

.note-type-option p {
    margin: 0;
    font-size: 0.9em;
    color: #666;
}

.markdown-help {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 15px;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 0.9em;
}

.markdown-help h5 {
    margin: 0 0 10px 0;
    color: #333;
}

.markdown-help code {
    background: #e9ecef;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', monospace;
}

/* Error Pages */
.error-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 40px;
    margin-bottom: 30px;
}

.error-code {
    font-size: 4em;
    font-weight: bold;
    color: #dc3545;
    margin-bottom: 20px;
}

.error-title {
    font-size: 2em;
    color: #333;
    margin-bottom: 15px;
}

.error-message {
    color: #666;
    margin-bottom: 30px;
    line-height: 1.5;
    font-size: 1.1em;
}

.error-details {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
    color: #856404;
}

.action-buttons {
    margin-top: 30px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    margin: 0 10px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1em;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn:hover {
    opacity: 0.8;
}

.retry-info {
    margin: 20px 0;
    font-size: 0.9em;
    color: #666;
}

.suggestions {
    margin: 30px 0;
    text-align: left;
}

.suggestions h4 {
    color: #333;
    margin-bottom: 15px;
}

.suggestions ul {
    list-style: none;
    padding: 0;
}

.suggestions li {
    margin: 10px 0;
}

.suggestions a {
    color: #007bff;
    text-decoration: none;
    font-size: 1.1em;
}

.suggestions a:hover {
    text-decoration: underline;
}

.search-box {
    margin: 30px 0;
}

.search-box input {
    padding: 10px;
    width: 300px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
}

.search-box button {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .filter-tabs-container {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .filter-tabs {
        justify-content: center;
    }
    
    .todos-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .note-card {
        padding: 15px;
    }
    
    .note-title {
        padding-right: 60px;
    }
    
    .tags-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .stats-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .tags-grid {
        grid-template-columns: 1fr;
    }
    
    .tag-actions {
        opacity: 1;
    }
    
    .sections {
        grid-template-columns: 1fr;
    }
    
    .auth-page {
        margin: 20px auto;
        padding: 15px;
    }
}