/* MODAL SYSTEM - Clean working version */

/* Modal Overlay */
.modal-overlay#mobileEditModalOverlay,
.modal-overlay#mobileBusinessEditModalOverlay,
.modal-overlay#photoUploadModal {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
}

#mobileEditModalOverlay[style*="display: none"],
#mobileBusinessEditModalOverlay[style*="display: none"],
#photoUploadModal:not(.active) {
    display: none !important;
}

/* Modal Container */
.mobile-edit-modal {
    background: #1e293b;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 2px solid #f6d365;
    padding: 24px;
    padding-bottom: 200px;
    position: relative;
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Titles */
.mobile-edit-modal .modal-title,
.mobile-edit-modal h3 {
    color: #f6d365;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
}

/* Form Fields */
.mobile-edit-modal .form-row {
    margin-bottom: 16px;
}

.mobile-edit-modal .form-row label {
    display: block;
    font-size: 14px;
    color: #f6d365;
    margin-bottom: 8px;
    font-weight: 600;
}

.mobile-edit-modal .form-row input,
.mobile-edit-modal .form-row textarea,
.mobile-edit-modal .form-row select {
    width: 100%;
    background: #0f172a;
    border: 2px solid #334155;
    border-radius: 8px;
    padding: 14px;
    color: #e6edf3;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s;
    min-height: 48px;
}

.mobile-edit-modal .form-row input:focus,
.mobile-edit-modal .form-row textarea:focus,
.mobile-edit-modal .form-row select:focus {
    outline: none;
    border-color: #f6d365;
    background: #2d3748;
    box-shadow: 0 0 0 3px rgba(246, 211, 101, 0.1);
}

.mobile-edit-modal .form-row textarea {
    resize: vertical;
    min-height: 100px;
}

/* Form Actions */
.mobile-edit-modal .form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.mobile-edit-modal .submit-btn,
.mobile-edit-modal .cancel-btn,
.mobile-edit-modal .form-btn {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 48px;
}

.mobile-edit-modal .submit-btn,
.mobile-edit-modal .form-btn.primary {
    background: #f6d365;
    color: #0d1117;
}

.mobile-edit-modal .submit-btn:active,
.mobile-edit-modal .form-btn.primary:active {
    transform: scale(0.98);
}

.mobile-edit-modal .cancel-btn,
.mobile-edit-modal .form-btn.secondary {
    background: #475569;
    color: #e8dcc8;
}

.mobile-edit-modal .cancel-btn:active,
.mobile-edit-modal .form-btn.secondary:active {
    transform: scale(0.98);
}

/* Modal Close Button */
.mobile-edit-modal .modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: #e6edf3;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
    z-index: 10;
}

.mobile-edit-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f6d365;
}

/* Photo Upload Specific Styling */
.file-size-limit {
    font-size: 12px;
    color: #7d8590;
    margin-top: 6px;
}

.photo-preview-container,
.crop-preview-container {
    margin-bottom: 16px;
    padding: 16px;
    background: #0f172a;
    border: 2px solid #334155;
    border-radius: 8px;
}

.photo-preview-label,
.crop-preview-label {
    font-size: 14px;
    color: #f6d365;
    margin-bottom: 12px;
    font-weight: 600;
}

.photo-preview-frame,
.crop-preview-frame {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
}

.photo-preview-frame img,
.crop-preview-frame img {
    width: 100%;
    height: auto;
    display: block;
}

.crop-instructions {
    font-size: 13px;
    color: #7d8590;
    margin-bottom: 12px;
}

.crop-control-row {
    margin-bottom: 12px;
}

.crop-control-row label {
    display: block;
    font-size: 13px;
    color: #e6edf3;
    margin-bottom: 6px;
}

.crop-control-row input[type="range"] {
    width: 100%;
    min-height: 32px;
    padding: 0;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .modal-overlay#mobileEditModalOverlay,
    .modal-overlay#mobileBusinessEditModalOverlay,
    .modal-overlay#photoUploadModal {
        padding: 0;
        align-items: flex-start;
    }

    .mobile-edit-modal {
        width: 100%;
        max-width: none;
        max-height: 100vh;
        border-radius: 0;
        padding-bottom: 250px;
        margin: 0;
    }
}
