/**
 * Saved Posts CSS
 * Styling for saved posts functionality
 */

/* Base Save Button Styles (Shared) */
.post-save-container {
    display: inline-block; /* Default display */
}

.save-post,
.unsave-post {
    background-color: transparent; /* Default: transparent background */
    border: none;
    border-radius: 4px;
    color: #6b7280; /* Default: gray color for unsaved */
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    padding: 4px; /* Minimal padding for icon button feel */
    transition: all 0.2s ease;
    line-height: 1;
}

/* Saved State (.unsave-post class applied by JS) */
.unsave-post {
    color: #ef4444; /* Red color for saved state */
}

/* Icon Styles */
.save-post .dashicons-heart,
.unsave-post .dashicons-heart {
    font-size: 20px;
    height: 20px;
    width: 20px;
    transition: transform 0.2s ease, color 0.2s ease;
}

/* Text inside button (optional, can be hidden) */
.save-post .button-text,
.unsave-post .button-text {
    margin-left: 4px;
    font-size: 13px;
}

/* Hover States */
.save-post:hover,
.save-post.hover {
    color: #374151; /* Darker gray on hover for unsaved */
    transform: scale(1.1);
}

.unsave-post:hover,
.unsave-post.hover {
    color: #dc2626; /* Darker red on hover for saved */
    transform: scale(1.1);
}

/* Active State */
.save-post:active,
.unsave-post:active {
    transform: scale(1);
}

/* Context Specific Styles */

/* 1. Single Post Meta (.post-save-context-single) */
.post-save-context-single {
    /* Container is already inline-block */
    /* border: 2px solid red !important; */ /* TEMPORARY: Removed */
    /* background-color: yellow !important; */ /* TEMPORARY: Removed */
    /* padding: 5px !important; */ /* TEMPORARY: Removed */
    /* display: inline-block !important; */ /* TEMPORARY: Removed */
    /* color: black !important; */ /* TEMPORARY: Removed */
}

.post-save-context-single .save-post,
.post-save-context-single .unsave-post {
    /* Button styling for meta - Keep text visible */
    padding: 2px 6px; /* Adjust padding slightly */
}

.post-save-context-single .dashicons-heart {
    /* Icon size for meta */
    font-size: 16px;
    height: 16px;
    width: 16px;
    margin-right: 4px;
}

.post-save-context-single .button-text {
    /* Show text in single post meta */
    display: inline;
}

/* 2. Card Footer (.post-save-context-card) */
.post-save-context-card {
    /* Container positioning - will be inside the flex footer */
}

.post-save-context-card .save-post,
.post-save-context-card .unsave-post {
    /* Button styling for card - Icon only */
    padding: 5px; /* Slightly larger padding for easier clicking */
}

.post-save-context-card .dashicons-heart {
    /* Icon size for card */
    font-size: 18px;
    height: 18px;
    width: 18px;
}

.post-save-context-card .button-text {
    /* Hide text in card view */
    display: none;
}


/* Dark Mode Adjustments */
.dark .save-post,
.dark .unsave-post {
    color: #9ca3af; /* Default dark mode unsaved color */
}

.dark .unsave-post {
    color: #f87171; /* Lighter red for dark mode saved */
}

.dark .save-post:hover,
.dark .save-post.hover {
    color: #e5e7eb; /* Lighter gray hover for dark mode unsaved */
}

.dark .unsave-post:hover,
.dark .unsave-post.hover {
    color: #ef4444; /* Slightly brighter red hover for dark mode saved */
}


/* Notification System (Keep existing styles) */
.save-post-notifications {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 300px;
}

.notification {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #1f2937;
    margin-top: 10px;
    opacity: 0;
    padding: 12px 16px;
    transform: translateX(20px);
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid #10b981;
}

.notification-error {
    border-left: 4px solid #ef4444;
}

.dark .notification {
    background-color: #1f2937;
    color: #f9fafb;
}

/* Responsive styles for notifications */
@media (max-width: 768px) {
    .save-post-notifications {
        bottom: 10px;
        right: 10px;
        max-width: calc(100% - 20px);
    }
}

/* Dashboard Saved Posts */
.dashboard-saved-posts {
    margin-bottom: 2rem;
}

.dashboard-section-header {
    margin-bottom: 1.5rem;
}

.dashboard-section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    color: var(--text-color);
}

.dark .dashboard-section-header h2 {
    color: var(--text-color-dark);
}

.dashboard-section-header h2 .dashicons {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.dashboard-section-header p {
    color: #6b7280;
    margin-bottom: 0;
}

.dark .dashboard-section-header p {
    color: #9ca3af;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background-color: #f9fafb;
    border-radius: 0.5rem;
}

.dark .empty-state {
    background-color: #1f2937;
}

.empty-state-icon {
    margin-bottom: 1rem;
}

.empty-state-icon .dashicons {
    font-size: 3rem;
    width: 3rem;
    height: 3rem;
    color: #9ca3af;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.dark .empty-state h3 {
    color: var(--text-color-dark);
}

.empty-state p {
    color: #6b7280;
    margin-bottom: 1.5rem;
    max-width: 25rem;
    margin-left: auto;
    margin-right: auto;
}

.dark .empty-state p {
    color: #9ca3af;
}

/* Filter Controls */
.saved-posts-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-field,
.sort-field {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.dark .search-field,
.dark .sort-field {
    background-color: #1f2937;
    border-color: #4b5563;
    color: #e5e7eb;
}

.search-field {
    flex: 1;
    min-width: 200px;
}

.sort-field {
    width: auto;
}

/* Saved Posts Grid */
.saved-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 640px) {
    .saved-posts-grid {
        grid-template-columns: 1fr;
    }
}

/* Saved Post Card */
.saved-post-card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.saved-post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dark .saved-post-card {
    background-color: #1f2937;
}

.saved-post-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 2;
}

.unsave-post-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.unsave-post-btn:hover {
    background-color: #f87171;
}

.unsave-post-btn:hover .dashicons {
    color: white;
}

.dark .unsave-post-btn {
    background-color: rgba(31, 41, 55, 0.9);
}

.saved-post-thumbnail {
    height: 180px;
    overflow: hidden;
}

.saved-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.saved-post-card:hover .saved-post-thumbnail img {
    transform: scale(1.05);
}

.saved-post-content {
    padding: 1.25rem;
}

.saved-post-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.saved-post-title a {
    color: var(--text-color);
    text-decoration: none;
}

.saved-post-title a:hover {
    color: var(--primary-color);
}

.dark .saved-post-title a {
    color: var(--text-color-dark);
}

.dark .saved-post-title a:hover {
    color: #60a5fa;
}

.saved-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.dark .saved-post-meta {
    color: #9ca3af;
}

.saved-post-date,
.saved-post-category {
    display: flex;
    align-items: center;
}

.saved-post-date .dashicons,
.saved-post-category .dashicons {
    font-size: 1rem;
    width: 1rem;
    height: 1rem;
    margin-right: 0.25rem;
}

.saved-post-excerpt {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #4b5563;
    margin-bottom: 1rem;
}

.dark .saved-post-excerpt {
    color: #9ca3af;
}

.saved-post-read-more {
    display: inline-flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-color);
    text-decoration: none;
}

.saved-post-read-more:hover {
    text-decoration: underline;
}

.dark .saved-post-read-more {
    color: #60a5fa;
}

.saved-post-read-more .dashicons {
    font-size: 1rem;
    width: 1rem;
    height: 1rem;
    margin-left: 0.25rem;
    transition: transform 0.2s ease;
}

.saved-post-read-more:hover .dashicons {
    transform: translateX(2px);
}

/* Notification System */
.site-notifications {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.notification {
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 14px;
    color: white;
    max-width: 300px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-success {
    background-color: #10b981;
}

.notification-error {
    background-color: #ef4444;
}

.notification-info {
    background-color: #3b82f6;
}

/* Utility */
.hidden {
    display: none !important;
} 