/* Google Fonts */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&family=Open+Sans:wght@400;500&display=swap");

/* Global Variables */
:root {
  --primary: #4caf50;
  --primary-light: #d8f5d9;
  --primary-dark: #388e3c;
  --secondary: #8bc34a;
  --dark: #1e5631;
  --light: #f1f8e9;
  --text: #333;
  --text-light: #777;
  --white: #fff;
  --gray: #f5f5f5;
  --gray-dark: #e0e0e0;
  --error: #e74c3c;
  --success: #2ecc71;
  --warning: #f39c12;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition: all 0.3s ease;
}

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

body {
  font-family: "Open Sans", sans-serif;
  color: var(--text);
  line-height: 1.6;
  background-color: var(--gray);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  color: var(--dark);
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

/* Header Styles */
.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 5%;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo img {
  height: 80px;
  width: auto;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 25px;
}

nav a {
  font-weight: 500;
  font-size: 1.1rem;
  transition: var(--transition);
  padding: 5px 0;
  position: relative;
}

nav a:hover {
  color: var(--primary);
}

nav a.active {
  color: var(--primary-dark);
  font-weight: 600;
}

nav a.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary);
}

.header-icons {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-icons a {
  color: var(--text);
  font-size: 1.3rem;
  transition: var(--transition);
  position: relative;
}

.header-icons a:hover {
  color: var(--primary);
  transform: translateY(-2px);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 2rem;
  height: 2rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 200;
}

.menu-toggle span {
  width: 2rem;
  height: 0.25rem;
  background: var(--text);
  border-radius: 10px;
  transition: all 0.3s linear;
  position: relative;
  transform-origin: 1px;
}

/* Mobile Navigation Styles */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  nav {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background: var(--white);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 100;
    padding: 80px 20px 20px;
  }

  nav.active {
    right: 0;
  }

  nav ul {
    flex-direction: column;
    gap: 0;
  }

  nav li {
    margin-bottom: 15px;
  }

  nav a {
    display: block;
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
  }

  nav a:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
  }

  nav a.active {
    background: var(--primary);
    color: var(--white);
  }

  nav a.active::after {
    display: none;
  }
}

/* Prevent background scroll when menu open */
.no-scroll {
  overflow: hidden;
}

/* Animate hamburger into "X" */
.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -10px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* Profile Hero */
.profile-hero {
  background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
    url("../Images/footerBack.jpg") center/cover no-repeat;
  color: var(--white);
  text-align: center;
  padding: 100px 20px;
  margin-bottom: 30px;
}

.profile-hero .container {
  max-width: 800px;
  margin: 0 auto;
}

.profile-hero h1 {
  font-size: 2.5rem;
  margin-bottom: 15px;
  color: var(--white);
}

.profile-hero p {
  font-size: 1.2rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* Profile Container */
.profile-container {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 40px;
  gap: 30px;
}

.profile-sidebar {
  flex: 0 0 300px;
}

.profile-content {
  flex: 1;
  min-width: 0;
}

/* Profile Card */
.profile-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 25px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  text-align: center;
  position: relative;
  transition: var(--transition);
}

.profile-card:hover {
  box-shadow: var(--shadow-md);
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 15px;
  border: 3px solid var(--primary);
  position: relative;
  transition: var(--transition);
}

.profile-avatar:hover {
  transform: scale(1.05);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-edit-btn {
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.avatar-edit-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.1);
}

.profile-info h3 {
  margin: 0 0 5px;
  font-size: 1.3rem;
  color: var(--dark);
}

.profile-info p {
  margin: 0 0 15px;
  color: var(--text-light);
  font-size: 0.95rem;
}

.profile-meta {
  font-size: 0.85rem;
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 15px;
}

.profile-meta i {
  margin-right: 8px;
  color: var(--primary);
}

/* Profile Menu */
.profile-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.profile-menu li {
  margin-bottom: 8px;
}

.profile-menu a {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  font-weight: 500;
}

.profile-menu a i {
  margin-right: 12px;
  width: 20px;
  text-align: center;
  color: var(--text-light);
  transition: var(--transition);
}

.profile-menu a:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.profile-menu a:hover i {
  color: var(--primary-dark);
}

.profile-menu li.active a {
  background: var(--primary);
  color: var(--white);
}

.profile-menu li.active a i {
  color: var(--white);
}

/* Profile Sections */
.profile-section {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 25px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  transition: var(--transition);
}

.profile-section:hover {
  box-shadow: var(--shadow-md);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 15px;
}

.section-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--dark);
}

.section-actions {
  display: flex;
  gap: 10px;
}

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

.order-card {
  background: var(--white);
  border: 1px solid var(--gray-dark);
  border-radius: var(--radius-sm);
  padding: 18px;
  transition: var(--transition);
  cursor: pointer;
}

.order-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

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

.order-id {
  font-weight: 600;
  color: var(--dark);
  font-size: 1rem;
}

.order-date {
  color: var(--text-light);
  font-size: 0.9rem;
}

.order-status {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 12px;
}

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

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

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

.status-cancelled {
  background: #f8d7da;
  color: #721c24;
}

.order-summary {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
}

.order-items {
  color: var(--text-light);
  font-size: 0.9rem;
}

.order-total {
  font-weight: 600;
  color: var(--dark);
}

/* Form Styles */
.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.form-row .form-group {
  flex: 1;
}

.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--gray-dark);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
  background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.form-note {
  display: block;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 8px;
  font-style: italic;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 30px;
  gap: 15px;
}

/* Address Cards */
.addresses-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 15px;
}

.address-card {
  background: var(--white);
  border: 1px solid var(--gray-dark);
  border-radius: var(--radius-sm);
  padding: 18px;
  transition: var(--transition);
}

.address-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

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

.address-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--dark);
}

.address-tag {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.address-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

/* Notification Settings */
.notification-settings {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-dark);
  transition: var(--transition);
}

.setting-item:hover {
  border-color: var(--primary);
}

.setting-info h3 {
  margin: 0 0 5px;
  font-size: 1rem;
  color: var(--dark);
}

.setting-info p {
  margin: 0;
  color: var(--text-light);
  font-size: 0.9rem;
}

/* Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: var(--transition);
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: var(--transition);
}

input:checked + .slider {
  background-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  border: 1px solid transparent;
  font-size: 0.95rem;
  white-space: nowrap;
}

.btn i {
  font-size: 0.9em;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

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

.btn-outline:hover {
  background: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 30px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: modalFadeIn 0.3s ease-out;
}

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

.close-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  transition: var(--transition);
  background: none;
  border: none;
}

.close-modal:hover {
  color: var(--text);
  transform: rotate(90deg);
}

.order-details h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: var(--dark);
}

.order-items-list {
  margin: 20px 0;
  border-top: 1px solid var(--gray-dark);
  padding-top: 15px;
}

.order-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-dark);
}

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

.order-totals {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-dark);
}

.order-total-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.order-total-row.total {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--dark);
}

.shipping-info,
.payment-info {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-dark);
}

.shipping-info h4,
.payment-info h4 {
  margin-bottom: 10px;
}

/* Checkbox Styles */
.checkbox-container {
  display: block;
  position: relative;
  padding-left: 30px;
  margin-bottom: 15px;
  cursor: pointer;
  font-size: 0.95rem;
  user-select: none;
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 20px;
  width: 20px;
  background-color: var(--white);
  border: 1px solid var(--gray-dark);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.checkbox-container:hover input ~ .checkmark {
  border-color: var(--primary);
}

.checkbox-container input:checked ~ .checkmark {
  background-color: var(--primary);
  border-color: var(--primary);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
  display: block;
}

.checkbox-container .checkmark:after {
  left: 7px;
  top: 3px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Loading States */
.loading-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}

.loading-state i {
  font-size: 2rem;
  margin-bottom: 15px;
  color: var(--primary);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-state p {
  margin: 0;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}

.empty-state i {
  font-size: 2rem;
  margin-bottom: 15px;
  color: var(--primary);
}

.empty-state p {
  margin: 0 0 20px;
}

.error-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--error);
}

.error-state i {
  font-size: 2rem;
  margin-bottom: 15px;
}

.error-state p {
  margin: 0;
}

/* Footer Styles */
.footer-with-bg {
  position: relative;
  padding: 3rem 5% 1rem;
  color: #f5deb3;
  background-color: #1a1a1a;
  overflow: hidden;
}

.footer-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.footer-section {
  margin-bottom: 2rem;
}

.footer-section h3 {
  color: #f8f1e7;
  font-size: 1.2rem;
  margin-bottom: 1rem;
  font-family: "Poppins", sans-serif;
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: #f5deb3;
  text-decoration: none;
  transition: color 0.3s;
  font-size: 0.95rem;
}

.footer-section a:hover {
  color: var(--primary);
}

.social-icons {
  display: flex;
  gap: 1rem;
  font-size: 1.5rem;
  margin: 1rem 0;
}

.social-icons a {
  color: #f5deb3;
  transition: color 0.3s;
}

.social-icons a:hover {
  color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid rgba(245, 222, 179, 0.2);
  padding-top: 1.5rem;
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.footer-bottom p {
  margin: 0;
}

.footer-bottom ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
}

.footer-bottom a {
  color: #f5deb3;
  text-decoration: none;
}

/* Responsive Styles */
@media (max-width: 992px) {
  .profile-container {
    flex-direction: column;
  }

  .profile-sidebar {
    flex: 1;
    margin-bottom: 30px;
  }

  .profile-hero {
    padding: 80px 20px;
  }

  .profile-hero h1 {
    font-size: 2.2rem;
  }

  .profile-card {
    display: flex;
    align-items: center;
    gap: 20px;
    text-align: left;
  }

  .profile-avatar {
    margin: 0;
    flex-shrink: 0;
  }

  .profile-info {
    flex: 1;
  }
}

@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .addresses-list {
    grid-template-columns: 1fr;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-actions {
    width: 100%;
    justify-content: flex-end;
  }

  nav ul {
    gap: 15px;
  }

  .header-icons {
    gap: 15px;
  }
}

@media (max-width: 576px) {
  .profile-hero {
    padding: 60px 15px;
  }

  .profile-hero h1 {
    font-size: 1.8rem;
  }

  .profile-hero p {
    font-size: 1rem;
  }

  .profile-card {
    flex-direction: column;
    text-align: center;
  }

  .profile-avatar {
    margin: 0 auto 15px;
  }

  .modal-content {
    padding: 20px;
  }
}

/* Toast Notifications */
.toast-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--dark);
  color: white;
  padding: 15px 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 3000;
  transform: translateY(100px);
  opacity: 0;
  transition: var(--transition);
}

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

.toast-notification.success {
  background: var(--success);
}

.toast-notification.error {
  background: var(--error);
}

.toast-notification.warning {
  background: var(--warning);
}

/* Order Cancellation Styles */
.btn-cancel-order {
  background-color: #ffebee;
  color: #c62828;
  border: 1px solid #ef9a9a;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.3s;
  width: 100%;
}

.btn-cancel-order:hover {
  background-color: #ffcdd2;
}

.btn-cancel-order i {
  margin-right: 5px;
}

.btn-cancel-order-details {
  background-color: #ffebee;
  color: #c62828;
  border: 1px solid #ef9a9a;
  padding: 10px 15px;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 20px;
  transition: all 0.3s;
  width: 100%;
}

.btn-cancel-order-details:hover {
  background-color: #ffcdd2;
}

.status-cancelled {
  background-color: #ffebee;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

.order-actions {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}
