/* ============================================
   PROFILE PAGE STYLES
   ============================================ */

/* User Menu in Header */
.user-menu {
  position: relative;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-lg);
  transition: background var(--transition-fast);
}

.user-menu-btn:hover {
  background: var(--bg-secondary);
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 600;
}

.user-name {
  font-weight: 500;
  color: var(--text-primary);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  padding: var(--space-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-fast);
  z-index: var(--z-dropdown);
}

.user-menu.active .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.dropdown-item.active {
  background: var(--primary);
  color: var(--white);
}

/* Profile Layout */
.profile-main {
  padding: var(--space-8) 0;
  min-height: calc(100vh - 70px);
  background: var(--bg-secondary);
}

.profile-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-8);
  align-items: start;
}

@media (max-width: 968px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }
}

/* Profile Sidebar */
.profile-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.profile-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.profile-avatar-large {
  width: 80px;
  height: 80px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
  font-weight: 600;
  margin: 0 auto var(--space-4);
}

.profile-name {
  font-size: var(--text-xl);
  margin-bottom: var(--space-1);
}

.profile-email {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}

.profile-nav {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--space-2);
  box-shadow: var(--shadow-sm);
}

.profile-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.profile-nav-item:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.profile-nav-item.active {
  background: var(--primary);
  color: var(--white);
}

/* Profile Content */
.profile-content {
  min-height: 500px;
}

.profile-section {
  display: none;
}

.profile-section.active {
  display: block;
}

.section-header {
  margin-bottom: var(--space-8);
}

.section-header h1 {
  font-size: var(--text-2xl);
  color: var(--primary);
  margin-bottom: var(--space-2);
}

.section-header p {
  color: var(--text-secondary);
}

/* Orders List */
.orders-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.order-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.order-info h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-1);
}

.order-date {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.order-status {
  text-align: right;
}

.order-status .badge {
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-4);
}

.order-amount {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--primary);
  margin-top: var(--space-2);
}

/* Order Timeline */
.order-timeline {
  display: flex;
  align-items: center;
  gap: 0;
  margin: var(--space-6) 0;
  padding: 0 var(--space-4);
}

.timeline-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.timeline-step::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 50%;
  right: -50%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.timeline-step:last-child::before {
  display: none;
}

.timeline-step.completed::before {
  background: var(--success);
}

.timeline-step.active::before {
  background: linear-gradient(90deg, var(--success) 50%, var(--border) 50%);
}

.timeline-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  position: relative;
  z-index: 1;
}

.timeline-step.completed .timeline-dot {
  background: var(--success);
  border-color: var(--success);
  color: var(--white);
}

.timeline-step.active .timeline-dot {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
  animation: pulse 2s infinite;
}

.timeline-step.cancelled .timeline-dot {
  background: var(--error);
  border-color: var(--error);
  color: var(--white);
}

.timeline-label {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
}

.timeline-step.completed .timeline-label,
.timeline-step.active .timeline-label {
  color: var(--text-primary);
  font-weight: 500;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(30, 58, 95, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(30, 58, 95, 0); }
  100% { box-shadow: 0 0 0 0 rgba(30, 58, 95, 0); }
}

.order-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* Order Empty State */
.orders-empty {
  text-align: center;
  padding: var(--space-16);
  background: var(--white);
  border-radius: var(--radius-xl);
}

.orders-empty svg {
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.orders-empty h3 {
  margin-bottom: var(--space-2);
}

.orders-empty p {
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}

/* Settings Form */
.settings-form {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-actions {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
}

/* Modal Order Detail */
.order-detail-items {
  margin-bottom: var(--space-6);
}

.order-detail-item {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
}

.order-detail-item:last-child {
  border-bottom: none;
}

.order-item-image {
  width: 60px;
  height: 60px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.order-item-info {
  flex: 1;
}

.order-item-name {
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.order-item-variant {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.order-item-personalization {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  margin-top: var(--space-2);
}

.order-item-price {
  text-align: right;
}

.order-item-price .price {
  font-weight: 600;
  color: var(--primary);
}

.order-item-price .qty {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.order-detail-summary {
  background: var(--bg-secondary);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2) 0;
}

.summary-row.total {
  border-top: 1px solid var(--border);
  margin-top: var(--space-2);
  padding-top: var(--space-3);
  font-weight: 600;
  font-size: var(--text-lg);
}

@media (max-width: 768px) {
  .order-timeline {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    padding: 0;
  }
  
  .timeline-step {
    flex-direction: row;
    width: 100%;
    gap: var(--space-3);
  }
  
  .timeline-step::before {
    top: 32px;
    left: 16px;
    right: auto;
    width: 2px;
    height: calc(100% + var(--space-4));
  }
  
  .timeline-label {
    margin-top: 0;
    text-align: left;
  }
}
