/* Ethical Gallery Frontend Styles */
.ethical-gallery-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.ethical-gallery-grid {
    display: grid;
    gap: 20px;
}

.ethical-gallery-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ethical-gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.ethical-gallery-image {
    width: 100%;
    overflow: hidden;
    cursor: pointer;
}

.ethical-gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.ethical-gallery-image img:hover {
    transform: scale(1.1);
}

.no-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.ethical-gallery-header {
    padding: 15px 15px 5px 15px;
    margin: 0;
    font-size: 18px;
    color: #333;
}

.ethical-gallery-message {
    padding: 0 15px 15px 15px;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.message-excerpt {
    margin-bottom: 10px;
}

.read-more-btn {
    color: #4CAF50;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: inline-block;
}

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

/* Popup Modal */
.ethical-popup {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    overflow: auto;
}

.ethical-popup.active {
    display: block;
}

.ethical-popup-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    position: relative;
    animation: popupFadeIn 0.3s ease;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ethical-popup-close {
    position: absolute;
    right: 20px;
    top: 10px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1;
}

.ethical-popup-close:hover {
    color: #333;
}

.ethical-popup-body {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.ethical-popup-image {
    flex: 0 0 40%;
}

.ethical-popup-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.ethical-popup-text {
    flex: 1;
}

.ethical-popup-title {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 24px;
}

.ethical-popup-header {
    margin: 0 0 15px 0;
    color: #4CAF50;
    font-size: 18px;
    font-weight: 500;
}

.ethical-popup-message {
    color: #666;
    line-height: 1.8;
    font-size: 16px;
}

/* Loading State */
.ethical-popup.loading .ethical-popup-content {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ethical-popup.loading .ethical-popup-content::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Settings Page Styles */
.ethical-settings-container {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.ethical-settings-form {
    flex: 2;
    min-width: 300px;
}

.ethical-shortcode-info {
    flex: 1;
    min-width: 300px;
}

.ethical-info-box {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.ethical-shortcode-display {
    margin-bottom: 30px;
}

.ethical-shortcode-display code {
    font-size: 16px;
    background: #f5f5f5;
    padding: 10px 15px;
    border-radius: 4px;
    display: inline-block;
}

.ethical-shortcode-parameters {
    margin-bottom: 30px;
}

.ethical-examples {
    margin-top: 20px;
}

.ethical-examples code {
    background: #f5f5f5;
    padding: 8px 12px;
    border-radius: 4px;
    display: inline-block;
    margin: 5px 0;
}

.copy-shortcode {
    margin-left: 10px;
}

/* Frontend Manager Styles */
.ethical-manager-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ethical-manager-login {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 8px;
    text-align: center;
}

.ethical-manager-login input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.ethical-button {
    padding: 10px 20px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.ethical-button:hover {
    background: #45a049;
}

.ethical-button-primary {
    background: #4CAF50;
}

.ethical-button-secondary {
    background: #6c757d;
}

.ethical-button-secondary:hover {
    background: #5a6268;
}

.ethical-button-small {
    padding: 5px 10px;
    font-size: 12px;
}

.ethical-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.ethical-manager-toolbar {
    margin-bottom: 20px;
}

.ethical-manager-form {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
}

.ethical-manager-items {
    display: grid;
    gap: 15px;
}

.ethical-manager-item {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s ease;
}

.ethical-manager-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.ethical-manager-item-info {
    flex: 1;
}

.ethical-manager-item-info h4 {
    margin: 0 0 5px 0;
    color: #333;
}

.ethical-manager-item-info p {
    margin: 0;
    color: #666;
    font-size: 13px;
}

.ethical-manager-item-actions {
    display: flex;
    gap: 10px;
}

.ethical-manager-item-actions button {
    padding: 5px 10px;
    font-size: 12px;
}

/* Enhanced Image Uploader with Drag & Drop */
.ethical-image-uploader-frontend {
    margin: 15px 0;
    padding: 30px 20px;
    background: #fff;
    border: 2px dashed #4CAF50;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.ethical-image-uploader-frontend:hover,
.ethical-image-uploader-frontend.dragover {
    background: #f0fdf4;
    border-color: #45a049;
    transform: scale(1.02);
}

.ethical-image-uploader-frontend.has-image {
    border-style: solid;
    background: #f9f9f9;
    padding: 20px;
}

.ethical-image-uploader-frontend .upload-icon {
    font-size: 48px;
    color: #4CAF50;
    margin-bottom: 10px;
    display: block;
}

.ethical-image-uploader-frontend .upload-text {
    color: #666;
    margin-bottom: 15px;
}

.ethical-image-uploader-frontend .upload-text strong {
    color: #4CAF50;
}

.ethical-image-uploader-frontend .upload-hint {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}

.ethical-image-uploader-frontend .file-info {
    display: inline-block;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 13px;
    margin-top: 10px;
}

.ethical-image-uploader-frontend .remove-image-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 10px;
}

.ethical-image-uploader-frontend .remove-image-btn:hover {
    background: #c82333;
}

.ethical-image-preview {
    margin-top: 15px;
    position: relative;
    display: inline-block;
}

.ethical-image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ethical-image-preview .preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ethical-image-preview:hover .preview-overlay {
    opacity: 1;
}

.ethical-image-preview .preview-overlay span {
    color: white;
    font-size: 12px;
    background: rgba(0,0,0,0.7);
    padding: 5px 10px;
    border-radius: 4px;
}

.ethical-error {
    color: #dc3545;
    font-size: 14px;
    margin-top: 10px;
}

.ethical-manager-disabled {
    text-align: center;
    padding: 40px;
    background: #f8d7da;
    color: #721c24;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
}

/* Pagination Styles */
.ethical-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 40px;
    padding: 20px 0;
}

.ethical-page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ethical-page-btn:hover:not(:disabled) {
    background: #4CAF50;
    border-color: #4CAF50;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.2);
}

.ethical-page-btn.active {
    background: #4CAF50;
    border-color: #4CAF50;
    color: #fff;
    font-weight: 600;
}

.ethical-page-btn:disabled {
    background: #f5f5f5;
    border-color: #ddd;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

.ethical-page-numbers {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.ethical-page-dots {
    color: #666;
    font-size: 14px;
    padding: 0 5px;
}

.ethical-page-info {
    text-align: center;
    margin-top: 15px;
    color: #666;
    font-size: 14px;
}

.ethical-page-info .current-page {
    font-weight: 600;
    color: #4CAF50;
}

.ethical-page-info .total-pages {
    font-weight: 600;
    color: #333;
}

/* Loading State for Gallery */
.ethical-gallery-container.loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.ethical-gallery-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

/* Responsive Pagination */
@media (max-width: 768px) {
    .ethical-pagination {
        gap: 3px;
    }
    
    .ethical-page-btn {
        min-width: 35px;
        height: 35px;
        font-size: 13px;
        padding: 0 8px;
    }
    
    .ethical-page-numbers {
        gap: 3px;
    }
}

@media (max-width: 480px) {
    .ethical-pagination {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ethical-page-numbers {
        justify-content: center;
        margin: 10px 0;
    }
    
    .ethical-page-btn {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .ethical-gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .ethical-popup-body {
        flex-direction: column;
    }
    
    .ethical-popup-image {
        flex: 0 0 auto;
    }
    
    .ethical-settings-container {
        flex-direction: column;
    }
    
    .ethical-manager-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .ethical-manager-item-actions {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .ethical-gallery-grid {
        grid-template-columns: 1fr !important;
    }
    
    .ethical-manager-login {
        margin: 20px auto;
        padding: 20px;
    }
    
    .ethical-image-uploader-frontend {
        padding: 20px 15px;
    }
    
    .ethical-image-uploader-frontend .upload-icon {
        font-size: 36px;
    }
}