/* Customer Portal Styles */
.customer-portal {
    padding: 2rem 0;
    min-height: calc(100vh - 80px);
    background: #f8f9fa;
}

.portal-header {
    text-align: center;
    margin-bottom: 3rem;
}

.portal-header h1 {
    color: #333;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.portal-header p {
    color: #666;
    font-size: 1.1rem;
}

/* Dashboard Stats */
.dashboard-overview {
    margin-bottom: 3rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.stat-content p {
    color: #666;
    margin: 0.25rem 0 0 0;
    font-size: 0.9rem;
}

/* Tabs */
.portal-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 1rem;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    color: #666;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s ease;
    position: relative;
}

.tab-btn:hover {
    color: #007bff;
    background: rgba(0, 123, 255, 0.1);
}

.tab-btn.active {
    color: #007bff;
    background: rgba(0, 123, 255, 0.1);
    border-bottom: 2px solid #007bff;
}

.tab-content {
    display: none;
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.tab-content.active {
    display: block;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.tab-header h2 {
    color: #333;
    font-size: 1.8rem;
    margin: 0;
}

.filter-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.filter-controls select,
.filter-controls input {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Orders List */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.order-item:hover {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.order-info {
    flex: 1;
}

.order-number {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.order-details {
    display: flex;
    gap: 2rem;
    color: #666;
    font-size: 0.9rem;
}

.order-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-processing {
    background: #cce5ff;
    color: #004085;
}

.status-shipped {
    background: #d4edda;
    color: #155724;
}

.status-delivered {
    background: #d1ecf1;
    color: #0c5460;
}

.order-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* Recurring Orders */
.recurring-orders-list {
    display: grid;
    gap: 1rem;
}

.recurring-order-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
}

.recurring-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.recurring-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    color: #666;
    font-size: 0.9rem;
}

.recurring-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Machine Configurator */
.configurator-list {
    display: grid;
    gap: 1rem;
}

.config-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.config-info h4 {
    color: #333;
    margin-bottom: 0.5rem;
}

.config-details {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.config-price {
    font-weight: 600;
    color: #007bff;
}

/* Profile Form */
.profile-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    margin: 0;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

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

.modal-content.large {
    max-width: 900px;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0.25rem;
    border-radius: 4px;
}

.modal-close:hover {
    background: #f8f9fa;
}

.modal-body {
    padding: 1.5rem;
}

/* Machine Configurator Modal */
.configurator-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.configurator-steps {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.step.active {
    opacity: 1;
}

.step.completed {
    opacity: 1;
    color: #28a745;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background: #007bff;
    color: white;
}

.step.completed .step-number {
    background: #28a745;
    color: white;
}

.step-title {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
}

.configurator-step {
    display: none;
}

.configurator-step.active {
    display: block;
}

.machine-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.machine-option {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.machine-option:hover {
    border-color: #007bff;
    box-shadow: 0 2px 10px rgba(0, 123, 255, 0.1);
}

.machine-option.selected {
    border-color: #007bff;
    background: rgba(0, 123, 255, 0.1);
}

.machine-option img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.machine-option h4 {
    color: #333;
    margin-bottom: 0.5rem;
}

.machine-option p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.machine-price {
    font-weight: 600;
    color: #007bff;
}

.option-groups {
    display: grid;
    gap: 2rem;
}

.option-group {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
}

.option-group h5 {
    color: #333;
    margin-bottom: 1rem;
}

.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.radio-group label,
.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.radio-group label:hover,
.checkbox-group label:hover {
    background: #f8f9fa;
}

.configuration-review {
    text-align: center;
}

.review-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
}

.configuration-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.configurator-navigation {
    display: flex;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

/* Customer Info Header */
.customer-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.customer-info span {
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .portal-tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 120px;
    }
    
    .filter-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .filter-controls select,
    .filter-controls input {
        width: 100%;
    }
    
    .order-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .order-details {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .order-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .machine-options {
        grid-template-columns: 1fr;
    }
    
    .configurator-steps {
        flex-direction: column;
        gap: 1rem;
    }
    
    .step {
        flex-direction: row;
        width: 100%;
        justify-content: flex-start;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .configuration-actions {
        flex-direction: column;
    }
}

/* RTL Support */
.rtl .customer-portal {
    direction: rtl;
}

.rtl .stats-grid {
    direction: rtl;
}

.rtl .order-item {
    flex-direction: row-reverse;
}

.rtl .tab-header {
    flex-direction: row-reverse;
}

.rtl .filter-controls {
    flex-direction: row-reverse;
}

.rtl .configurator-steps {
    flex-direction: row-reverse;
}

.rtl .step {
    flex-direction: row-reverse;
}

.rtl .machine-options {
    direction: rtl;
}

.rtl .radio-group label,
.rtl .checkbox-group label {
    flex-direction: row-reverse;
}

.rtl .configurator-navigation {
    flex-direction: row-reverse;
}
