/*!
 * Premium Casting Calls - Bookmark Functionality CSS
 * 
 * Description: Styles for the bookmark/save post functionality
 * Version: 1.0.0
 * Author: NS33@castandcrew
 * License: GPL v2+
 * 
 * This file contains styles for:
 * - Save post buttons
 * - Bookmark icons and states
 * - Post wrapper positioning
 * - Hover and interaction states
 * 
 * Dependencies: Font Awesome (for icons)
 * Enqueued on: Front-end pages with casting calls
 */

/* ==========================================================================
   Bookmark Container and Positioning
   ========================================================================== */

/* Post wrapper positioning */
.pcc-post-wrapper {
    position: relative;
}

/* Bookmark container - clean positioning */
.pcc-post-bookmark {
    margin: 10px 0 0 0;
    padding: 10px 0 0 0;
    display: block;
    text-align: left;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* ==========================================================================
   Save Post Button Styles
   ========================================================================== */

/* Base save post button styling */
.pcc-save-post {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #0056b3;
    border-radius: 20px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    box-shadow: 0 2px 6px rgba(0, 86, 179, 0.15);
    white-space: nowrap;
    min-width: auto;
    height: auto;
    text-decoration: none;
    color: #0056b3;
    font-weight: 500;
}

/* Hover state */
.pcc-save-post:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #0056b3;
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.3);
    color: #0056b3;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Focus state for accessibility */
.pcc-save-post:focus {
    background: rgba(255, 255, 255, 1) !important;
    border-color: #0056b3 !important;
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.2) !important;
    outline: none !important;
    color: #0056b3 !important;
}

/* Active/pressed state */
.pcc-save-post:active {
    background: rgba(240, 248, 255, 1) !important;
    border-color: #0056b3 !important;
    transform: translateY(0);
    color: #0056b3 !important;
}

/* ==========================================================================
   Bookmark Icon States
   ========================================================================== */

/* Default bookmark icon (empty) */
.pcc-bookmark-icon {
    color: #0056b3 !important;
    font-size: 0.9rem !important;
    display: inline !important;
    transition: all 0.3s ease;
}

/* Filled bookmark icon (saved state) */
.pcc-bookmark-icon-filled {
    display: none !important;
    color: #0056b3 !important;
    font-size: 0.9rem !important;
    transition: all 0.3s ease;
}

/* When post is saved - show filled icon */
.pcc-save-post.pcc-saved .pcc-bookmark-icon {
    display: none !important;
}

.pcc-save-post.pcc-saved .pcc-bookmark-icon-filled {
    display: inline !important;
}

/* Saved state styling */
.pcc-save-post.pcc-saved {
    background: rgba(240, 248, 255, 0.95) !important;
    border-color: #0056b3 !important;
    color: #0056b3 !important;
    box-shadow: 0 2px 8px rgba(0, 86, 179, 0.25) !important;
}

.pcc-save-post.pcc-saved:hover {
    background: rgba(240, 248, 255, 1) !important;
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.35) !important;
}

/* ==========================================================================
   Bookmark Text Labels
   ========================================================================== */

/* Bookmark text styling */
.pcc-save-post .pcc-bookmark-text {
    color: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1;
    margin: 0;
}

/* Loading state text */
.pcc-save-post.pcc-loading .pcc-bookmark-text::after {
    content: "...";
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: ""; }
    40% { content: "."; }
    60% { content: ".."; }
    80%, 100% { content: "..."; }
}

/* ==========================================================================
   Single Post Page Specific Styles
   ========================================================================== */

/* Single post bookmark styles - scoped to single posts only */
body.single .pcc-post-bookmark {
    margin: 10px 0 0 0;
    padding: 10px 0 0 0;
    display: block;
    text-align: left;
    opacity: 0;
    transition: opacity 0.3s ease;
}

body.single .pcc-save-post {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid #0056b3 !important;
    border-radius: 20px !important;
    padding: 6px 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-size: 0.85rem !important;
    box-shadow: 0 2px 6px rgba(0, 86, 179, 0.15) !important;
    white-space: nowrap !important;
    min-width: auto !important;
    height: auto !important;
}

body.single .pcc-save-post:hover {
    background: rgba(255, 255, 255, 1) !important;
    border-color: #0056b3 !important;
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.3) !important;
}

body.single .pcc-save-post .pcc-bookmark-icon {
    color: #0056b3 !important;
    font-size: 0.9rem !important;
    display: inline !important;
}

body.single .pcc-save-post .pcc-bookmark-icon-filled {
    display: none !important;
    color: #0056b3 !important;
    font-size: 0.9rem !important;
}

body.single .pcc-save-post.pcc-saved .pcc-bookmark-icon {
    display: none !important;
}

body.single .pcc-save-post.pcc-saved .pcc-bookmark-icon-filled {
    display: inline !important;
}

body.single .pcc-save-post.pcc-saved {
    background: rgba(240, 248, 255, 0.95) !important;
    border-color: #0056b3 !important;
    box-shadow: 0 2px 8px rgba(0, 86, 179, 0.25) !important;
}

body.single .pcc-save-post.pcc-saved:hover {
    background: rgba(240, 248, 255, 1) !important;
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.35) !important;
}

/* ==========================================================================
   Error and Loading States
   ========================================================================== */

/* Loading state */
.pcc-save-post.pcc-loading {
    opacity: 0.7;
    pointer-events: none;
    cursor: wait;
}

.pcc-save-post.pcc-loading .pcc-bookmark-icon,
.pcc-save-post.pcc-loading .pcc-bookmark-icon-filled {
    animation: pulse 1s infinite ease-in-out;
}

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

/* Error state */
.pcc-save-post.pcc-error {
    background: rgba(255, 240, 240, 0.95) !important;
    border-color: #dc3545 !important;
    color: #dc3545 !important;
}

.pcc-save-post.pcc-error:hover {
    background: rgba(255, 240, 240, 1) !important;
    border-color: #dc3545 !important;
    color: #dc3545 !important;
}

.pcc-save-post.pcc-error .pcc-bookmark-icon,
.pcc-save-post.pcc-error .pcc-bookmark-icon-filled {
    color: #dc3545 !important;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Mobile adjustments */
@media (max-width: 768px) {
    .pcc-save-post {
        font-size: 0.8rem;
        padding: 5px 10px;
        gap: 4px;
    }
    
    .pcc-bookmark-icon,
    .pcc-bookmark-icon-filled {
        font-size: 0.8rem !important;
    }
    
    .pcc-save-post .pcc-bookmark-text {
        font-size: 0.8rem;
    }
    
    /* Always visible on mobile for better usability */
    .pcc-post-bookmark {
        opacity: 1 !important;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .pcc-post-bookmark,
    .pcc-save-post {
        display: none !important;
    }
}

/* ==========================================================================
   High Contrast Mode Support
   ========================================================================== */

@media (prefers-contrast: high) {
    .pcc-save-post {
        border: 2px solid #000000 !important;
        background: #ffffff !important;
        color: #000000 !important;
    }
    
    .pcc-save-post:hover,
    .pcc-save-post:focus {
        background: #f0f0f0 !important;
        border-color: #000000 !important;
        color: #000000 !important;
    }
    
    .pcc-bookmark-icon,
    .pcc-bookmark-icon-filled {
        color: #000000 !important;
    }
}

/* ==========================================================================
   Reduced Motion Support
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .pcc-save-post,
    .pcc-bookmark-icon,
    .pcc-bookmark-icon-filled,
    .pcc-post-bookmark {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }
}