/* Resources and Publications Plugin Styles */
.resource-grid {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

.resource-grid-columns-1 { grid-template-columns: 1fr; }
.resource-grid-columns-2 { grid-template-columns: repeat(2, 1fr); }
.resource-grid-columns-3 { grid-template-columns: repeat(3, 1fr); }
.resource-grid-columns-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .resource-grid-columns-3,
    .resource-grid-columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .resource-grid {
        grid-template-columns: 1fr;
    }
}

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

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

.resource-thumbnail {
    height: 200px;
    overflow: hidden;
    flex-direction: column;
    display: flex;
    align-items: center;
}

.resource-thumbnail img {
    width: 70%;
    height: 200px !important;
    justify-self: center;
    object-fit: contain;
    padding: 10px;
}

.resource-content {
    padding: 20px;
}

.resource-title {
    font-size: 1.2em;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #333;
    line-height: 1.4;
}

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

.resource-category {
    display: inline-block;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    color: #666;
    margin-right: 5px;
}

.resource-excerpt {
    font-size: 0.9em;
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
}

.resource-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.access-type {
    font-size: 15px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.access-type.public { background: #e8f5e8; color: #2e7d32; }
.access-type.members_only { background: #e3f2fd; color: #1565c0; }
.access-type.paid { background: #fff3e0; color: #ef6c00; }

.resource-price {
    font-weight: 500;
    color: #444;
    font-size: 15px;
}

.resource-actions {
    text-align: center;
}

.btn-download,
.btn-purchase,
.btn-login-required {
    display: inline-block;
    width: 100%;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

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

.btn-free:hover {
    background: #45a049;
}

.btn-paid {
    background: #ff9800;
    color: white;
}

.btn-paid:hover {
    background: #f57c00;
}

.btn-purchase {
    background: #2196f3;
    color: white;
}

.btn-purchase:hover {
    background: #1976d2;
}

.btn-login-required {
    background: #757575;
    color: white;
}

.btn-login-required:hover {
    background: #616161;
}

/* Admin Styles */
.resource-upload-form {
    max-width: 600px;
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

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

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

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

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    text-align: right;
}

.btn-primary {
    background: #007cba;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary:hover {
    background: #005a87;
}

#upload-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    display: none;
}

#upload-message.success {
    background: #e8f5e8;
    color: #2e7d32;
    display: block;
}

#upload-message.error {
    background: #ffebee;
    color: #c62828;
    display: block;
}

/* Admin Archive */
.resource-admin-archive {
    margin: 20px 0;
}

.resources-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

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

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

.actions {
    display: flex;
    gap: 10px;
}

.btn-edit,
.btn-delete {
    padding: 5px 10px;
    border: none;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
}

.btn-edit {
    background: #2196f3;
    color: white;
}

.btn-edit:hover {
    background: #1976d2;
}

.btn-delete {
    background: #f44336;
    color: white;
}

.btn-delete:hover {
    background: #d32f2f;
}

.pagination {
    margin-top: 20px;
    text-align: center;
}

.no-resources {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* Admin Messages */
.admin-message {
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-weight: 500;
}

.admin-message.success {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.admin-message.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* Loading states for buttons */
.btn-download.loading,
.btn-purchase.loading,
.btn-delete:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .resource-admin-archive {
        overflow-x: auto;
    }
    
    .resources-table {
        min-width: 600px;
    }
    
    .actions {
        flex-direction: column;
        gap: 5px;
    }
}

/* Payment modal styles */
.payment-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
}

.payment-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
}

.payment-modal h3 {
    margin-top: 0;
    color: #333;
}

.payment-modal .close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 20px;
    cursor: pointer;
    color: #666;
}



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

.payment-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.payment-modal h3 {
    margin-top: 0;
    color: #333;
    margin-bottom: 20px;
}

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

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

.payment-amount {
    font-size: 1.2em;
    font-weight: bold;
    color: #d32f2f;
    margin: 15px 0;
    text-align: center;
}

.btn-pay-now {
    background: #007cba;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    margin-top: 15px;
}

.btn-pay-now:hover {
    background: #005a87;
}

.btn-pay-now:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-cancel {
    background: #757575;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin-left: 10px;
}

.btn-cancel:hover {
    background: #616161;
}


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

.resource-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

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

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

/* Category Checkboxes */
.category-checkboxes {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    max-height: 200px;
    overflow-y: auto;
    background: #f9f9f9;
}

.checkbox-label {
    display: block;
    margin-bottom: 10px;
    cursor: pointer;
}

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

.checkbox-label:hover {
    background: #f0f0f0;
    padding: 5px;
    border-radius: 3px;
}

/* Character Counter */
.char-count {
    font-size: 0.8em;
    color: #666;
    font-weight: normal;
}

.char-counter {
    font-size: 0.8em;
    color: #666;
    text-align: right;
    margin-top: 5px;
}

.char-counter.over-limit {
    color: #d32f2f;
    font-weight: bold;
}

/* Live Filters */
.resource-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    flex-wrap: wrap;
    align-items: end;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-search, .filter-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.btn-clear {
    background: #757575;
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-clear:hover {
    background: #616161;
}

/* Current File Display */
.current-file, .current-thumbnail {
    background: #e8f5e8;
    padding: 8px 12px;
    border-radius: 4px;
    margin: 5px 0;
    font-size: 0.9em;
    border-left: 3px solid #4caf50;
}

/* Responsive Design */
@media (max-width: 768px) {
    .resource-filters {
        flex-direction: column;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .resource-modal-content {
        width: 95%;
        padding: 20px;
    }
}

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

.payment-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.payment-modal h3 {
    margin-top: 0;
    color: #333;
    margin-bottom: 20px;
}

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

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

.payment-amount {
    font-size: 1.2em;
    font-weight: bold;
    color: #d32f2f;
    margin: 15px 0;
    text-align: center;
}

.btn-pay-now {
    background: #007cba;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    margin-top: 15px;
}

.btn-pay-now:hover {
    background: #005a87;
}

.btn-pay-now:disabled {
    background: #ccc;
    cursor: not-allowed;
}


/* Image Preview Styles */
.image-preview {
    position: relative;
    display: inline-block;
    margin-top: 10px;
    border: 2px dashed #ddd;
    padding: 10px;
    border-radius: 4px;
}

.image-preview img {
    max-width: 200px;
    max-height: 150px;
    display: block;
}

.remove-preview {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #d32f2f;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.remove-preview:hover {
    background: #b71c1c;
}

.current-thumbnail-preview img {
    max-width: 200px;
    max-height: 150px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 5px;
}

/* Form group adjustments for previews */
.form-group {
    position: relative;
}



