/**
 * 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: inherit;
}

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


.ump-title {
    color: inherit;
    font-size: 24px;
    margin: 0 0 30px 0;
    font-weight: 600;
}


/* 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;
}

.ump-empty-state .ump-add-profile-btn {
    position: relative;
    z-index: 10;
    pointer-events: auto;
    cursor: pointer;
}

/* 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;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.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;
    position: relative;
    z-index: 999;
    pointer-events: auto;
    display: inline-block;
    text-decoration: none;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
}

.ump-action-btn.ump-delete-btn {
    background: #dc3545 !important;
    border: 1px solid #dc3545 !important;
    color: #fff !important;
}

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

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

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


/* Bottom Actions Bar */
.ump-bottom-actions {
    position: fixed;
    bottom: 63.3px;
    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;
}


/* Method Selection */
.ump-method-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.ump-method-card {
    cursor: pointer;
}

.ump-method-description {
    color: #666;
    font-size: 14px;
    margin: 8px 0 0 0;
    line-height: 1.4;
}

/* Method cards inherit profile card styling automatically */

/* 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;
}



/* 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-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;
}

/* Page Layout */
.ump-page-content {
    min-height: 100vh;
    padding-bottom: 20px;
}

.ump-page-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e8eaed;
}

.ump-back-btn {
    background: #1E3665;
    color: #fff !important;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}

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

.ump-page-title {
    color: #1E3665;
    font-size: 24px;
    margin: 0;
    font-weight: 600;
}

.ump-form-container {
    max-width: 800px;
    margin: 0 auto;
}

.ump-method-selection {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.ump-method-selection h3 {
    color: #1E3665;
    font-size: 20px;
    margin-bottom: 30px;
    font-weight: 600;
}

/* Mobile responsive for page layout */
@media (max-width: 768px) {
    .ump-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .ump-back-btn {
        align-self: flex-start;
    }

    .ump-page-title {
        font-size: 20px;
    }
}