/* Card component */

.card {
    background: var(--category-base-background);
    border: none;
    border-radius: 4px;
    padding: 0;  /* Remove padding for full space */
    cursor: default;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    height: 100%;
    max-height: 87px;  /* Restored original height */
    max-width: 117px;
    overflow: hidden;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
}

.card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

/* Card hover overlay */
.card-hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--category-base-background);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
    border-radius: 4px;
    pointer-events: none;
}

.card:hover .card-hover-overlay {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}

.card.expanded .card-hover-overlay {
    display: none !important;
}

.card-hover-overlay svg {
    width: 24px;
    height: 24px;
    stroke: #fff;
}

/* Card title */
.card-title {
    font-size: 11px;
    font-weight: 700;
    margin: 0;  /* Remove margins */
    color: #f0f0f0;
    cursor: text;
    padding: 0 5px;  /* Only horizontal padding */
    text-align: center;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* Card content */
.card-content {
    font-size: 11px;
    color: #b0b0b0;
    line-height: 1.6;
    cursor: text;
    display: none;  /* Hide content - show only title */
}

/* Editor container for Editor.js */
.editor-container {
    width: 100%;
    display: none; /* Hidden in collapsed state */
}

/* Show editor in expanded card */
.card.expanded .editor-container {
    display: block;
    background: white;
    border-radius: 4px;
    padding: 0;
}

/* Lexical editor styles */
.card.expanded .lexical-editor {
    min-height: 100%;
    padding: 20px;
    outline: none;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

/* Hide editor container in collapsed cards */
.card:not(.expanded) .editor-container {
    display: none;
}

/* Expanded card styles */
.card.expanded {
    position: fixed !important;
    left: 50% !important;
    bottom: 0 !important;
    transform: translateX(-50%) !important;
    width: 90vw !important;
    min-width: 1100px !important;
    max-width: 1400px !important;
    height: calc(100vh * 2/3) !important;
    min-height: 600px !important;
    overflow: hidden;
    z-index: 999999 !important;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.3) !important;
    background: #ffffff !important;
    color: #000;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    border-radius: 8px 8px 0 0 !important;
    animation: slideUp 0.3s ease-out;
}

/* Slide up animation for expanded card */
@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100%);
    }
    to {
        transform: translateX(-50%) translateY(0);
    }
}

/* Expanded card content wrapper */
.expanded-card-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: white;
}

/* Header section */
.expanded-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
    background: white;
}

/* Header buttons */
.header-buttons {
    display: flex;
    gap: 10px;
}

.save-card-btn, .delete-card-btn {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    border: none;
}

.save-card-btn {
    background: #059669;
    color: white;
}

.save-card-btn:hover {
    background: #047857;
}

.delete-card-btn {
    background: #ef4444;
    color: white;
}

.delete-card-btn:hover {
    background: #dc2626;
}

/* Main content area */
.expanded-card-main {
    flex: 1;
    display: flex;
    overflow: hidden;
    background: white;
}

/* Editor section */
.editor-section {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: white;
}

/* Bookmarks section */
.bookmarks-section {
    width: 350px;
    padding: 20px;
    background: #f9fafb;
    border-left: 1px solid #e5e7eb;
    overflow-y: auto;
}

/* Bookmark card */
.bookmark-card {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s;
}

.bookmark-card:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.bookmark-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px 0;
}

.bookmark-description {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
    margin: 0 0 12px 0;
}

.bookmark-url {
    font-size: 13px;
    color: #2563eb;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bookmark-url:hover {
    text-decoration: underline;
}

.bookmark-date {
    font-size: 12px;
    color: #9ca3af;
}

/* Expanded card overlay */
.expanded-card-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100vh - (100vh * 2/3));
    background: rgba(0, 0, 0, 0.5);
    z-index: 999998;
    cursor: pointer;
}

.card.expanded .content-wrapper {
    /* Remove old wrapper styles */
    display: none;
}

/* Close button for expanded cards */
.card.expanded .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: #fafafa;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.card.expanded .close-btn:hover {
    background: #e8e8e8;
}

.card.expanded .close-btn svg {
    width: 16px;
    height: 16px;
    stroke: #444;
}

/* Expanded card title in header */
.card.expanded .card-title {
    font-size: 24px;
    font-weight: 600;
    color: #111827;
    margin: 0;
    padding: 0;
    text-align: left;
    width: auto;
    height: auto;
    display: block;
    outline: none;
}

/* Expanded card content */
.card.expanded .card-content {
    font-size: 14px;
    color: #333;
    line-height: 1.8;
    flex: 1;
    display: block;  /* Show content when expanded */
    width: 100%;
    max-width: 800px;
    padding: 20px;
}

/* Editor container styling */
.card.expanded .editor-container {
    min-height: 100%;
    height: auto;
    max-height: none;
    min-width: 100%;
    width: 100%;
    overflow-y: visible;
    border: none;
    background: #fff;
    padding: 0;
    box-sizing: border-box;
}

/* Bullet list styles */
.bullet-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bullet-item {
    display: flex;
    align-items: flex-start;
    padding: 1px 0;
}

.bullet-item::before {
    content: '•';
    color: #666;
    margin-right: 6px;
    flex-shrink: 0;
}

.bullet-item.indent-1 { padding-left: 11px; }
.bullet-item.indent-2 { padding-left: 23px; }
.bullet-item.indent-3 { padding-left: 34px; }

.bullet-content {
    flex: 1;
    outline: none;
    padding: 1px 3px;
    border-radius: 2px;
    min-height: 13px;
}

/* Expanded card bullet styles */
.card.expanded .bullet-item {
    padding: 4px 0;
}

.card.expanded .bullet-item::before {
    font-size: 14px;
    color: #333333;
    margin-right: 10px;
}

.card.expanded .bullet-content {
    font-size: 14px;
    color: #333333;
    padding: 2px 4px;
    min-height: 24px;
}

.card.expanded .bullet-item.indent-1 { padding-left: 30px; }
.card.expanded .bullet-item.indent-2 { padding-left: 60px; }
.card.expanded .bullet-item.indent-3 { padding-left: 90px; }

/* Remove old button styles */
.card.expanded .expanded-card-buttons {
    display: none;
}

/* Hide delete button from original position */
.card.expanded .Btn {
    display: none;
}
