/* Image Crop Plugin Styles */

:root {
    --primary-bg: #F5F5F5;
    --header-bg: #E6F0FA;
    --text-color: #000000;
    --border-radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Container Styles */
.image-crop-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--primary-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

/* Header Styles */
.crop-header {
    background-color: var(--header-bg);
    padding: 20px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    margin-bottom: 20px;
    text-align: center;
}

.crop-header h1 {
    margin: 0 0 10px;
    color: var(--text-color);
    font-size: 2rem;
}

.privacy-note {
    background-color: rgba(255, 255, 255, 0.5);
    padding: 10px;
    border-radius: 20px;
    display: inline-block;
    font-size: 0.9rem;
    margin: 0;
}

.privacy-note i {
    margin-right: 5px;
    color: #4CAF50;
}

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

.upload-area {
    border: 3px dashed #ccc;
    border-radius: var(--border-radius);
    padding: 50px 20px;
    text-align: center;
    background-color: white;
    transition: var(--transition);
    cursor: pointer;
}

.upload-area.dragover {
    border-color: #4CAF50;
    background-color: rgba(76, 175, 80, 0.1);
}

.upload-area i {
    font-size: 4rem;
    color: #666;
    margin-bottom: 20px;
}

.upload-area h3 {
    margin: 0 0 10px;
    color: var(--text-color);
}

.file-info {
    color: #666;
    font-size: 0.9rem;
    margin-top: 10px;
}

/* Button Styles */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

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

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-icon {
    padding: 8px 12px;
    background-color: #f8f9fa;
    color: var(--text-color);
}

.btn-icon:hover {
    background-color: #e2e6ea;
}

/* Cropper Toolbar */
.cropper-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: white;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.tool-group {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

/* Aspect Ratio Section */
.aspect-ratio-section {
    background-color: white;
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.aspect-ratio-section label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
}

.ratio-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.ratio-tab {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    background: none;
    cursor: pointer;
    border-radius: 20px;
    transition: var(--transition);
}

.ratio-tab.active {
    background-color: var(--header-bg);
    border-color: var(--header-bg);
}

.ratio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.ratio-btn {
    padding: 8px;
    border: 1px solid #dee2e6;
    background: none;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition);
    font-size: 0.9rem;
}

.ratio-btn:hover {
    background-color: var(--header-bg);
    border-color: var(--header-bg);
}

/* Image Container */
.image-container {
    max-width: 100%;
    height: 500px;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 20px;
}

#cropImage {
    max-width: 100%;
    display: block;
}

/* Export Options */
.export-options {
    background-color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.option-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
}

.option-group label {
    font-weight: bold;
    min-width: 60px;
}

.form-control {
    padding: 8px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 1rem;
}

input[type="range"] {
    flex: 1;
}

#customSizeGroup {
    display: flex;
    align-items: center;
    gap: 5px;
}

#customSizeGroup input {
    width: 80px;
    padding: 8px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

/* Results Section */
.results-section {
    padding: 20px;
    text-align: center;
}

.result-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

#croppedResult {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.download-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0;
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .crop-header h1 {
        font-size: 1.5rem;
    }
    
    .cropper-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tool-group {
        justify-content: center;
    }
    
    .export-options {
        flex-direction: column;
        align-items: stretch;
    }
    
    .option-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .option-group label {
        min-width: auto;
    }
    
    .image-container {
        height: 350px;
    }
    
    .ratio-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}

@media (max-width: 480px) {
    .image-container {
        height: 250px;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .ratio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Touch Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn, .ratio-btn, .ratio-tab {
        padding: 12px 20px;
        font-size: 1.1rem;
    }
    
    .form-control, #customSizeGroup input {
        padding: 12px;
        font-size: 1.1rem;
    }
}

/* Accessibility */
.btn:focus, .ratio-btn:focus, .ratio-tab:focus, .form-control:focus {
    outline: 3px solid #4CAF50;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .image-crop-container {
        box-shadow: none;
    }
    
    .btn, .export-options, .cropper-toolbar {
        display: none;
    }
}