/* AI Auto Posts Gemini Admin Styles */

/* Cron Status Styles */
.cron-status-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.cron-status-item {
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
    border-left: 4px solid #0073aa;
}

.cron-status-item strong {
    display: block;
    margin-bottom: 5px;
}

.cron-status-item small {
    color: #666;
    font-size: 12px;
}

/* API Key Test Results Styles */
.api-test-results {
    margin-top: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.api-test-results h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.api-test-details {
    display: grid;
    gap: 8px;
}

.api-test-item {
    padding: 8px;
    border-radius: 3px;
    border-left: 3px solid;
}

.api-test-item.valid {
    background: #f0f8f0;
    border-left-color: #46b450;
}

.api-test-item.invalid {
    background: #fef7f1;
    border-left-color: #dc3232;
}

.api-test-item .status {
    font-weight: bold;
}

.api-test-item.valid .status {
    color: #46b450;
}

.api-test-item.invalid .status {
    color: #dc3232;
}

.api-test-item small {
    color: #666;
    font-size: 11px;
}

.gpl-post-admin-container {
    max-width: 1200px;
    margin: 20px 0;
}

.gpl-post-dashboard,
.gpl-post-settings,
.gpl-post-manual-run {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.gpl-post-dashboard h2,
.gpl-post-settings h2,
.gpl-post-manual-run h2 {
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #23282d;
}

/* Stats Grid */
.gpl-post-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.stat-card h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #0073aa;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: #999;
}

/* API Keys Section */
.api-key-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
}

.api-key-row input {
    flex: 1;
}

.api-key-row .button {
    white-space: nowrap;
}

.valid-key {
    border-color: #46b450 !important;
    background-color: #f7fcf7 !important;
}

.invalid-key {
    border-color: #dc3232 !important;
    background-color: #fef7f7 !important;
}

.add-api-key {
    margin-top: 10px;
}

/* Form Styles */
.form-table th {
    width: 200px;
    padding: 20px 10px 20px 0;
}

.form-table td {
    padding: 15px 10px;
}

.form-table input[type="text"],
.form-table input[type="password"],
.form-table input[type="number"],
.form-table select {
    min-width: 300px;
}

.form-table input[type="checkbox"] {
    margin-right: 8px;
}

.form-table label {
    display: inline-block;
    margin-bottom: 5px;
}

/* Manual Run Section */
.gpl-post-manual-run-container {
    text-align: center;
}

.gpl-post-manual-run-container p {
    margin-bottom: 20px;
    color: #666;
}

#run-now {
    font-size: 16px;
    padding: 12px 24px;
    height: auto;
}

.gpl-post-run-status {
    margin-top: 20px;
    padding: 15px;
    background: #f0f6fc;
    border: 1px solid #0073aa;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gpl-post-run-status .spinner {
    float: none;
    margin: 0;
}

.gpl-post-run-results {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: left;
}

.results-summary p {
    margin: 5px 0;
    font-size: 14px;
}

.results-errors {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.results-errors h5 {
    margin: 0 0 10px 0;
    color: #dc3232;
}

.results-errors ul {
    margin: 0;
    padding-left: 20px;
}

.results-errors li {
    color: #666;
    margin-bottom: 5px;
}

/* Product Status */
.gpl-post-status {
    margin-top: 15px;
    padding: 10px;
    background: #f0f6fc;
    border: 1px solid #0073aa;
    border-radius: 4px;
    font-size: 12px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gpl-post-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .api-key-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .api-key-row .button {
        margin-top: 5px;
    }
    
    .form-table th,
    .form-table td {
        display: block;
        width: 100%;
        padding: 10px 0;
    }
    
    .form-table input[type="text"],
    .form-table input[type="password"],
    .form-table input[type="number"],
    .form-table select {
        min-width: 100%;
        width: 100%;
    }
}

/* Loading States */
.spinner.is-active {
    visibility: visible;
}

.spinner {
    visibility: hidden;
    float: none;
    margin-left: 10px;
}

/* Notice Styles */
.notice {
    margin: 15px 0;
}

.notice-success {
    border-left-color: #46b450;
}

.notice-error {
    border-left-color: #dc3232;
}

/* Button States */
.button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Form Validation */
.form-table input.error {
    border-color: #dc3232;
}

.form-table .error-message {
    color: #dc3232;
    font-size: 12px;
    margin-top: 5px;
}

/* Success States */
.form-table input.success {
    border-color: #46b450;
}

/* Hover Effects */
.stat-card:hover .stat-number {
    color: #005a87;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Focus States */
.form-table input:focus,
.form-table select:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
    outline: none;
}

/* Accessibility */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* System Status */
.gpl-post-system-status {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    margin-top: 20px;
}

.gpl-post-system-status h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #23282d;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #0073aa;
}

.status-item strong {
    min-width: 120px;
}

.status-success {
    color: #46b450;
    font-weight: bold;
}

.status-error {
    color: #dc3232;
    font-weight: bold;
}

.status-warning {
    color: #ffb900;
    font-weight: bold;
}

.stat-number.error {
    color: #dc3232;
}

.stat-number.success {
    color: #46b450;
}

/* Log Viewer */
.log-viewer {
    background: #1e1e1e;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 10px;
}

.log-entry {
    margin-bottom: 5px;
    padding: 2px 0;
}

.log-entry.error {
    color: #ff6b6b;
}

.log-entry.warning {
    color: #ffd93d;
}

.log-entry.info {
    color: #6bcf7f;
}

.log-entry.debug {
    color: #74c0fc;
}

/* Shortcode Test Section */
.gpl-post-shortcode-test-results {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: left;
}

.shortcode-test-summary p {
    margin: 5px 0;
    font-size: 14px;
}

.shortcode-preview {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.shortcode-preview h5 {
    margin: 0 0 10px 0;
    color: #0073aa;
}

.preview-content {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.preview-content img {
    max-width: 100%;
    height: auto;
}

/* Daily Limit Status */
.stat-card small {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 5px;
}

/* Product Shortcodes Fieldset */
fieldset {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    background: #f9f9f9;
}

fieldset legend {
    font-weight: bold;
    color: #23282d;
    padding: 0 10px;
}

fieldset label {
    display: block;
    margin-bottom: 8px;
    font-weight: normal;
}

fieldset input[type="checkbox"] {
    margin-right: 8px;
}

/* Product Card Layout */
.gpl-post-product-card {
    display: flex;
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
}

/* Product rank badge for inline cards */
.product-rank {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ff6b35;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.gpl-post-product-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.product-thumbnail {
    flex: 0 0 120px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.placeholder-icon {
    font-size: 2rem;
    color: white;
}

.product-info {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: bold;
    color: #23282d;
    line-height: 1.3;
}

.product-description {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    flex-grow: 1;
}

.download-button {
    display: inline-block;
    background: #ff6b35;
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    text-align: center;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.download-button:hover {
    background: #e55a2b;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
    color: white;
    text-decoration: none;
}

/* Products Grid for Comparison Articles */
.gpl-post-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.gpl-post-products-grid .gpl-post-product-card {
    margin: 0;
    flex-direction: column;
}

.gpl-post-products-grid .product-thumbnail {
    flex: 0 0 200px;
}

.gpl-post-products-grid .product-info {
    padding: 15px;
}

/* Responsive Design for Product Cards */
@media (max-width: 768px) {
    .gpl-post-product-card {
        flex-direction: column;
    }
    
    .product-thumbnail {
        flex: 0 0 200px;
    }
    
    .gpl-post-products-grid {
        grid-template-columns: 1fr;
    }
}

/* Advanced Features Styling */
.gpl-post-advanced-status {
    margin-top: 20px;
    padding: 15px;
    background: #f0f6fc;
    border: 1px solid #0073aa;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gpl-post-advanced-results {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: left;
}

.advanced-results-content .results-summary p {
    margin: 5px 0;
    font-size: 14px;
}

/* Product Rank Badge */
.product-rank {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ff6b35;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    z-index: 2;
}

/* Product Rating */
.product-rating {
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stars {
    color: #ffd700;
    font-size: 16px;
}

.rating-text {
    color: #666;
    font-size: 12px;
}

/* Product Price */
.product-price {
    margin: 10px 0;
    font-weight: bold;
    color: #0073aa;
    font-size: 16px;
}

/* Products Showcase */
.gpl-post-products-showcase {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
}

.gpl-post-products-showcase .gpl-post-product-card {
    position: relative;
    margin: 0;
}

/* Category Select */
#category-select {
    min-width: 200px;
    margin-right: 10px;
}

/* Advanced Section Headers */
.gpl-post-manual-run-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
    color: #23282d;
}

/* Button Groups */
.gpl-post-manual-run-container .button {
    margin-right: 10px;
    margin-bottom: 10px;
}

.button.button-secondary {
    background: #f7f7f7;
    border-color: #ccc;
    color: #555;
}

.button.button-secondary:hover {
    background: #fafafa;
    border-color: #999;
    color: #23282d;
}

/* Inline product cards styling for frontend */
.entry-content .gpl-post-product-card,
.post-content .gpl-post-product-card {
    margin: 25px 0;
    border-left: 4px solid #ff6b35;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
}

.entry-content .gpl-post-product-card:hover,
.post-content .gpl-post-product-card:hover {
    border-left-color: #e55a2b;
    background: linear-gradient(135deg, #fff 0%, #f0f2f5 100%);
}

/* Responsive design for inline product cards */
@media (max-width: 768px) {
    .gpl-post-product-card {
        flex-direction: column;
    }
    
    .product-thumbnail {
        flex: none;
        height: 200px;
    }
    
    .product-info {
        padding: 15px;
    }
}

/* Frontend product card styles */
.gpl-post-product-card {
    border-left: 4px solid #ff6b35;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: flex-start;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

.gpl-post-product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff6b35, #ff8c42);
}

.gpl-post-product-card .product-rank {
    position: absolute;
    top: 10px;
    right: 15px;
    background: #ff6b35;
    color: white;
    font-weight: bold;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 12px;
    z-index: 2;
}

.gpl-post-product-card .product-thumbnail {
    flex-shrink: 0;
    width: 120px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    background: #f1f3f4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gpl-post-product-card .product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.gpl-post-product-card .product-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f3f4;
    border-radius: 6px;
}

.gpl-post-product-card .placeholder-icon {
    font-size: 24px;
    color: #999;
}

.gpl-post-product-card .product-info {
    flex: 1;
    min-width: 0;
}

.gpl-post-product-card .product-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.3;
}

.gpl-post-product-card .product-rating {
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gpl-post-product-card .stars {
    color: #ffc107;
    font-size: 16px;
}

.gpl-post-product-card .rating-text {
    font-size: 14px;
    color: #666;
}

.gpl-post-product-card .product-description {
    margin: 8px 0;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

.gpl-post-product-card .product-price {
    margin: 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #27ae60;
}

.gpl-post-product-card .download-button {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b35, #ff8c42);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.gpl-post-product-card .download-button:hover {
    background: linear-gradient(135deg, #e55a2b, #e67e3a);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

/* Responsive design for frontend */
@media (max-width: 768px) {
    .gpl-post-product-card {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .gpl-post-product-card .product-thumbnail {
        width: 100%;
        height: 120px;
    }
    
    .gpl-post-product-card .product-title {
        font-size: 16px;
    }
}
