/* ============================================
   Profile Page Styles
   ============================================ */

/* Overlay */
.profile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    animation: profileFadeIn 0.15s ease;
}

.profile-overlay.open {
    display: flex;
}

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

/* Panel */
.profile-panel {
    background: #ffffff;
    width: 92%;
    max-width: 520px;
    max-height: 90vh;
    border-radius: 20px;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
    animation: profileSlideUp 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: opacity, transform;
}

@keyframes profileSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.profile-close {
    position: absolute;
    top: 15px;
    right: 18px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #95a5a6;
    transition: all 0.3s ease;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-close:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.08);
    transform: rotate(90deg);
}

/* Profile Header */
.profile-header {
    background: linear-gradient(135deg, #2d6b5a 0%, #3b665b 50%, #1a3a32 100%);
    padding: 35px 25px 30px;
    text-align: center;
    border-radius: 20px 20px 0 0;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 3px solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.profile-header h2 {
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.profile-badge {
    display: inline-block;
    background: rgba(46, 204, 113, 0.25);
    color: #2ecc71;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.profile-joined {
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    margin-top: 10px;
}

/* Tabs */
.profile-tabs {
    display: flex;
    border-bottom: 2px solid #f0f0f0;
    padding: 0;
}

.profile-tab {
    flex: 1;
    padding: 14px 10px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: #95a5a6;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.profile-tab.active {
    color: #3b665b;
}

.profile-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 15%;
    width: 70%;
    height: 3px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border-radius: 3px;
}

.profile-tab:hover:not(.active) {
    color: #7f8c8d;
    background: #fafafa;
}

/* Tab Content */
.profile-tab-content {
    display: none;
    padding: 20px;
    animation: tabFadeIn 0.35s ease;
}

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

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

/* Orders Summary Cards */
.orders-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.summary-card {
    background: linear-gradient(135deg, #f8f9fa, #eef1f5);
    border-radius: 12px;
    padding: 15px 10px;
    text-align: center;
    border: 2px solid #e8ecf1;
    transition: transform 0.2s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.summary-card.active-filter {
    border-color: #3b665b;
    box-shadow: 0 4px 12px rgba(59, 102, 91, 0.15);
    background: #ffffff;
}

.summary-card.success-card {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-color: #bbf7d0;
}

.summary-card.success-card.active-filter {
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    background: #f0fdf4;
}

.summary-num {
    display: block;
    font-size: 26px;
    font-weight: 800;
    color: #2c3e50;
    line-height: 1.2;
}

.success-card .summary-num {
    color: #16a34a;
}

.summary-label {
    display: block;
    font-size: 11px;
    color: #95a5a6;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Order List */
.profile-order-list {
    max-height: none;
    overflow-y: visible;
}

.order-card {
    background: #fafbfc;
    border: 1px solid #eef1f5;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.order-card:hover {
    border-color: #d0d5dd;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.order-id-label {
    font-size: 14px;
    font-weight: 700;
    color: #3498db;
}

.order-status {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.order-status.pending {
    background: #fff7ed;
    color: #ea580c;
    border: 1px solid #fed7aa;
}

.order-status.confirmorder {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.order-status.ordered {
    background: #f5f3ff;
    color: #7c3aed;
    border: 1px solid #ddd6fe;
}

.order-status.inchina {
    background: #f0fdfa;
    color: #0d9488;
    border: 1px solid #99f6e4;
}

.order-status.arrivedkhmer {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.order-status.willbesend {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

.order-status.cancelled {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.order-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
}

.order-detail-row .label {
    color: #95a5a6;
    font-weight: 500;
}

.order-detail-row .value {
    color: #2c3e50;
    font-weight: 600;
    text-align: right;
    max-width: 60%;
}

.order-items-list {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e5e7eb;
}

.order-items-list .item-line {
    font-size: 12px;
    color: #6b7280;
    padding: 2px 0;
}

.order-items-list .item-line::before {
    content: '•';
    color: #3b665b;
    margin-right: 6px;
    font-weight: bold;
}

.no-orders-msg {
    text-align: center;
    padding: 40px 20px;
    color: #bdc3c7;
}

.no-orders-msg .no-orders-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

/* Settings Card */
.settings-card {
    background: #fafbfc;
    border: 1px solid #eef1f5;
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 16px;
}

.settings-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef1f5;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f5f6f7;
}

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

.info-label {
    color: #95a5a6;
    font-size: 13px;
    font-weight: 500;
}

.info-value {
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
}

/* Change Password Form */
.settings-input-group {
    margin-bottom: 14px;
}

.settings-input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #34495e;
    margin-bottom: 6px;
}

.settings-input-group input {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
    font-family: 'Inter', sans-serif;
}

.settings-input-group input:focus {
    outline: none;
    border-color: #3b665b;
    box-shadow: 0 0 0 3px rgba(59, 102, 91, 0.1);
}

.password-msg {
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    min-height: 18px;
    margin-bottom: 8px;
    border-radius: 8px;
    padding: 0;
    transition: all 0.3s ease;
}

.password-msg.error:not(:empty) {
    color: #dc2626;
    background: #fef2f2;
    padding: 8px 12px;
    border: 1px solid #fecaca;
}

.password-msg.success:not(:empty) {
    color: #16a34a;
    background: #f0fdf4;
    padding: 8px 12px;
    border: 1px solid #bbf7d0;
}

.change-pw-btn {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b665b, #2d6b5a);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 102, 91, 0.25);
    font-family: 'Inter', sans-serif;
}

.change-pw-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 102, 91, 0.35);
}

.change-pw-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Responsive */
@media (max-width: 768px) {
    .profile-panel {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }

    .profile-header {
        border-radius: 0;
        padding: 30px 20px 25px;
    }

    .orders-summary {
        gap: 8px;
    }

    .summary-card {
        padding: 12px 8px;
    }

    .summary-num {
        font-size: 22px;
    }

    .profile-order-list {
        max-height: none;
    }
}

/* ========================================= */
/* New Order Card Layout & Timeline Stepper  */
/* ========================================= */

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.order-id-label {
    font-size: 15px;
    font-weight: 700;
    color: #2563eb;
    background: #eff6ff;
    padding: 4px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.order-status-pill {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid transparent;
}

.order-status-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.order-detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 8px;
    color: #4b5563;
}

.order-detail-label {
    font-weight: 600;
    color: #9ca3af;
}

.order-detail-value {
    font-weight: 600;
    color: #1f2937;
    text-align: right;
}

.order-items-list {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #e5e7eb;
    font-size: 13px;
    color: #6b7280;
}

.order-items-list ul {
    list-style: none;
    padding: 0;
}

.order-items-list li {
    position: relative;
    padding-left: 12px;
    margin-bottom: 4px;
}

.order-items-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #3b665b;
}

/* Timeline Modal */
.timeline-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.timeline-content {
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 16px;
    padding: 25px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.timeline-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 20px;
    color: #9ca3af;
    cursor: pointer;
}

.timeline-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 20px;
    text-align: center;
}

/* Stepper */
.stepper {
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    padding-left: 10px;
}

.stepper::before {
    content: '';
    position: absolute;
    left: 21px; /* Center of the icon */
    top: 10px;
    bottom: 30px;
    width: 2px;
    background: #e5e7eb;
    z-index: 1;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    position: relative;
    z-index: 2;
}

.step-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    flex-shrink: 0;
    border: 3px solid white;
    transition: all 0.3s ease;
}

.step.completed .step-icon {
    background: #10b981;
}

.step.current .step-icon {
    background: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.step-content {
    flex-grow: 1;
    padding-top: 2px;
}

.step-title {
    font-weight: 700;
    font-size: 14px;
    color: #9ca3af;
}

.step.completed .step-title {
    color: #374151;
}

.step.current .step-title {
    color: #1d4ed8;
}

.step-time {
    font-size: 11px;
    color: #6b7280;
    margin-top: 3px;
    font-weight: 500;
}
