/* Main Container Styles */
.rpc-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Form Styles */
.rpc-form {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 30px;
}

.rpc-form-group {
    margin-bottom: 15px;
}

.rpc-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.rpc-form-group input[type="text"],
.rpc-form-group input[type="number"],
.rpc-form-group input[type="file"],
.rpc-form-group input[type="email"],
.rpc-form-group select,
.rpc-form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.rpc-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.rpc-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: normal;
}

/* Toggle Switch */
.rpc-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 15px;
}

.rpc-toggle-switch {
    width: 40px;
    height: 20px;
    background: #ccc;
    border-radius: 10px;
    position: relative;
    transition: background 0.3s;
}

.rpc-toggle-switch::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

#rpc-is-paid:checked + .rpc-toggle-switch {
    background: #2196f3;
}

#rpc-is-paid:checked + .rpc-toggle-switch::after {
    transform: translateX(20px);
}

.rpc-toggle-text {
    font-weight: 600;
}

/* Price Input Styling */
.rpc-price-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.rpc-price-group label {
    margin-bottom: 0;
    font-weight: 600;
}

.rpc-price-group input {
    width: auto;
    min-width: 120px;
}

/* Current File Display */
.rpc-current-file {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    border-left: 3px solid #2271b1;
}

.rpc-current-file p {
    margin: 0 0 8px 0;
}

.rpc-current-cover {
    margin-bottom: 15px;
}

.rpc-cover-thumbnail {
    position: relative;
    display: inline-block;
    margin-top: 10px;
}

.rpc-remove-cover-image {
    display: block;
    margin-top: 5px;
    color: #cc1818;
    text-decoration: none;
    font-size: 12px;
}

.rpc-remove-cover-image:hover {
    text-decoration: underline;
}

/* Hint Text */
.rpc-hint {
    font-size: 12px;
    color: #666;
    margin: 5px 0 0;
    font-style: italic;
}

/* Filter Styles */
.rpc-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    align-items: center;
}

.rpc-filters input,
.rpc-filters select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-height: 40px;
}

.rpc-filters input {
    min-width: 250px;
    flex: 1;
}

.rpc-filters select {
    min-width: 200px;
}

/* Resource Grid */
.rpc-resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.rpc-resource-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e0e0e0;
}

.rpc-resource-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.rpc-resource-thumbnail {
    position: relative;
    height: 250px;
    background: #eee;
    overflow: hidden;
}

.rpc-resource-thumbnail img {
    width: 100%;
    height: 250px !important;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.rpc-resource-card:hover .rpc-resource-thumbnail img {
    transform: scale(1.05);
}

.rpc-default-thumbnail {
    width: 100%;
    height: 100%;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

/* Access Badges */
.rpc-paid-badge, 
.rpc-free-badge,
.rpc-member-badge,
.rpc-premium-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    z-index: 2;
}

.rpc-paid-badge {
    background: #ffc107;
    color: #000;
}

.rpc-free-badge {
    background: #4caf50;
    color: white;
}

.rpc-member-badge {
    background: #2196f3;
    color: white;
}

.rpc-premium-badge {
    background: #9c27b0;
    color: white;
}

.rpc-resource-content {
    padding: 15px;
}

.rpc-resource-content h3 {
    margin: 0 0 10px;
    font-size: 18px;
    line-height: 1.3;
    color: #333;
}

.rpc-categories {
    margin-bottom: 10px;
}

.rpc-category {
    display: inline-block;
    background: #f0f0f0;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    margin-right: 5px;
    margin-bottom: 5px;
    color: #666;
}

.rpc-resource-meta {
    margin-bottom: 10px;
}

.rpc-meta-item {
    font-size: 12px;
    color: #666;
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 3px;
    display: inline-block;
}

.rpc-actions {
    margin-top: 15px;
}

.rpc-download-btn {
    display: inline-block;
    padding: 8px 15px;
    background: #2196f3;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
    text-align: center;
    width: 100%;
}

.rpc-download-btn:hover {
    background: #0d8bf2;
    color: white;
    text-decoration: none;
}

.rpc-download-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: #6c757d;
}

.rpc-access-denied {
    text-align: center;
}

.rpc-login-btn {
    display: inline-block;
    padding: 8px 15px;
    background: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    width: 100%;
}

.rpc-login-btn:hover {
    background: #5a6268;
    color: white;
}

.rpc-members-only {
    display: inline-block;
    padding: 8px 15px;
    background: #9c27b0;
    color: white;
    border-radius: 4px;
    font-weight: 500;
    width: 100%;
    text-align: center;
}

/* Loading States */
.rpc-download-btn.loading {
    position: relative;
    color: transparent;
}

.rpc-download-btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-right-color: transparent;
    animation: spin 1s linear infinite;
}

.rpc-spinner {
    display: inline-block;
    margin-right: 5px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal Styles */
.rpc-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.rpc-modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 5px;
    width: 80%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.rpc-close-modal {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 24px;
    cursor: pointer;
    background: none;
    border: none;
    color: #666;
}

.rpc-close-modal:hover {
    color: #333;
}

/* Payment Modal Styles */
.rpc-payment-modal {
    padding: 20px;
}

.rpc-payment-modal h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.rpc-payment-notice {
    margin-top: 20px;
    padding: 10px;
    background: #f8f9fa;
    border-left: 4px solid #2271b1;
    border-radius: 4px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-group input[type="email"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.rpc-paystack-button {
    display: inline-block;
    padding: 12px 24px;
    background: #0ab579;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    margin: 15px 0;
    text-align: center;
    border: none;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s ease;
}

.rpc-paystack-button:hover {
    background: #089e6b;
    color: white;
}

/* Download Dialog */
.rpc-download-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 9999;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.rpc-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
}

.rpc-close-dialog {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    line-height: 1;
}

.rpc-close-dialog:hover {
    color: #333;
}

/* Admin Styles */
.rpc-admin-container {
    background: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.rpc-admin-actions {
    margin-bottom: 20px;
}

.rpc-resources-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.rpc-resources-table th, 
.rpc-resources-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.rpc-resources-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
}

.rpc-resources-table tr:hover {
    background: #f9f9f9;
}

.rpc-button {
    display: inline-block;
    padding: 8px 16px;
    background: #2271b1;
    color: white;
    text-decoration: none;
    border-radius: 3px;
    margin-bottom: 20px;
    transition: background 0.3s ease;
}

.rpc-button:hover {
    background: #135e96;
    color: white;
    text-decoration: none;
}

.rpc-edit-link {
    color: #2271b1;
    text-decoration: none;
    margin-right: 10px;
    font-weight: 500;
}

.rpc-edit-link:hover {
    text-decoration: underline;
    color: #135e96;
}

.rpc-delete-link {
    color: #cc1818;
    text-decoration: none;
    font-weight: 500;
}

.rpc-delete-link:hover {
    text-decoration: underline;
    color: #a00;
}

/* Meta Box Styles */
.rpc-meta-field {
    margin-bottom: 15px;
}

/* Notification Styles */
.rpc-notice,
.rpc-success,
.rpc-error {
    padding: 12px 15px;
    margin: 15px 0;
    border-radius: 4px;
    border-left: 4px solid;
    font-weight: 500;
}

.rpc-notice {
    background: #e7f3ff;
    border-color: #2196f3;
    color: #1976d2;
}

.rpc-success {
    background: #f0f9f0;
    border-color: #4caf50;
    color: #2e7d32;
}

.rpc-error {
    background: #ffeaea;
    border-color: #f44336;
    color: #c62828;
}

/* Button States */
.rpc-submit-button {
    position: relative;
    min-width: 120px;
    padding: 10px 20px;
    background: #2271b1;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

.rpc-submit-button:hover {
    background: #135e96;
}

.rpc-submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.rpc-cancel-button {
    display: inline-block;
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 3px;
    margin-left: 10px;
    transition: background 0.3s ease;
}

.rpc-cancel-button:hover {
    background: #5a6268;
    color: white;
    text-decoration: none;
}

/* No Resources Message */
.rpc-no-resources {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
    grid-column: 1 / -1;
}

/* Responsive */
@media (max-width: 768px) {
    .rpc-resources-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 15px;
    }
    
    .rpc-resources-table {
        display: block;
        overflow-x: auto;
    }
    
    .rpc-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .rpc-filters input,
    .rpc-filters select {
        min-width: auto;
        width: 100%;
    }
    
    .rpc-modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .rpc-admin-container {
        padding: 15px;
    }
    
    .rpc-form {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .rpc-container {
        padding: 10px;
    }
    
    .rpc-resources-grid {
        grid-template-columns: 1fr;
    }
    
    .rpc-resource-thumbnail {
        height: 200px;
    }
    
    .rpc-resource-thumbnail img {
        height: 200px !important;
    }
    
    .rpc-price-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .rpc-price-group input {
        width: 100%;
    }
}