/**
 * Saved Posts Page Styles
 * 
 * Styles specific to the My Saved Posts page
 * 
 * Version: 1.0.0
 */

/* ============================================
   SweetAlert2 Custom Styling
   ============================================ */

.swal-large-title { 
    font-size: 24px !important; 
}

.swal2-html-container { 
    font-size: 16px !important; 
}

.swal2-confirm { 
    font-size: 16px !important; 
    padding: 12px 40px !important; 
    min-width: 120px !important; 
}

/* Large button styles for Clear All modal */
.swal-large-button {
    font-size: 16px !important;
    padding: 14px 32px !important;
    min-width: 140px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    border: none !important;
    transition: all 0.2s ease !important;
}

.swal-large-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}

/* Specific colors for confirm/cancel */
.swal2-confirm.swal-large-button {
    background-color: #ef4444 !important;
    color: white !important;
}

/* Success button (green) */
.swal2-success .swal2-confirm.swal-large-button {
    background-color: #28a745 !important;
    color: white !important;
}

.swal2-cancel.swal-large-button {
    background-color: #6c757d !important;
    color: white !important;
    margin-right: 12px !important;
}

/* ============================================
   Saved Post Card Styles
   ============================================ */

.saved-post-card {
    position: relative;
}

/* Override save button on saved posts page */
.saved-post-card .save-post-btn {
    display: none;
}

/* Add spacing between saved post cards */
article.content-card.saved-post-card {
    margin-bottom: 25px;
}

article.content-card.saved-post-card:last-child {
    margin-bottom: 0;
}

/* ============================================
   PDF Download Button
   ============================================ */

.pdf-download-btn {
    position: absolute;
    top: 12px;
    right: 60px; /* Position to the left of remove button */
    background: rgba(44, 82, 130, 0.95);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(44, 82, 130, 0.3);
    z-index: 10;
    text-decoration: none;
}

.pdf-download-btn:hover {
    background: #1e3a5f;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(44, 82, 130, 0.5);
}

/* Direct link to AWS PDF - slightly different shade */
.pdf-direct-link {
    background: rgba(16, 185, 129, 0.95) !important; /* Green for direct download */
}

.pdf-direct-link:hover {
    background: #059669 !important;
}

/* Generate button - keeps blue color */
.pdf-generate-btn {
    background: rgba(44, 82, 130, 0.95);
}

/* ============================================
   Remove Button
   ============================================ */

.remove-saved-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(239, 68, 68, 0.95);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    z-index: 10;
}

.remove-saved-btn:hover {
    background: #dc2626;
    transform: scale(1.15) rotate(90deg);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.5);
}

/* ============================================
   Save Button Override
   ============================================ */

/* Save button positioning - override default */
.content-card .save-post-btn {
    position: absolute;
    top: 8px !important;
    right: 8px !important;
    width: 40px !important;
    height: 40px !important;
    z-index: 100 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

/* ============================================
   Container Styles
   ============================================ */

/* Adjust layout for better spacing */
#saved-posts-container.documents {
    padding: 0;
}

#saved-posts-container .content-card {
    max-width: 100%;
}

/* Saved Posts - List view max-width responsive */
#saved-posts-container.documents-list {
    max-width: 1400px !important;
}

@media (max-width: 1439px) {
    #saved-posts-container.documents-list {
        max-width: 1200px !important;
    }
}

/* ============================================
   Pagination Styles
   ============================================ */

.page-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: #374151;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.page-number:hover {
    border-color: #2c5282;
    color: #2c5282;
    transform: translateY(-2px);
}

.page-number.active {
    background: #2c5282;
    color: white;
    border-color: #2c5282;
}

.page-number.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================
   Mobile Responsive
   ============================================ */

@media (max-width: 768px) {
    /* Remove padding-right on mobile */
    .page-template-template-saved-posts .entry-content {
        padding-right: 0 !important;
    }
    
    #search-filter-bar {
        padding: 16px !important;
    }
    
    .action-btn .btn-text {
        display: none;
    }
    
    .action-btn svg {
        margin: 0 !important;
    }
    
    #pagination-buttons .page-number {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
    }
    
    #filter-toggle-header {
        display: block !important;
    }
    
    #filter-content {
        display: none;
        padding-top: 16px;
    }
    
    #filter-content.expanded {
        display: block;
    }
    
    #filter-toggle-icon.rotated {
        transform: rotate(180deg);
    }
    
    /* Hide view toggle on mobile - force vertical layout */
    .saved-view-toggle {
        display: none !important;
    }
    
    /* Make list view look like grid (vertical cards) on mobile */
    #saved-posts-container .content-card .card-inner {
        flex-direction: column !important;
    }
    
    #saved-posts-container .content-card .card-image {
        width: 100% !important;
        height: 200px !important;
        min-width: unset !important;
        max-width: unset !important;
    }
    
    #saved-posts-container .content-card .card-content {
        padding: 16px !important;
    }
    
    /* Simplify action buttons on mobile */
    .action-btn .btn-text {
        display: none;
    }
    
    .action-btn {
        padding: 8px !important;
    }
}

@media (max-width: 480px) {
    #search-filter-bar {
        padding: 12px !important;
    }
    
    select {
        font-size: 13px !important;
    }
    
    .action-btn {
        padding: 6px 10px !important;
        font-size: 12px !important;
    }
}
