/* 
 * Bookmark Editor Widget Styles
 * Uses Quill's bubble theme for a cleaner, more compact experience
 */

.bookmark-editor-widget {
    margin: 1em 0;
    width: 100%;
}

.bookmark-editor-content {
    display: flex;
    gap: 1em;
    align-items: flex-start;
    background: #ffffff;
    border-radius: 8px;
    padding: 1em;
    border: 1px solid #ffffff;
}

/* Override Quill's default padding in bookmark editor */
.bookmark-editor-widget .ql-editor {
    padding: 1em !important;
}

/* Override expanded card editor padding specifically for bookmark editor */
.card.expanded .ql-bookmark-editor-blot .ql-editor {
    padding: 0 !important;
}

/* Make the widget blot full width */
.ql-bookmark-editor-blot {
    margin-left: -40px;
    margin-right: -40px;
    width: calc(100% + 80px);
}

/* Adjust for the expanded card's 60px padding */
.card.expanded .ql-bookmark-editor-blot {
    margin-left: -60px;
    margin-right: -60px;
    width: calc(100% + 120px);
}

/* Nested editor container - 3/4 width */
.nested-editor-container {
    flex: 3;
    min-width: 0;
}

.nested-editor {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    min-height: 150px;
    max-height: 300px;
    overflow: hidden;
    position: relative;
}

/* Remove toolbar styles for bubble theme - it uses floating toolbar */

/* Ensure ql-container is properly sized for bubble theme */
.nested-editor .ql-container {
    border-radius: 6px; /* Full border radius for bubble theme */
    font-size: 14px;
    overflow: visible !important;
    position: relative;
    display: block;
}

.nested-editor .ql-editor::-webkit-scrollbar {
    width: 8px;
}

.nested-editor .ql-editor::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 4px;
}

.nested-editor .ql-editor::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.nested-editor .ql-editor::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Bookmark widget container - 1/3 width */
.bookmark-widget-container {
    flex: 1;
    min-width: 0;
}

/* Ensure bookmark widget fits container */
.bookmark-editor-content .bookmark-widget {
    max-width: 100%;
}

/* Compact bookmark widget styles inside bookmark editor */
.bookmark-widget-container .bookmark-widget {
    width: 100%;
    max-width: 15em;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    outline: none;
}

.bookmark-widget-container .bookmark-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Compact visual area */
.bookmark-widget-container .bookmark-visual {
    width: 100%;
    height: 4em; /* Compact height */
    position: relative;
    overflow: hidden;
    background: linear-gradient(270deg, #ce68d9, #45c6db, #45db79);
    background-size: 800% 800%;
    animation: GradientAnimation 3s ease infinite;
}

/* Placeholder icon */
.bookmark-widget-container .bookmark-visual::before {
    content: "🔖";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5em; /* Smaller icon */
    color: rgba(255, 255, 255, 0.9);
    z-index: 0;
}

/* Compact delete button */
.bookmark-widget-container .bookmark-delete {
    position: absolute;
    top: 0.3em;
    right: 0.3em;
    width: 1.5em;
    height: 1.5em;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 0.8em;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    z-index: 2;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bookmark-widget-container .bookmark-widget:hover .bookmark-delete {
    opacity: 1;
}

.bookmark-widget-container .bookmark-delete:hover {
    background: rgba(255, 0, 0, 0.8);
}

/* Compact info section */
.bookmark-widget-container .bookmark-info {
    padding: 0.75em;
}

.bookmark-widget-container .bookmark-title {
    font-weight: 600;
    font-size: 0.8em;
    color: #2d3748;
    margin-bottom: 0.25em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bookmark-widget-container .bookmark-url {
    font-size: 0.65em;
    color: #718096;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    text-decoration: none;
    cursor: pointer;
}

.bookmark-widget-container .bookmark-url:hover {
    color: #667eea;
}

/* Compact action buttons */
.bookmark-widget-container .bookmark-actions {
    display: flex;
    gap: 0.4em;
    padding: 0 0.75em 0.75em;
}

.bookmark-widget-container .bookmark-action {
    flex: 1;
    padding: 0.4em 0.5em;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.65em;
    color: #4a5568;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25em;
    outline: none;
    font-family: inherit;
}

.bookmark-widget-container .bookmark-action:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

@keyframes GradientAnimation {
    0% { background-position: 0% 50% }
    50% { background-position: 100% 50% }
    100% { background-position: 0% 50% }
}

/* Custom toolbar button */
.ql-bookmark-editor {
    width: 28px !important;
}

.ql-bookmark-editor svg {
    width: 18px;
    height: 18px;
}

/* Night mode support */
.night-mode .bookmark-editor-content {
    background: #2d3748;
    border-color: #4a5568;
}

.night-mode .nested-editor {
    background: #1a202c;
    border-color: #4a5568;
}

.night-mode .nested-editor .ql-container {
    color: #f7fafc;
}

/* Night mode bubble theme tooltip */
.night-mode .nested-editor .ql-bubble .ql-tooltip {
    background: #2d3748;
    border-color: #4a5568;
}

.night-mode .nested-editor .ql-bubble .ql-tooltip-arrow {
    border-bottom-color: #2d3748;
}

/* Night mode for compact bookmark widget */
.night-mode .bookmark-widget-container .bookmark-widget {
    background: #2d3748;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.night-mode .bookmark-widget-container .bookmark-widget:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.night-mode .bookmark-widget-container .bookmark-visual {
    background: linear-gradient(270deg, #9f45b0, #2d72db, #1a9658);
}

.night-mode .bookmark-widget-container .bookmark-title {
    color: #f7fafc;
}

.night-mode .bookmark-widget-container .bookmark-url {
    color: #cbd5e0;
}

.night-mode .bookmark-widget-container .bookmark-url:hover {
    color: #9f7aea;
}

.night-mode .bookmark-widget-container .bookmark-action {
    background: #4a5568;
    border-color: #718096;
    color: #f7fafc;
}

.night-mode .bookmark-widget-container .bookmark-action:hover {
    background: #9f7aea;
    border-color: #9f7aea;
}

/* Responsive */
@media (max-width: 768px) {
    .bookmark-editor-content {
        flex-direction: column;
    }
    
    .nested-editor-container,
    .bookmark-widget-container {
        flex: none;
        width: 100%;
    }
}
