/**
 * Frontend Styles - Arabic Version (Redesigned)
 * User Measurement Profiles
 */

/* Container */
.ump-frontend-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 100px; /* Space for sticky buttons */
    font-family: 'Noto Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, sans-serif;
}

.ump-frontend-container[dir="rtl"] {
    text-align: right;
}

.ump-header-section {
    background: #1E3665;
    color: #fff;
    padding: 0 30px;
    margin: -20px -20px 30px -20px;
    border-radius: 0;
    height: 50px;
    display: flex;
    align-items: center;
}

.ump-title {
    color: #fff;
    font-size: 24px;
    margin: 0;
    font-weight: 600;
    line-height: 50px;
}

/* Override WooCommerce margin */
.woocommerce-js h2.ump-title {
    margin-bottom: 0 !important;
}

/* Empty State */
.ump-empty-state {
    text-align: center;
    padding: 80px 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(30, 54, 101, 0.1);
}

.ump-empty-state h3 {
    color: #1E3665;
    font-size: 24px;
    margin-bottom: 10px;
    margin-top: 0;
    font-weight: 600;
}

.ump-empty-state p {
    color: #666;
    font-size: 16px;
    margin-bottom: 30px;
}

/* Selection Helper */
.ump-selection-helper {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
    text-align: center;
}

/* New Profile Grid */
.ump-profiles-grid-new {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.ump-profile-card-new {
    background: #fff;
    border: 2px solid #e8eaed;
    border-radius: 16px;
    padding: 0;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.ump-profile-card-new:hover {
    box-shadow: 0 12px 24px rgba(30, 54, 101, 0.15);
    border-color: #1E3665;
}

.ump-profile-card-new.selected {
    border-color: #1E3665;
    background: linear-gradient(to bottom, #f0f4ff 0%, #fff 100%);
    box-shadow: 0 8px 20px rgba(30, 54, 101, 0.2);
}

/* Selection Badge */
.ump-selection-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #fff;
    border: 2px solid #e8eaed;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
}

.ump-profile-card-new:hover .ump-selection-badge {
    border-color: #1E3665;
    background: #1E3665;
    color: #fff;
}

.ump-profile-card-new.selected .ump-selection-badge {
    background: #28a745;
    border-color: #28a745;
    color: #fff;
}

.ump-check-icon {
    margin-left: 4px;
    font-weight: bold;
}

/* Card Content */
.ump-card-content-new {
    padding: 60px 20px 20px;
    text-align: center;
}

.ump-card-content-new h3 {
    margin: 0 0 20px 0;
    color: #1E3665;
    font-size: 20px;
    font-weight: 600;
}

.ump-card-actions-new {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.ump-action-btn {
    background: #1E3665;
    border: 1px solid #1E3665;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    color: #fff !important;
}

.ump-action-btn:hover {
    background: #152847;
    border-color: #152847;
    color: #fff !important;
}

.ump-action-btn:active {
    color: #fff !important;
}


/* Bottom Actions Bar */
.ump-bottom-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 15px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    border-top: 2px solid #e8eaed;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
}

.ump-bottom-actions .ump-btn {
    width: 100%;
    margin: 0;
}

.ump-btn-outline {
    background: #1E3665;
    color: #fff !important;
    border: 2px solid #1E3665;
}

.ump-btn-outline:hover {
    background: #152847;
    color: #fff !important;
    border-color: #152847;
}

.ump-proceed-btn {
    min-width: 200px;
    font-size: 16px;
    font-weight: 600;
    padding: 14px 28px;
}

.ump-proceed-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Measurement Row (for compatibility) */
.ump-measurement-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.ump-measurement-row:last-child {
    border-bottom: none;
}

.ump-measurement-label {
    color: #666;
    font-weight: 500;
}

.ump-measurement-value {
    color: #1E3665;
    font-weight: 600;
}

.ump-no-measurements {
    color: #999;
    text-align: center;
    font-style: italic;
}

/* Buttons */
.ump-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ump-btn-primary {
    background: #1E3665;
    color: #fff !important;
}

.ump-btn-primary:hover:not(:disabled) {
    background: #152847;
    color: #fff !important;
}

.ump-btn-primary:active {
    color: #fff !important;
}

.ump-btn-secondary {
    background: #1E3665;
    color: #fff !important;
}

.ump-btn-secondary:hover:not(:disabled) {
    background: #152847;
    color: #fff !important;
}

.ump-btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ump-btn-secondary:active {
    color: #fff !important;
}

/* Modal */
.ump-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ump-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: -1;
}

.ump-modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.ump-modal-header {
    padding: 20px;
    background: #1E3665;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

.ump-modal-header h2 {
    margin: 0;
    font-size: 22px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.ump-modal-body {
    padding: 30px;
}

/* Method Selection */
.ump-method-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.ump-method-btn {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px 15px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.ump-method-btn:hover:not(:disabled) {
    border-color: #1E3665;
    background: #f8f9fa;
}

.ump-method-btn[data-method="measurement-room"] {
    opacity: 1;
    cursor: pointer;
}


.ump-method-title {
    font-size: 16px;
    font-weight: 600;
    color: #1E3665;
    display: block;
}

.ump-method-desc {
    font-size: 12px;
    color: #999;
    display: block;
}

/* Forms */
.ump-form-group {
    margin-bottom: 20px;
}

.ump-form-group label {
    display: block;
    margin-bottom: 8px;
    color: #1E3665;
    font-weight: 600;
    font-size: 14px;
}

.ump-form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    font-family: inherit;
}

.ump-form-group input:focus {
    border-color: #1E3665;
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 54, 101, 0.1);
}

.ump-form-group small {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 12px;
}

.ump-measurements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.ump-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* Notifications */
.ump-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    z-index: 100000;
    animation: slideIn 0.3s ease;
}

.ump-notification-content {
    background: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ump-notification.success .ump-notification-content {
    background: #28a745;
    color: #fff;
}

.ump-notification.error .ump-notification-content {
    background: #dc3545;
    color: #fff;
}

.ump-notification-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
    margin-left: 15px;
}

/* Modal Footer */
.ump-modal-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.ump-modal-close-btn {
    min-width: 120px;
}

/* Details Modal */
.ump-details-grid {
    margin-top: 20px;
}

.ump-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 15px;
}

.ump-detail-row:last-child {
    border-bottom: none;
}

.ump-detail-label {
    color: #666;
    font-weight: 500;
}

.ump-detail-value {
    color: #1E3665;
    font-weight: 600;
}

#ump-details-content h3 {
    color: #1E3665;
    font-size: 22px;
    margin: 0 0 10px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

/* Loading States */
.ump-btn-loading {
    display: none;
}

.ump-btn.loading .ump-btn-text {
    display: none;
}

.ump-btn.loading .ump-btn-loading {
    display: inline-block;
}

/* Mobile Responsive */
/* Loading Overlay */
.ump-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100001;
}

.ump-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e0e0e0;
    border-top-color: #1E3665;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .ump-profiles-grid-new {
        grid-template-columns: 1fr;
    }
    
    .ump-measurements-grid {
        grid-template-columns: 1fr;
    }
    
    .ump-method-options {
        grid-template-columns: 1fr;
    }
    
    .ump-modal-content {
        max-height: 100vh;
        height: 100%;
        border-radius: 0;
        max-width: 100%;
    }
    
    .ump-modal {
        padding: 0;
    }
    
    .ump-modal-header {
        border-radius: 0;
    }
    
    .ump-form-actions {
        justify-content: space-between;
    }
    
    .ump-form-actions .ump-btn {
        width: 48%;
    }
    
    .ump-bottom-actions {
        flex-direction: column;
    }
    
    .ump-bottom-actions .ump-btn {
        width: 100%;
    }
    
    .ump-title {
        font-size: 24px;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* RTL Support */
[dir="rtl"] .ump-measurement-row {
    flex-direction: row-reverse;
}

[dir="rtl"] .ump-form-actions {
    flex-direction: row-reverse;
}

[dir="rtl"] .ump-notification {
    left: 20px;
    right: auto;
}

[dir="rtl"] .ump-notification-close {
    margin-left: 0;
    margin-right: 15px;
}


[dir="rtl"] .ump-selection-badge {
    left: auto;
    right: 12px;
}

/* Notice */
.ump-notice {
    padding: 15px;
    background: #f0f8ff;
    border-right: 4px solid #1E3665;
    border-radius: 4px;
    color: #1E3665;
    font-size: 16px;
    text-align: center;
}