/**
 * Article Preview Drawer - Styles
 * Modern drawer component with right-slide animation
 */

/* Article Entry Modifications for Eye Icons */
.article-entry {
    position: relative;
    align-items: center;
}

.article-preview-btn {
    /* Reset button styles */
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    
    /* Positioning */
    display: flex;
    align-items: flex-start;
    justify-content: center;
    
    /* Size and spacing */
    width: 44px;  /* Touch-friendly target */
    height: 44px;
    margin-left: 12px;
    
    /* Visual styling */
    border-radius: 6px;
    background-color: transparent;
    transition: all 0.2s ease;
    
    /* Initially hidden - appears on article hover */
    opacity: 0;
    visibility: hidden;
    transform: translateX(8px);
}

/* Show preview button on article hover */
.article-entry:hover .article-preview-btn {
    opacity: 0.6;
    visibility: visible;
    transform: translateX(0);
}

.article-preview-btn:hover {
    opacity: 1 !important;
    transform: translateX(0) scale(1.05);
}

.article-preview-btn:focus .preview-eye-icon:focus {
    color: #BE3455;
    outline: none;
    opacity: 1 !important;
    visibility: visible;
    transform: translateX(0);
}

.article-preview-btn:active {
    transform: scale(0.95);
    background-color: transparent;
    outline: none;
    border: none;
}

.article-preview-btn:active .preview-eye-icon {
    color: #BE3455;
}

.preview-eye-icon {
    color: #666;
    transition: color 0.2s ease;
}

.article-preview-btn:hover .preview-eye-icon {
    color: #BE3455;
}

/* Drawer Structure */
.article-drawer {
    /* Positioning */
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100vh;
    z-index: 1000;
    
    /* Initial state - hidden off screen */
    transform: translateX(100%);
    
    /* Animation */
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    
    /* Visual styling */
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    border-left: 1px solid #e5e5e5;
    
    /* Content structure */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.article-drawer.open {
    transform: translateX(0);
}

/* Drawer Backdrop */
.drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.drawer-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Drawer Header */
.drawer-header {
    padding: 24px 24px 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    min-height: 80px;
}

.drawer-title {
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    padding-right: 16px;
}

.drawer-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: #666;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.drawer-close:hover {
    background-color: #f5f5f5;
    color: #333;
}

.drawer-close:focus {
    outline: 2px solid #BE3455;
    outline-offset: 2px;
}

/* Drawer Content */
.drawer-content {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Drawer Meta Section */
.drawer-meta {
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.drawer-meta-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.drawer-date,
.drawer-reading-time {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    color: rgba(26, 26, 26, 0.7);
    margin: 0;
}
.drawer-dot {
    opacity: 0.5;
}

.drawer-copy-link {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    color: #BE3455;
    text-decoration: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.drawer-copy-link:hover {
    background-color: rgba(190, 52, 85, 0.1);
    text-decoration: none;
}

/* TLDR Section */
.drawer-tldr {
    padding: 24px;
    border-bottom: 1px solid #f0f0f0;
}

.drawer-section-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.drawer-tldr-content {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #1a1a1a;
    margin: 0;
}

/* Notes Section */
.drawer-notes {
    padding: 24px;
    flex: 1;
}

.drawer-note {
    margin-bottom: 16px;
}

.drawer-note:last-child {
    margin-bottom: 0;
}

.drawer-note blockquote {
    margin: 0;
    padding: 16px 20px;
    background-color: #f9f9f9;
    border-left: 4px solid #BE3455;
    border-radius: 0 6px 6px 0;
    font-style: italic;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

.drawer-note p {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    margin: 0;
}

/* Drawer Footer - Temporarily Removed (will restore later) */
/*
.drawer-footer {
    padding: 24px;
    border-top: 1px solid #f0f0f0;
    background: white;
}

.drawer-read-btn {
    width: 100%;
    max-width: 100%;
    padding: 14px 24px;
    background-color: #BE3455;
    color: white;
    border: none;
    border-radius: 6px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    box-sizing: border-box;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.drawer-read-btn:hover {
    background-color: #a02d4a;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

.drawer-read-btn:focus {
    outline: 2px solid #BE3455;
    outline-offset: 2px;
}

.drawer-read-btn:active {
    transform: translateY(0);
}
*/

/* Empty States */
.drawer-empty {
    padding: 24px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Key Notes Content Styling */
.drawer-notes-content {
    padding: 0;
}

.drawer-notes-content .key-note {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f5f5f5;
}

.drawer-notes-content .key-note:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Key Notes Image Component */
.drawer-notes-content .key-note-image {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f5f5f5;
}

.drawer-notes-content .key-note-image:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.drawer-notes-content .drawer-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 0;
    display: block;
}

.drawer-notes-content .key-note p {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #1a1a1a;
    margin: 0 0 12px 0;
}

.drawer-notes-content .key-note blockquote {
    margin: 8px 0 0 0;
    padding: 12px 16px;
    background-color: #f8f9fa;
    border-left: 3px solid #BE3455;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #4a4a4a;
    font-style: italic;
    border-radius: 0 4px 4px 0;
}

.drawer-notes-content .key-note blockquote:before {
    content: '"';
    color: #BE3455;
    font-size: 18px;
    font-weight: 600;
}

.drawer-notes-content .key-note blockquote:after {
    content: '"';
    color: #BE3455;
    font-size: 18px;
    font-weight: 600;
}

/* Toast Notification */
.drawer-toast {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background-color: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    font-weight: 500;
    z-index: 1001;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.drawer-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 1023px) {
    .article-drawer {
        width: 90%;
    }
}

@media (max-width: 767px) {
    .article-drawer {
        width: 90%;
        min-width: 320px;
    }
    
    .article-preview-btn {
        width: 48px;
        height: 48px;
        /* Show buttons on mobile since hover doesn't work well */
        opacity: 0.4;
        visibility: visible;
        transform: translateX(0);
    }
    
    .article-entry:hover .article-preview-btn,
    .article-preview-btn:hover {
        opacity: 1;
    }
    
    .drawer-header {
        padding: 20px;
    }
    
    .drawer-title {
        font-size: 18px;
    }
    
    .drawer-tldr,
    .drawer-notes {
        padding: 20px;
    }
}

/* Touch device optimization */
@media (hover: none) and (pointer: coarse) {
    .article-preview-btn {
        opacity: 0.4;
        visibility: visible;
        transform: translateX(0);
    }
    
    .article-preview-btn:active {
        opacity: 1;
        background-color: rgba(0, 0, 0, 0.08);
    }
}

/* Body scrolling control */
body[data-drawer-body-scrolling="false"] {
    overflow: hidden;
    height: 100vh;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .article-drawer,
    .drawer-backdrop,
    .article-preview-btn {
        transition: none;
    }
    
    .article-preview-btn:hover {
        transform: none;
    }
    
    .article-drawer.open {
        transform: translateX(0);
    }
}

/* High contrast support */
@media (prefers-contrast: high) {
    .drawer-backdrop {
        background-color: rgba(0, 0, 0, 0.8);
    }
    
    .article-drawer {
        border-left: 2px solid #000;
    }
    
    .drawer-close:focus,
    .article-preview-btn:focus,
    .preview-eye-icon:focus {
        color: #BE3455;
        outline: none;
    }
}
