/* Lumaprints Print Ordering Styles */

/* Modal Overlay - Critical for proper display */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none; /* Start hidden */
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
}

.modal.show {
    display: flex; /* Show when .show class is added */
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
}

/* Restore original modal content styling */
.modal-content {
    position: relative;
    margin: auto;
    padding: 10px;
    width: 95%;
    max-width: 1400px;
    top: 50%;
    transform: translateY(-50%);
    text-align: center;
    background: transparent;
    border-radius: 8px;
    animation: modalSlideIn 0.3s ease;
}

/* White background only for print ordering sections */
.modal-print-order,
.modal-order-form {
    background: white !important;
    border-radius: 12px;
    padding: 20px;
    color: #333 !important;
    position: relative;
    width: 90vw;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto; /* Only print ordering can scroll */
    margin: 5vh auto;
}

/* Ensure all text in ordering sections is readable - DISABLED FOR DARK THEME */
/*
.modal-print-order *,
.modal-order-form * {
    color: #333 !important;
}
*/

.modal-print-order h3,
.modal-print-order h4,
.modal-order-form h3,
.modal-order-form h4 {
    color: #222 !important;
}

/* Fix order summary styling */
.order-summary {
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    padding: 20px !important;
    margin-bottom: 20px !important;
}

.order-summary h4 {
    color: #333 !important;
    margin-bottom: 15px !important;
}

.order-summary .summary-item {
    color: #555 !important;
}

.order-summary .total-price {
    color: #28a745 !important;
    font-weight: bold !important;
}

/* Restore original modal main view styling */
.modal-main-view {
    background: transparent;
    text-align: center;
}

.modal-main-view .modal-image {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    background: transparent;
    object-fit: contain;
}

.modal-main-view .modal-info {
    margin-top: 10px;
    color: white;
}

.modal-main-view .modal-info h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    font-weight: normal;
    font-family: 'Poppins', sans-serif;
    color: white;
}

.modal-main-view .modal-info p {
    color: #ccc;
    font-size: 0.85rem;
    font-family: 'Poppins', sans-serif;
    line-height: 1.1;
}

.modal-main-view .modal-actions {
    margin-top: 20px;
}

@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: 20px 30px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

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

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #e9ecef;
    color: #333;
}

/* Modal Body */
.modal-body {
    padding: 30px;
}

/* Order Print Button in Gallery Modal */
.modal-actions {
    margin-top: 20px;
    text-align: center;
}

.btn-order-print {
    background: linear-gradient(135deg, #6799c2, #5a8bb0);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-order-print:hover {
    background: linear-gradient(135deg, #5a8bb0, #4a7a9e);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(103, 153, 194, 0.3);
}

.btn-icon {
    font-size: 18px;
}

/* Print Order Modal */
.print-order-content {
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
}

.print-order-header {
    margin-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 20px;
}

.print-order-header h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 28px;
    font-weight: 600;
}

.order-image-preview {
    display: flex;
    align-items: center;
    gap: 20px;
}

.order-image-preview img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.order-image-info h4 {
    margin: 0;
    color: #555;
    font-size: 18px;
    font-weight: 500;
}

/* Product Selection */
.product-selection,
.size-selection,
.quantity-selection {
    margin-bottom: 30px;
}

.product-selection h4,
.size-selection h4,
.quantity-selection h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.product-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.product-category {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.product-category:hover {
    border-color: #6799c2;
    background: #f0f7ff;
}

.product-category.selected {
    border-color: #6799c2;
    background: #e6f3ff;
    box-shadow: 0 2px 8px rgba(103, 153, 194, 0.2);
}

.product-category h5 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.product-category p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Size Selection */
.size-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.size-option {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.size-option:hover {
    border-color: #6799c2;
    background: #f0f7ff;
}

.size-option.selected {
    border-color: #6799c2;
    background: #e6f3ff;
    box-shadow: 0 2px 8px rgba(103, 153, 194, 0.2);
}

.size-option .size-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.size-option .size-dimensions {
    font-size: 14px;
    color: #666;
}

/* Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.qty-btn {
    background: #6799c2;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.qty-btn:hover {
    background: #5a8bb0;
    transform: scale(1.1);
}

#quantity {
    width: 80px;
    height: 40px;
    text-align: center;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
}

/* Price Display */
.price-display {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.price-breakdown {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.price-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
}

.price-line.total {
    border-top: 2px solid #e9ecef;
    padding-top: 10px;
    margin-top: 10px;
    font-weight: 600;
    font-size: 18px;
    color: #333;
}

/* Order Actions */
.order-actions {
    text-align: center;
}

.btn-continue-order {
    background: linear-gradient(135deg, #28a745, #20a039);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-continue-order:hover {
    background: linear-gradient(135deg, #20a039, #1e7e34);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Loading States */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .print-order-content {
        width: 95%;
        padding: 20px;
        max-height: 95vh;
    }
    
    .order-image-preview {
        flex-direction: column;
        text-align: center;
    }
    
    .order-image-preview img {
        width: 100px;
        height: 100px;
    }
    
    .product-categories {
        grid-template-columns: 1fr;
    }
    
    .size-options {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .price-line {
        font-size: 14px;
    }
    
    .price-line.total {
        font-size: 16px;
    }
}

/* Animation for modal transitions */
.modal {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}


/* Inline Modal Views */
.modal-main-view,
.modal-print-order,
.modal-order-form {
    width: 100%;
    transition: all 0.3s ease;
}

.modal-print-order,
.modal-order-form {
    display: none;
}

/* Print Order Header */
.print-order-header,
.order-form-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 30px;
    border-bottom: 2px solid #f0f0f0;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.btn-back {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: #5a6268;
    transform: translateX(-2px);
}

.print-order-header h3,
.order-form-header h3 {
    margin: 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

/* Print Order Content */
.print-order-content,
.order-form-content {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Order Image Preview */
.order-image-preview {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.order-preview-img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.order-image-info h4 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

/* Customer Form */
.customer-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.customer-form h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 10px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input {
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #6799c2;
    box-shadow: 0 0 0 3px rgba(103, 153, 194, 0.1);
}

/* Payment Section */
.payment-section {
    border-top: 2px solid #e9ecef;
    padding-top: 20px;
    margin-top: 20px;
}

.payment-total {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

.btn-paypal {
    background: linear-gradient(135deg, #0070ba, #005ea6);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-paypal:hover {
    background: linear-gradient(135deg, #005ea6, #004c87);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 112, 186, 0.3);
}

.btn-paypal:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Order Summary */
.order-summary {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.order-summary h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.summary-item {
    display: flex;
    gap: 15px;
    align-items: center;
}

.summary-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.summary-details {
    flex: 1;
}

.summary-details div {
    margin-bottom: 5px;
    color: #555;
}

.summary-details .price {
    color: #28a745;
    font-weight: 600;
    font-size: 18px;
}

/* Responsive Design for Inline Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
        margin: 10px;
    }
    
    .print-order-content,
    .order-form-content {
        padding: 20px;
        max-height: 60vh;
    }
    
    .order-image-preview {
        flex-direction: column;
        text-align: center;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .print-order-header,
    .order-form-header {
        padding: 15px 20px;
    }
    
    .print-order-header h3,
    .order-form-header h3 {
        font-size: 20px;
    }
}


/* Comprehensive text color fixes for ordering interface */
.modal-print-order label,
.modal-order-form label {
    color: #333 !important;
}

/* DISABLED FOR DARK THEME */
/*
.modal-print-order input,
.modal-order-form input,
.modal-print-order select,
.modal-order-form select {
    color: #333 !important;
    background: white !important;
}
*/

.modal-print-order .product-category,
.modal-print-order .size-option {
    color: #333 !important;
    background: #f8f9fa !important;
}

.modal-print-order .product-category.selected,
.modal-print-order .size-option.selected {
    background: #007bff !important;
    color: white !important;
}

.modal-print-order .pricing-info,
.modal-order-form .pricing-info {
    color: #28a745 !important;
}

.modal-print-order .form-group label,
.modal-order-form .form-group label {
    color: #555 !important;
    font-weight: 500 !important;
}

.modal-print-order button,
.modal-order-form button {
    color: white !important;
}

.modal-print-order .btn-back,
.modal-order-form .btn-back {
    background: #6c757d !important;
    color: white !important;
}

/* Two-column layout for print ordering interface */
.print-order-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    align-items: start;
    margin-top: 20px;
}

.print-order-left {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.print-order-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #f8f9fa !important;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    position: sticky;
    top: 20px;
}

.print-order-right h4 {
    color: #333 !important;
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
}

.print-order-right .quantity-controls {
    justify-content: flex-start;
}

.print-order-right .price-display {
    background: white !important;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.print-order-right .btn-continue-order {
    width: 100%;
    padding: 15px;
    background: #28a745 !important;
    color: white !important;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.print-order-right .btn-continue-order:hover {
    background: #218838 !important;
}

.print-order-right .btn-continue-order:disabled {
    background: #6c757d !important;
    cursor: not-allowed;
}

/* Responsive: stack on mobile */
@media (max-width: 768px) {
    .print-order-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .print-order-right {
        position: static;
    }
}
