/* Image Preview Module Styles */

/* Drop Zone Styling */
.image-drop-zone {
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Removed drag-over styling - no visual feedback needed */

.drop-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    text-align: center;
    padding: 20px;
}

.drop-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    opacity: 0.7;
}

.drop-text {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Preview Image */
.preview-image {
    transition: transform 0.3s ease;
}

/* Image Controls */
.image-controls {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.image-drop-zone:hover .image-controls {
    opacity: 1;
}

.control-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    color: #333;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.edit-btn:hover {
    background: rgba(52, 144, 220, 0.1);
    color: #3490dc;
}

.delete-btn:hover {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

/* Modal Styling */
.image-edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.image-edit-modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: white;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 90vw;
    max-height: 90vh;
    animation: modalSlideIn 0.3s ease;
    overflow: hidden;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    color: #333;
}

.modal-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.modal-close {
    display: none;
}

.modal-close:hover {
    background: #e0e0e0;
    transform: scale(1.1);
}

/* Modal Body */
.modal-body {
    padding: 24px;
    display: flex;
    gap: 24px;
}

.modal-preview-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.modal-preview {
    border-radius: 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.modal-preview img {
    border-radius: 0;
}

/* Modal Controls */
.modal-controls {
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-group {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.control-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    color: #495057;
    font-size: 0.9rem;
}

/* Rotation Controls */
.rotation-slider {
    width: 100%;
    margin: 8px 0;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    outline: none;
}

.rotation-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 3px solid #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.rotation-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    border-color: #764ba2;
}

.rotation-value {
    display: inline-block;
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    color: #667eea;
    margin-left: 8px;
    background: rgba(102, 126, 234, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
}

.rotation-buttons {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.rotate-btn, .reset-btn {
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 55px;
    text-align: center;
}

.rotate-btn:hover {
    border-color: #3490dc;
    background: #3490dc;
    color: white;
    transform: translateY(-1px);
}

.reset-btn {
    border-color: #e74c3c;
    color: #e74c3c;
}

.reset-btn:hover {
    border-color: #e74c3c;
    background: #e74c3c;
    color: white;
    transform: translateY(-1px);
}

/* Scale Controls */
.scale-slider {
    width: 100%;
    margin-bottom: 8px;
    accent-color: #3490dc;
}

.scale-value {
    display: inline-block;
    background: #3490dc;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Position Controls */
.position-x, .position-y {
    width: 100%;
    margin-bottom: 8px;
    accent-color: #28a745;
}

/* Modal Footer */
.modal-footer {
    padding: 16px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-cancel, .btn-apply {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.btn-cancel {
    background: #6c757d;
    color: white;
}

.btn-cancel:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.btn-apply {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.btn-apply:hover {
    background: linear-gradient(135deg, #218838, #1ba085);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        margin: 20px;
        max-width: calc(100vw - 40px);
    }
    
    .modal-body {
        flex-direction: column;
        padding: 16px;
    }
    
    .modal-controls {
        width: 100%;
    }
    
    .modal-preview-container {
        min-height: 300px;
    }
}

/* Animation cho hover effects */
.image-drop-zone:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.image-drop-zone:not(.drag-over):hover .drop-placeholder {
    color: #3490dc;
}

.image-drop-zone:not(.drag-over):hover .drop-icon {
    transform: scale(1.1);
    opacity: 1;
}

/* Layout selector uses existing .btn .btn-primary .btn-small classes */

/* Custom compact layout button */
.btn-layout-compact {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: 1px solid #007bff;
    padding: 4px 8px !important;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0;
    display: inline-block;
    line-height: 1.2;
}

.btn-layout-compact:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    border-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

/* Layout Modal */
.layout-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    display: none;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
    pointer-events: all;
}

.layout-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1;
}

.layout-modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    z-index: 10;
    overflow: hidden;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.layout-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    border-bottom: 1px solid #eee;
    border-radius: 20px 20px 0 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.layout-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.layout-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.layout-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.layout-modal-body {
    flex: 1;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.layout-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.layout-tab {
    flex: 1;
    padding: 16px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
}

.layout-tab:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

.layout-tab.active {
    background: white;
    color: #2196f3;
    border-bottom-color: #2196f3;
}

.layout-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.layout-template {
    background: white;
    border: 2px solid #eee;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.layout-template:hover {
    border-color: #2196f3;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(33, 150, 243, 0.2);
}

.layout-template.selected {
    border-color: #2196f3;
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.layout-preview-thumb {
    width: 100%;
    max-width: 120px;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, #f5f5f5 0%, #eeeeee 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
}

.layout-preview-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.layout-preview-icon {
    font-size: 24px;
    opacity: 0.6;
}

.layout-info {
    text-align: center;
}

.layout-name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
}

.layout-size {
    font-size: 12px;
    color: #666;
    margin-bottom: 2px;
}

.layout-ratio {
    font-size: 11px;
    color: #999;
    font-style: italic;
}

.layout-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 30px;
    border-top: 1px solid #eee;
    border-radius: 0 0 20px 20px;
    background: #f8f9fa;
}

.layout-modal-footer .btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .layout-modal-content {
        width: 95%;
        max-height: 90vh;
        margin: 20px;
    }
    
    .layout-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .layout-tabs {
        flex-wrap: wrap;
    }
    
    .layout-tab {
        font-size: 12px;
        padding: 12px 16px;
    }
    
    .layout-modal-header {
        padding: 20px;
    }
    
    .layout-modal-footer {
        padding: 16px 20px;
    }
} 