/* General Admin Styles */
.wrap h1 {
    margin-bottom: 20px;
}

.rss2post-section {
    background: #fff;
    border: 1px solid #ccd0d4;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.rss2post-section h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.form-table th {
    width: 200px;
}

.rss-feeds-input {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.rss-feeds-input textarea {
    width: 100%;
    min-height: 80px;
    flex-grow: 1;
}

#articles-list {
    margin-top: 20px;
    margin-bottom: 20px;
    max-height: 500px; /* Limit height and make scrollable */
    overflow-y: auto;
    border: 1px solid #eee;
    padding: 10px;
}

.article-item {
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
    background-color: #f9f9f9;
    display: flex; /* Use flexbox for alignment */
    align-items: flex-start; /* Align items to the top */
}

.article-item.disabled {
    opacity: 0.6;
    background-color: #efefef;
    pointer-events: none; /* Disable interactions on the whole item */
}

.article-item.disabled .pro-only-overlay {
    display: block; /* Show overlay when disabled */
}

.article-label {
    display: flex; /* Make label a flex container */
    align-items: flex-start; /* Align checkbox and content to top */
    width: 100%; /* Label takes full width */
}

.article-label input[type="checkbox"].article-checkbox {
    margin-right: 15px; /* Space between checkbox and content */
    margin-top: 5px; /* Align checkbox with text better */
}

.article-content {
    display: flex; /* Flex for image and text side-by-side */
    flex-grow: 1;
}

.article-image {
    margin-right: 15px;
    flex-shrink: 0; /* Prevent image from shrinking */
}

.article-thumbnail {
    max-width: 100px;
    max-height: 100px;
    height: auto;
    border: 1px solid #ccc;
}

.no-image {
    width: 100px;
    height: 100px;
    background-color: #eee;
    color: #777;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.9em;
    border: 1px solid #ccc;
}

.article-text h4 {
    margin-top: 0;
    margin-bottom: 5px;
}

.article-text p {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 0.95em;
    color: #333;
}

.article-text small a {
    color: #0073aa;
    text-decoration: none;
}
.article-text small a:hover {
    text-decoration: underline;
}

.duplicate-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 8px 12px;
    margin-top: 8px;
    border-radius: 4px;
    font-size: 0.9em;
}
.duplicate-warning .dashicons {
    margin-right: 5px;
}

.pro-only-overlay {
    display: none; /* Hidden by default */
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(128, 128, 128, 0.5);
    color: white;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px; /* Match parent's border-radius */
}
.article-item.disabled { /* Ensure this is specific enough */
    position: relative; /* Needed for absolute positioning of overlay */
}

/* Image Warning Styles */
.article-image-warning {
    background-color: #fff8e5; /* Light yellow background */
    color: #664d03;
    padding: 5px 10px;
    margin: 5px 0;
    border-radius: 3px;
    display: flex;
    align-items: center;
    font-size: 0.9em;
}
.article-image-warning .dashicons {
    margin-right: 5px;
    color: #664d03;
}

#generate-posts {
    padding: 10px 20px;
    font-size: 1.1em;
}

/* Tier Limitation Warning */
.tier-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 4px;
}
.tier-warning p {
    margin: 0;
}
.tier-warning strong {
    color: #664d03;
}

/* Tier Status Banner */
.rss2post-tier-banner {
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    border-left: 4px solid;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.rss2post-pro-tier {
    background-color: #f0f8ff; /* Light blue background for Pro */
    border-left-color: #0073aa; /* WordPress blue border */
}

.rss2post-free-tier {
    background-color: #fff8e5; /* Light yellow background for Free */
    border-left-color: #ffb900; /* WordPress yellow border */
}

.rss2post-lifetime-tier {
    background-color: #f0fff4; /* Light green background for Lifetime */
    border-left-color: #00a32a; /* WordPress green border */
}

.tier-banner-content h3 {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rss2post-pro-tier h3 {
    color: #0073aa; /* WordPress blue */
}

.rss2post-free-tier h3 {
    color: #ffb900; /* WordPress yellow */
}

.rss2post-lifetime-tier h3 {
    color: #00a32a; /* WordPress green */
}

.tier-banner-content p {
    margin: 8px 0 12px;
    font-size: 1.1em;
}

.tier-features {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
    font-size: 0.95em;
    color: #444;
}

.tier-features span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.tier-features .dashicons {
    color: #00a32a; /* WordPress green */
}

.pro-upgrade-btn {
    margin-top: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lifetime-upgrade-btn {
    margin-top: 10px;
    font-weight: 600;
    background-color: #00a32a !important;
    border-color: #00a32a !important;
    color: #fff !important;
    text-shadow: none;
}

.lifetime-upgrade-btn:hover,
.lifetime-upgrade-btn:focus {
    background-color: #008a20 !important;
    border-color: #008a20 !important;
    color: #fff !important;
}

.lifetime-upgrade-link {
    color: #00a32a;
    font-weight: 600;
}

.lifetime-upgrade-link:hover {
    color: #008a20;
}

/* Legacy styles for backward compatibility */
.rss2post-pro-banner {
    background-color: #0073aa;
    color: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    text-align: center;
}

.rss2post-pro-banner h3 {
    margin-top: 0;
    color: #fff;
}

.rss2post-pro-banner p {
    font-size: 1.1em;
    margin-bottom: 15px;
}

.rss2post-pro-banner .button-primary {
    background-color: #fff;
    color: #0073aa;
    border-color: #fff;
    font-weight: bold;
}

.rss2post-pro-banner .button-primary:hover,
.rss2post-pro-banner .button-primary:focus {
    background-color: #f0f0f1;
    color: #0073aa;
    border-color: #f0f0f1;
}

/* Progress Bar and Log */
#progress-bar-container {
    width: 100%; 
    background-color: #e0e0e0; 
    border: 1px solid #ccc; 
    border-radius: 5px; 
    margin-bottom: 10px;
    box-sizing: border-box;
}
#progress-bar {
    width: 0%; 
    height: 30px; 
    background-color: #4caf50; /* Green */
    text-align: center; 
    line-height: 30px; 
    color: white; 
    border-radius: 4px; /* Slightly less than container for inset look */
    transition: width 0.3s ease-in-out;
}
#progress-status {
    margin-bottom: 10px;
    font-style: italic;
}
#progress-log {
    list-style-type: none; 
    padding: 10px; 
    max-height: 200px; 
    overflow-y: auto; 
    border: 1px solid #eee; 
    background-color: #fdfdfd;
    border-radius: 5px;
    font-size: 0.9em;
}
#progress-log .log-item {
    padding: 5px 0;
    border-bottom: 1px dotted #eee;
}
#progress-log .log-item:last-child {
    border-bottom: none;
}
#progress-log .log-success { color: #155724; }
#progress-log .log-error { color: #721c24; }
#progress-log .log-info { color: #0c5460; }

/* Results Section */
#generation-results .notice {
    margin-top: 10px;
}
#generation-results ul {
    list-style: disc;
    margin-left: 20px;
}

/* History Section */
.rss2post-history-list {
    list-style-type: disc;
    margin-left: 20px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #eee;
    padding: 10px;
    background-color: #fdfdfd;
    border-radius: 4px;
    margin-bottom: 10px;
}
.rss2post-history-list li {
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px dotted #eee;
}
.rss2post-history-list li:last-child {
    border-bottom: none;
}

/* Apple-like Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-flex; /* Use inline-flex for alignment */
    align-items: center;  /* Vertically center items */
    width: auto; /* Adjust width to content or set fixed if only switch desired */
    /* height: 28px; /* Height of the switch - can be removed if text dictates height */
    vertical-align: middle;
    margin-right: 10px;
    gap: 8px; /* Space between switch and text */
}

/* Keep the actual switch part fixed size */
.toggle-switch .toggle-slider-container {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0; /* Prevent switch from shrinking */
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc; /* Gray when off */
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 28px; /* Fully rounded */
}

.toggle-switch .toggle-slider-container .toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px; /* Height of the knob */
    width: 20px; /* Width of the knob */
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 50%; /* Circular knob */
}

input:checked + .toggle-slider-container .toggle-slider {
    background-color: #4CAF50; /* Green when on */
}

input:focus + .toggle-slider-container .toggle-slider {
    box-shadow: 0 0 1px #4CAF50;
}

input:checked + .toggle-slider-container .toggle-slider:before {
    -webkit-transform: translateX(22px); /* Move knob to the right */
    -ms-transform: translateX(22px);
    transform: translateX(22px);
}

/* For processing state on AJAX */
label.toggle-switch.processing {
    opacity: 0.7;
    cursor: not-allowed;
}

/* --- Generation History Enhancements --- */
.rss2post-history-container {
    margin-top: 15px;
}

.rss2post-history-list {
    list-style-type: none; /* Remove default bullets */
    padding: 0;
    margin-top: 0; /* Remove default margin if any */
    border: 1px solid #e0e0e0; /* Lighter border */
    border-radius: 4px;
    background-color: #fff; /* White background for the list */
    max-height: 400px; /* Increased max-height */
    overflow-y: auto;
}

.rss2post-history-list li {
    padding: 12px 15px; /* More padding */
    border-bottom: 1px solid #f0f0f0; /* Lighter separator */
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.rss2post-history-list li:last-child {
    border-bottom: none;
}

.rss2post-history-list li strong a {
    font-weight: 600; /* Slightly bolder */
    color: #0073aa;
    text-decoration: none;
}
.rss2post-history-list li strong a:hover {
    text-decoration: underline;
    color: #005a87;
}

.rss2post-history-list li small {
    color: #555; /* Darker gray for better readability */
    font-size: 0.9em;
    margin-left: 15px; /* Space from title */
    white-space: nowrap; /* Prevent date from wrapping */
}

.rss2post-history-list li .history-status {
    font-size: 0.9em;
    color: #777;
    margin-left: 10px;
    font-style: italic;
}

/* Pagination Styles */
.rss2post-pagination {
    margin-top: 20px;
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e0e0e0;
}

.rss2post-pagination .pagination-info {
    font-size: 0.9em;
    color: #555;
}

.rss2post-pagination .pagination-links a,
.rss2post-pagination .pagination-links span.pagination-current,
.rss2post-pagination .pagination-links span.pagination-dots {
    padding: 6px 12px;
    margin-left: 4px;
    text-decoration: none;
    border: 1px solid #ccc;
    border-radius: 3px;
    color: #0073aa;
    background-color: #f7f7f7;
    font-size: 0.9em;
    line-height: 1.5;
}

.rss2post-pagination .pagination-links a:hover {
    border-color: #0073aa;
    background-color: #f0f0f1;
    color: #005a87;
}

.rss2post-pagination .pagination-links span.pagination-current {
    background-color: #0073aa;
    border-color: #0073aa;
    color: #fff;
    font-weight: bold;
    cursor: default;
}

.rss2post-pagination .pagination-links span.pagination-dots {
    border: none;
    background-color: transparent;
    padding: 6px 8px;
}

#clear-history-button {
    margin-top: 15px; /* Add some space above the clear button */
}

/* Language Section Feedback Styles */
#language-save-feedback {
    font-size: 0.9em;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

#language-save-feedback.saving {
    color: #0073aa;
    background-color: #f0f8ff;
    border: 1px solid #b3d9ff;
}

#language-save-feedback.success {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}

#language-save-feedback.error {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

/* Pexels Modal */
.pexels-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.pexels-modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
}

.pexels-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.pexels-modal-close:hover,
.pexels-modal-close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#pexels-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.pexels-image {
    cursor: pointer;
    border: 2px solid transparent;
}

.pexels-image:hover {
    border-color: #0073aa;
}

.pexels-image img {
    width: 100%;
    height: auto;
    display: block;
}

.pexels-images-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.pexels-thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
}

.pexels-thumbnail.selected {
    border-color: #0073aa;
}

.image-options {
    margin-bottom: 20px;
}

.image-option-row {
    margin-bottom: 10px;
}

.pro-upgrade-btn.loading {
    position: relative;
    color: transparent !important;
}

.pro-upgrade-btn.loading::after {
    content: "";
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    border-radius: 50%;
    border: 2px solid #fff;
    border-top-color: #0073aa;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Apple-like Switch for Auto Category Assignment */
.rss2post-switch-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
}

.rss2post-switch-container input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.rss2post-slider {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    background-color: #ccc;
    border-radius: 28px;
    transition: background-color 0.3s ease;
    order: -1; /* Put slider before text */
}

.rss2post-slider:before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.rss2post-switch-container input[type="checkbox"]:checked + .rss2post-slider {
    background-color: #007cba; /* WordPress blue */
}

.rss2post-switch-container input[type="checkbox"]:checked + .rss2post-slider:before {
    transform: translateX(22px);
}

.rss2post-switch-container input[type="checkbox"]:focus + .rss2post-slider {
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.3);
}

/* Post2Podcast Promotional Section */
.rss2post-promo-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e0e5e9;
    border-left: 4px solid #9b51e0;
    margin-top: 30px;
    transition: all 0.3s ease;
}

.rss2post-promo-section:hover {
    border-left-color: #7c3aae;
    box-shadow: 0 2px 8px rgba(155, 81, 224, 0.1);
}

.rss2post-promo-content {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.rss2post-promo-icon {
    flex-shrink: 0;
}

.rss2post-promo-icon .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #9b51e0;
    opacity: 0.8;
}

.rss2post-promo-text {
    flex: 1;
    min-width: 300px;
}

.rss2post-promo-text h3 {
    margin: 0 0 8px 0;
    font-size: 1.2em;
    color: #1d2327;
}

.rss2post-promo-text p {
    margin: 0 0 12px 0;
    color: #50575e;
    line-height: 1.5;
}

.rss2post-promo-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.rss2post-promo-features li {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9em;
    color: #50575e;
}

.rss2post-promo-features .dashicons {
    color: #9b51e0;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.rss2post-promo-cta {
    flex-shrink: 0;
}

.rss2post-promo-button {
    background: #9b51e0 !important;
    border-color: #7c3aae !important;
    color: #fff !important;
    padding: 8px 20px !important;
    height: auto !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.rss2post-promo-button:hover,
.rss2post-promo-button:focus {
    background: #7c3aae !important;
    border-color: #6a2f95 !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(155, 81, 224, 0.3) !important;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .rss2post-promo-content {
        flex-direction: column;
        text-align: center;
    }

    .rss2post-promo-features {
        justify-content: center;
    }

    .rss2post-promo-cta {
        width: 100%;
    }

    .rss2post-promo-button {
        width: 100%;
        text-align: center;
    }
}
