/**
 * Public styles for Image Toolkit Plugin
 */

/* Main container */
.image-toolkit-public {
    width: 100%;
    max-width: 1200px;
    margin: 30px auto;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #333;
    line-height: 1.5;
}

.image-toolkit-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header */
.image-toolkit-header {
    padding: 20px;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.image-toolkit-header h2 {
    margin: 0 0 10px;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.image-toolkit-description {
    margin: 0;
    color: #666;
}

/* Upload Section */
.image-toolkit-upload-section {
    padding: 30px 20px;
}

.image-toolkit-upload-container {
    background: #f9f9f9;
    border: 2px dashed #ccc;
    border-radius: 6px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.image-toolkit-upload-container:hover {
    border-color: #999;
    background: #f5f5f5;
}

.image-toolkit-upload-icon {
    font-size: 40px;
    color: #666;
    margin-bottom: 15px;
}

.image-toolkit-upload-text {
    font-size: 16px;
    color: #555;
    margin-bottom: 10px;
}

.image-toolkit-upload-notes {
    color: #888;
    font-size: 13px;
}

/* Dropzone customization */
.dropzone {
    border: none !important;
    background: transparent !important;
    min-height: auto !important;
    padding: 0 !important;
}

.dropzone .dz-message {
    margin: 0 !important;
}

.dropzone .dz-preview {
    margin: 15px !important;
}

.dropzone .dz-preview .dz-image {
    border-radius: 6px !important;
    overflow: hidden;
}

.dropzone .dz-preview.dz-file-preview .dz-image {
    background: #f0f0f0 !important;
}

.dropzone .dz-preview .dz-details {
    padding: 10px 0 !important;
}

.dropzone .dz-preview .dz-success-mark,
.dropzone .dz-preview .dz-error-mark {
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin-left: 0 !important;
    margin-top: 0 !important;
    background: rgba(255, 255, 255, 0.8) !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.dropzone .dz-preview .dz-success-mark i,
.dropzone .dz-preview .dz-error-mark i {
    font-size: 20px;
}

.dropzone .dz-preview .dz-success-mark i {
    color: #28a745;
}

.dropzone .dz-preview .dz-error-mark i {
    color: #dc3545;
}

.dropzone .dz-preview .dz-progress {
    width: 80% !important;
    left: 10% !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    top: 50% !important;
    height: 10px !important;
    border-radius: 10px !important;
}

.dropzone .dz-preview .dz-progress .dz-upload {
    background: #4CAF50 !important;
}

.dropzone .dz-preview .dz-error-message {
    top: 144px !important;
}

.dropzone .dz-preview .dz-remove {
    margin-top: 5px !important;
    color: #dc3545 !important;
    text-decoration: none !important;
    font-size: 13px !important;
}

.dropzone .dz-preview .dz-remove:hover {
    text-decoration: underline !important;
}

/* Tools Section */
.image-toolkit-tools-section {
    display: flex;
    flex-wrap: wrap;
    padding: 20px;
    gap: 20px;
}

.image-toolkit-preview-panel {
    flex: 1;
    min-width: 300px;
}

.image-toolkit-tools-panel {
    flex: 1;
    min-width: 300px;
}

.image-toolkit-preview-panel h3,
.image-toolkit-tools-panel h3 {
    margin: 0 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-size: 18px;
    font-weight: 500;
}

.image-toolkit-preview-container {
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 15px;
    text-align: center;
}

#image-toolkit-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

#image-toolkit-preview img {
    max-width: 100%;
    max-height: 400px;
    height: auto;
    border-radius: 4px;
}

.image-toolkit-image-info {
    background: #f0f0f0;
    border-radius: 4px;
    padding: 10px;
    text-align: left;
}

.image-info-item {
    margin-bottom: 5px;
}

.image-info-item:last-child {
    margin-bottom: 0;
}

.info-label {
    font-weight: 500;
    margin-right: 5px;
}

/* Tab navigation */
.image-toolkit-tabs {
    margin-bottom: 20px;
}

.image-toolkit-tabs-list {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #ddd;
}

.image-toolkit-tabs-list li {
    margin: 0;
    padding: 0;
}

.image-toolkit-tabs-list li a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.image-toolkit-tabs-list li a i {
    margin-right: 6px;
}

.image-toolkit-tabs-list li:hover a {
    color: #333;
    background: #f5f5f5;
}

.image-toolkit-tabs-list li.active a {
    color: #0073aa;
    border-bottom-color: #0073aa;
}

.image-toolkit-tab-content {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 20px;
}

.image-toolkit-tab-pane {
    display: none;
}

.image-toolkit-tab-pane.active {
    display: block;
}

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

.form-group:last-child {
    margin-bottom: 0;
}

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

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

.form-group input[type="color"] {
    width: 50px;
    height: 30px;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.form-group input[type="range"] {
    width: calc(100% - 50px);
    margin-right: 10px;
}

.range-with-value {
    display: flex;
    align-items: center;
}

.range-with-value output {
    width: 40px;
    text-align: right;
    font-weight: 500;
}

.resize-type-toggle,
.watermark-type-toggle {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.checkbox-group {
    margin-top: 10px;
}

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

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

.form-text {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 13px;
}

/* Buttons */
.image-toolkit-button {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.image-toolkit-button.primary {
    background: #0073aa;
    color: #fff;
}

.image-toolkit-button.primary:hover {
    background: #005f8b;
}

.image-toolkit-button.secondary {
    background: #f0f0f0;
    color: #333;
}

.image-toolkit-button.secondary:hover {
    background: #e3e3e3;
}

.image-toolkit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.image-toolkit-button i {
    margin-right: 6px;
}

/* Results Section */
.image-toolkit-results-section {
    padding: 20px;
}

.image-toolkit-results-section h3 {
    margin: 0 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-size: 18px;
    font-weight: 500;
}

.image-toolkit-results-container {
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 20px;
}

.image-toolkit-result-image {
    text-align: center;
    margin-bottom: 20px;
}

.image-toolkit-result-image img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 4px;
}

.image-toolkit-result-details {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.result-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f0;
}

.result-detail-item:last-child {
    border-bottom: none;
}

.result-detail-item.highlight {
    background: #f0f7ff;
    padding: 8px 10px;
    margin: 5px -10px;
    border-radius: 4px;
    font-weight: 500;
}

.detail-label {
    color: #555;
    font-weight: 500;
}

.detail-value {
    color: #333;
}

.image-toolkit-result-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

/* Loading Indicator */
#image-toolkit-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.image-toolkit-loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid #0073aa;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

.image-toolkit-loading-message {
    font-size: 16px;
    color: #333;
}

/* Error Message */
#image-toolkit-error {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 15px 20px;
    display: flex;
    align-items: flex-start;
    z-index: 9998;
    max-width: 400px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.image-toolkit-error-icon {
    margin-right: 10px;
    font-size: 18px;
    color: #dc3545;
}

.image-toolkit-error-message {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

/* Footer */
.image-toolkit-footer {
    padding: 15px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    text-align: center;
}

.image-toolkit-footer p {
    margin: 0;
    color: #777;
    font-size: 13px;
}

/* Dark Theme */
.image-toolkit-dark-theme {
    color: #e0e0e0;
}

.image-toolkit-dark-theme .image-toolkit-container {
    background: #292929;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.image-toolkit-dark-theme .image-toolkit-header {
    background: #1f1f1f;
    border-bottom-color: #333;
}

.image-toolkit-dark-theme .image-toolkit-header h2 {
    color: #fff;
}

.image-toolkit-dark-theme .image-toolkit-description {
    color: #aaa;
}

.image-toolkit-dark-theme .image-toolkit-upload-container {
    background: #333;
    border-color: #444;
}

.image-toolkit-dark-theme .image-toolkit-upload-container:hover {
    border-color: #666;
    background: #383838;
}

.image-toolkit-dark-theme .image-toolkit-upload-icon,
.image-toolkit-dark-theme .image-toolkit-upload-text {
    color: #ccc;
}

.image-toolkit-dark-theme .image-toolkit-upload-notes {
    color: #999;
}

.image-toolkit-dark-theme .image-toolkit-preview-container,
.image-toolkit-dark-theme .image-toolkit-image-info {
    background: #333;
    border-color: #444;
}

.image-toolkit-dark-theme .image-toolkit-tabs-list {
    border-bottom-color: #444;
}

.image-toolkit-dark-theme .image-toolkit-tabs-list li a {
    color: #aaa;
}

.image-toolkit-dark-theme .image-toolkit-tabs-list li:hover a {
    color: #ddd;
    background: #383838;
}

.image-toolkit-dark-theme .image-toolkit-tabs-list li.active a {
    color: #3498db;
    border-bottom-color: #3498db;
}

.image-toolkit-dark-theme .image-toolkit-tab-content {
    background: #292929;
    border-color: #444;
}

.image-toolkit-dark-theme .form-group label {
    color: #ccc;
}

.image-toolkit-dark-theme .form-group input,
.image-toolkit-dark-theme .form-group select {
    background: #333;
    border-color: #444;
    color: #ddd;
}

.image-toolkit-dark-theme .form-text {
    color: #aaa;
}

.image-toolkit-dark-theme .image-toolkit-button.primary {
    background: #3498db;
}

.image-toolkit-dark-theme .image-toolkit-button.primary:hover {
    background: #2980b9;
}

.image-toolkit-dark-theme .image-toolkit-button.secondary {
    background: #444;
    color: #ddd;
}

.image-toolkit-dark-theme .image-toolkit-button.secondary:hover {
    background: #555;
}

.image-toolkit-dark-theme .image-toolkit-results-container {
    background: #333;
    border-color: #444;
}

.image-toolkit-dark-theme .image-toolkit-result-details {
    background: #292929;
    border-color: #444;
}

.image-toolkit-dark-theme .result-detail-item {
    border-bottom-color: #3a3a3a;
}

.image-toolkit-dark-theme .result-detail-item.highlight {
    background: #2a394a;
}

.image-toolkit-dark-theme .detail-label {
    color: #bbb;
}

.image-toolkit-dark-theme .detail-value {
    color: #ddd;
}

.image-toolkit-dark-theme #image-toolkit-loading {
    background: rgba(25, 25, 25, 0.9);
}

.image-toolkit-dark-theme .image-toolkit-loading-spinner {
    border-color: rgba(255, 255, 255, 0.1);
    border-top-color: #3498db;
}

.image-toolkit-dark-theme .image-toolkit-loading-message {
    color: #ddd;
}

.image-toolkit-dark-theme .image-toolkit-footer {
    background: #1f1f1f;
    border-top-color: #333;
}

.image-toolkit-dark-theme .image-toolkit-footer p {
    color: #999;
}

/* Cropper.js customizations */
.cropper-container {
    max-width: 100%;
    margin: 0 auto;
}

.crop-instructions {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.crop-instructions.active {
    background: #e8f4fd;
    border-left: 3px solid #0073aa;
    padding-left: 15px;
}

.image-toolkit-dark-theme .crop-instructions {
    background: #333;
}

.image-toolkit-dark-theme .crop-instructions.active {
    background: #2a394a;
    border-left-color: #3498db;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .image-toolkit-tools-section {
        flex-direction: column;
    }
    
    .image-toolkit-preview-panel,
    .image-toolkit-tools-panel {
        width: 100%;
    }
    
    .image-toolkit-tabs-list {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 5px;
    }
    
    .image-toolkit-tabs-list li a {
        padding: 8px 12px;
    }
    
    .image-toolkit-result-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .image-toolkit-result-actions .image-toolkit-button {
        width: 100%;
    }
}
