/* Main styles for customer portal */

:root {
  --primary-color: #0046BE;
  --secondary-color: #FF6B00;
  --background-color: #FFFFFF;
  --text-color: #333333;
  --light-gray: #f5f5f5;
  --medium-gray: #e0e0e0;
  --dark-gray: #757575;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --border-radius: 8px;
  --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

/* Base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-color);
  background-color: var(--background-color);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin: -10px;
}

.col-md-4 {
  flex: 0 0 33.333333%;
  max-width: 33.333333%;
  padding: 10px;
}

@media (max-width: 768px) {
  .col-md-4 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin-bottom: 0.5rem;
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--secondary-color);
}

/* Buttons */
.btn {
  display: inline-block;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: var(--border-radius);
  transition: var(--transition);
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-primary {
  color: #fff;
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover:not(:disabled) {
  background-color: #003da7;
  border-color: #00389d;
}

.btn-outline-primary {
  color: var(--primary-color);
  background-color: transparent;
  border-color: var(--primary-color);
}

.btn-outline-primary:hover:not(:disabled) {
  color: #fff;
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

/* Header */
.portal-header {
  background-color: var(--primary-color);
  color: #fff;
  padding: 1rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.portal-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.portal-logo {
  display: flex;
  align-items: center;
}

.portal-logo img {
  height: 40px;
  max-width: 200px;
  object-fit: contain;
}

.portal-nav {
  display: flex;
  align-items: center;
}

.portal-nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.portal-nav-item {
  margin: 0 1rem;
}

.portal-nav-item a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
  transition: var(--transition);
}

.portal-nav-item a:hover,
.portal-nav-item.active a {
  color: #fff;
}

.portal-nav-item.active a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--secondary-color);
}

.portal-user {
  position: relative;
}

.portal-user-toggle {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.portal-user-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.portal-user-toggle img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-right: 0.5rem;
}

.portal-user-toggle i {
  margin-left: 0.5rem;
  font-size: 0.75rem;
}

.portal-user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 200px;
  background-color: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  display: none;
  z-index: 1000;
}

.portal-user-dropdown.show {
  display: block;
}

.portal-user-dropdown-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: var(--text-color);
  transition: var(--transition);
}

.portal-user-dropdown-item:hover {
  background-color: var(--light-gray);
}

.portal-user-dropdown-item i {
  margin-right: 0.5rem;
  width: 16px;
  text-align: center;
}

.portal-user-dropdown-divider {
  height: 1px;
  background-color: var(--medium-gray);
  margin: 0.5rem 0;
}

.portal-mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Mobile Menu */
.portal-mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #fff;
  z-index: 2000;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.portal-mobile-menu.show {
  transform: translateX(0);
}

.portal-mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--medium-gray);
}

.portal-mobile-logo {
  height: 40px;
}

.portal-mobile-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-color);
}

.portal-mobile-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.portal-mobile-nav-item {
  border-bottom: 1px solid var(--light-gray);
}

.portal-mobile-nav-item a {
  display: block;
  padding: 1rem;
  color: var(--text-color);
  font-weight: 500;
}

.portal-mobile-nav-item.active a {
  color: var(--primary-color);
  background-color: var(--light-gray);
}

.portal-mobile-nav-divider {
  height: 10px;
  background-color: var(--light-gray);
}

.no-scroll {
  overflow: hidden;
}

/* Main Content */
.portal-main {
  padding: 2rem 0;
  min-height: calc(100vh - 72px - 300px); /* Subtract header and footer height */
}

/* Welcome Section */
.welcome-section {
  background-color: var(--light-gray);
  border-radius: var(--border-radius);
  padding: 2rem;
  margin-bottom: 2rem;
  text-align: center;
}

.welcome-section h1 {
  margin-bottom: 1rem;
}

.welcome-section p {
  font-size: 1.25rem;
  color: var(--dark-gray);
  max-width: 800px;
  margin: 0 auto;
}

/* Points Summary */
.points-summary {
  margin-bottom: 2rem;
}

.points-card {
  background-color: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  height: 100%;
}

.points-card-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-right: 1rem;
  flex-shrink: 0;
}

.points-card-content {
  flex-grow: 1;
}

.points-card-content h2 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.points-card-content p {
  color: var(--dark-gray);
  margin-bottom: 0;
}

/* Section Headers */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-header h2 {
  margin-bottom: 0;
}

.view-all {
  font-weight: 500;
}

.view-all i {
  margin-left: 0.25rem;
}

/* Recent Activity */
.recent-activity {
  margin-bottom: 2rem;
}

.activity-list {
  background-color: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
}

.activity-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--light-gray);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  margin-right: 1rem;
  flex-shrink: 0;
}

.activity-icon.earned {
  background-color: rgba(40, 167, 69, 0.1);
  color: var(--success-color);
}

.activity-icon.redeemed {
  background-color: rgba(220, 53, 69, 0.1);
  color: var(--danger-color);
}

.activity-icon.expired {
  background-color: rgba(255, 193, 7, 0.1);
  color: var(--warning-color);
}

.activity-icon.referral {
  background-color: rgba(23, 162, 184, 0.1);
  color: var(--info-color);
}

.activity-content {
  flex-grow: 1;
}

.activity-content h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.activity-content p {
  color: var(--dark-gray);
  margin-bottom: 0;
  font-size: 0.875rem;
}

.activity-date {
  color: var(--dark-gray);
  font-size: 0.875rem;
  margin-left: 1rem;
  flex-shrink: 0;
}

/* Available Rewards */
.available-rewards {
  margin-bottom: 2rem;
}

.rewards-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.reward-card {
  background-color: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 1.5rem;
  position: relative;
  border: 2px solid transparent;
  transition: var(--transition);
}

.reward-card:hover {
  border-color: var(--secondary-color);
}

.reward-points {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background-color: var(--secondary-color);
  color: #fff;
  padding: 0.25rem 0.5rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
}

.reward-content {
  margin-bottom: 1rem;
}

.reward-content h3 {
  margin-bottom: 0.5rem;
  padding-right: 80px; /* Make room for points badge */
}

.reward-content p {
  color: var(--dark-gray);
  margin-bottom: 0;
}

.reward-btn {
  width: 100%;
}

/* Refer a Friend */
.refer-friend {
  background-color: var(--light-gray);
  border-radius: var(--border-radius);
  padding: 2rem;
  margin-bottom: 2rem;
}

.refer-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.refer-text {
  flex: 1;
  min-width: 300px;
  margin-right: 2rem;
  margin-bottom: 1rem;
}

.refer-code {
  background-color: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 1.5rem;
  min-width: 300px;
  margin-bottom: 1rem;
}

.refer-code-label {
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.refer-code-value {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.refer-actions {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

/* Footer */
.portal-footer {
  background-color: #f8f9fa;
  padding: 3rem 0 1.5rem;
  border-top: 1px solid var(--medium-gray);
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.footer-logo {
  flex: 0 0 200px;
  margin-right: 2rem;
  margin-bottom: 1.5rem;
}

.footer-logo img {
  max-width: 150px;
  height: auto;
}

.footer-links {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
}

.footer-links-column {
  flex: 1;
  min-width: 200px;
  margin-bottom: 1.5rem;
}

.footer-links-column h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.footer-links-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links-column ul li {
  margin-bottom: 0.5rem;
}

.footer-links-column ul li i {
  width: 20px;
  margin-right: 0.5rem;
  color: var(--primary-color);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--medium-gray);
}

.footer-copyright {
  margin-bottom: 1rem;
}

.footer-social {
  display: flex;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--light-gray);
  color: var(--dark-gray);
  margin-left: 0.5rem;
  transition: var(--transition);
}

.social-icon:hover {
  background-color: var(--primary-color);
  color: #fff;
}

/* Empty States */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
  color: var(--dark-gray);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
}

.toast {
  width: 350px;
  background-color: #fff;
  border-radius: var(--border-radius);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  margin-bottom: 10px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  overflow: hidden;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-header {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  color: #fff;
}

.toast-header i {
  margin-right: 0.5rem;
}

.toast-header strong {
  flex-grow: 1;
}

.toast-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: inherit;
  opacity: 0.8;
}

.toast-close:hover {
  opacity: 1;
}

.toast-body {
  padding: 1rem;
}

.bg-success {
  background-color: var(--success-color);
}

.bg-danger {
  background-color: var(--danger-color);
}

.bg-warning {
  background-color: var(--warning-color);
}

.bg-primary {
  background-color: var(--primary-color);
}

/* Responsive Styles */
@media (max-width: 992px) {
  .portal-nav {
    display: none;
  }
  
  .portal-mobile-toggle {
    display: block;
  }
  
  .refer-content {
    flex-direction: column;
    align-items: stretch;
  }
  
  .refer-text {
    margin-right: 0;
  }
}

@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
  }
  
  .footer-logo {
    margin-right: 0;
    text-align: center;
  }
  
  .footer-bottom {
    flex-direction: column;
  }
  
  .footer-social {
    margin-top: 1rem;
  }
  
  .rewards-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  .portal-user span {
    display: none;
  }
  
  .portal-user-toggle i {
    display: none;
  }
  
  .welcome-section h1 {
    font-size: 1.75rem;
  }
  
  .welcome-section p {
    font-size: 1rem;
  }
  
  .points-card {
    flex-direction: column;
    text-align: center;
  }
  
  .points-card-icon {
    margin-right: 0;
    margin-bottom: 1rem;
  }
  
  .activity-date {
    display: none;
  }
  
  .toast {
    width: calc(100% - 40px);
  }
}
