/* ==================================================
   UPLOAD & CROP LOGO MODAL – High-impact design
   Matches Company Image Manager and Cover Image Manager styling
   ================================================== */

/* --- Z-Index --- */
#logoCrop_combinedImageModal {
    z-index: 10001 !important;
}
#logoCrop_combinedImageModal .modal-dialog {
    z-index: 10001 !important;
}
#logoCrop_combinedImageModal .modal-content {
    z-index: 10001 !important;
}

/* --- Modal Dialog --- */
.logo-crop-modal-dialog {
    max-width: 900px !important;
    width: 90vw;
}

/* --- Header: Classic gray --- */
.logo-crop-modal-header {
    background: #e5e7eb !important;
    color: #374151 !important;
    padding: 10px 16px !important;
    border-bottom: 1px solid #d1d5db !important;
    border-radius: 16px 16px 0 0 !important;
    box-shadow: none !important;
}
.logo-crop-modal-header .header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo-crop-modal-header .header-icon {
    font-size: 20px !important;
    opacity: 0.9;
    color: #4b5563;
}
.logo-crop-modal-header .header-text {
    flex: 1;
}
.logo-crop-modal-header .title-main {
    display: block;
    font-size: 16px !important;
    font-weight: 600 !important;
    margin-bottom: 2px !important;
    color: #1f2937;
}
.logo-crop-modal-header .title-subtitle {
    display: block;
    font-size: 12px !important;
    font-weight: 500 !important;
    color: #6b7280 !important;
}
.logo-crop-modal-header .close {
    color: #6b7280 !important;
    opacity: 0.9;
    font-size: 20px;
}
.logo-crop-modal-header .close:hover {
    opacity: 1;
    color: #374151 !important;
}

/* --- Modal Body Layout --- */
.logo-crop-modal-body {
    display: flex;
    flex-direction: row;
    padding: 0 !important;
    min-height: 480px;
    background: #f8fafc;
}

/* --- Left Sidebar --- */
.logo-crop-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* --- Upload Button: High-impact --- */
.logo-crop-upload-section {
    text-align: center;
    position: relative;
}
.logo-upload-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 16px;
    border: 2px dashed #9ca3af;
    border-radius: 12px;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #374151;
}
.logo-upload-btn:hover {
    border-color: #6b7280;
    background: #f3f4f6;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.logo-upload-btn i {
    font-size: 28px;
    color: #6b7280;
}
.logo-upload-btn span {
    font-weight: 700;
    font-size: 15px;
    color: #374151;
}
.logo-upload-btn small {
    font-size: 12px;
    color: #6b7280;
}
/* File input inside label - hidden but functional */
.logo-upload-btn input[type="file"],
#logoCrop_combinedUploadInput {
    display: none;
}

/* --- Current Logo Preview --- */
.logo-crop-current-preview {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.logo-crop-preview-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.logo-crop-preview-box {
    width: 100%;
    aspect-ratio: 1;
    max-height: 140px;
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.logo-crop-preview-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.logo-crop-preview-box img[src=""],
.logo-crop-preview-box img:not([src]) {
    display: none;
}
.logo-crop-no-logo {
    font-size: 12px;
    color: #94a3b8;
    font-style: italic;
}
.logo-crop-preview-box:has(img[src]:not([src=""])) .logo-crop-no-logo {
    display: none;
}

/* --- Progress Bar --- */
.logo-crop-progress .progress {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
}
.logo-crop-progress .progress-bar {
    background: #6b7280;
    transition: width 0.3s ease;
}
.logo-crop-progress-text {
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
    text-align: center;
}

/* --- Right Main Area --- */
.logo-crop-main {
    flex: 1;
    min-width: 0;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* --- Crop Container --- */
.logo-crop-container {
    position: relative;
    width: 100%;
    max-width: 420px;
    height: 340px;
    margin: 0 auto;
    background: #e2e8f0;
    border: 2px solid #94a3b8;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}
#logoCrop_combinedCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    cursor: move;
    display: block;
}
#logoCrop_cropGrid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

/* Empty state when no image loaded */
.logo-crop-empty-state {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #94a3b8;
    z-index: 2;
}
.logo-crop-empty-state i {
    font-size: 48px;
    opacity: 0.6;
}
.logo-crop-empty-state p {
    font-weight: 600;
    font-size: 15px;
    margin: 0;
}
.logo-crop-empty-state small {
    font-size: 12px;
}
.logo-crop-container.has-image .logo-crop-empty-state {
    display: none;
}

/* --- Crop Controls --- */
.logoCrop_crop-controls {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    padding: 1rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
}
.logo-crop-control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.logo-crop-control-group h6 {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.logo-crop-control-group h6 i {
    color: #6b7280;
}
.logo-crop-control-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.btn-logo-control {
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #6b7280 !important;
    color: white !important;
    border: none !important;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-logo-control:hover:not(:disabled) {
    background: #4b5563 !important;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.btn-logo-control:disabled {
    background: #cbd5e1 !important;
    color: #94a3b8 !important;
    cursor: not-allowed;
}
.logo-crop-control-row input[type="range"] {
    width: 100px;
    accent-color: #6b7280;
}

/* --- Status --- */
.logo-crop-status {
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: #64748b;
    min-height: 24px;
}
.logo-crop-status .text-danger { color: #dc2626 !important; }
.logo-crop-status .text-success { color: #059669 !important; }
#logoCrop_cropLoadingSpinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #e2e8f0;
    border-top-color: #6b7280;
    border-radius: 50%;
    animation: logoCropSpin 0.8s linear infinite;
    vertical-align: middle;
    margin-left: 8px;
}
@keyframes logoCropSpin {
    to { transform: rotate(360deg); }
}

/* --- Footer: Visible Buttons --- */
.logo-crop-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem 1.5rem !important;
    border-top: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
}
.logo-crop-footer-left,
.logo-crop-footer-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.btn-logo-reset {
    background: #9ca3af !important;
    color: white !important;
    border: none !important;
    padding: 10px 20px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    transition: all 0.2s ease;
}
.btn-logo-reset:hover:not(:disabled) {
    background: #6b7280 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}
.btn-logo-reset:disabled {
    background: #e2e8f0 !important;
    color: #94a3b8 !important;
    cursor: not-allowed;
}
.btn-logo-close {
    background: #64748b !important;
    color: white !important;
    border: none !important;
    padding: 10px 20px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
}
.btn-logo-close:hover {
    background: #475569 !important;
    color: white !important;
}
.btn-logo-save {
    background: #4b5563 !important;
    color: white !important;
    border: none !important;
    padding: 10px 24px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}
.btn-logo-save:hover:not(:disabled) {
    background: #374151 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.btn-logo-save:disabled {
    background: #d1d5db !important;
    color: #9ca3af !important;
    cursor: not-allowed;
    box-shadow: none;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .logo-crop-modal-body {
        flex-direction: column;
    }
    .logo-crop-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .logo-crop-upload-section {
        flex: 1;
        min-width: 180px;
    }
    .logo-crop-current-preview {
        flex: 1;
        min-width: 120px;
    }
    .logo-crop-container {
        height: 280px;
    }
}
