/* ===========================
   MAIN CONTAINER
   =========================== */
.profile-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--gray-50);
}

/* ===========================
   HEADER
   =========================== */
.profile-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  height: 70px;
  display: flex;
  align-items: center; 
}

.header-content {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#profileHeaderUsr {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===========================
   MAIN LAYOUT
   =========================== */
.main-layout {
  flex: 1;
  max-width: 1400px;
  margin: 70px auto 0;
  padding: 1rem;
  width: 100%;
}

/* Tablet and up */
@media (min-width: 768px) {
  .main-layout {
    padding: 1.5rem;
  }
  
  #profileHeaderUsr {
    font-size: 1.25rem;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .main-layout {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    min-height: calc(100vh - 70px);
  }
  
  #profileHeaderUsr {
    font-size: 1.5rem;
  }
}

/* ===========================
   DESKTOP SIDEBAR (LEFT SIDE)
   =========================== */
.sidebar-desktop {
  display: none;
}

@media (min-width: 1024px) {
  .sidebar-desktop {
    display: flex;
    flex-direction: column;
    width: 280px;
    flex-shrink: 0;
    background: var(--white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    align-self: flex-start;
    position: sticky;
    top: 90px;
    height: calc(100vh - 110px);
  }
  
  .desktop-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
  }
  
  .sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
  }
}

/* ===========================
   CONTENT WRAPPER (RIGHT SIDE)
   =========================== */
.content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .content-wrapper {
    flex-direction: column;
  }
}

/* ===========================
   PROFILE CARD COLUMN (TOP RIGHT)
   =========================== */
.profile-card-column {
  width: 100%;
}

@media (min-width: 1024px) {
  .profile-card-column {
    width: 100%;
  }
}

.profile-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
  padding: 2rem;
  text-align: center;
  transition: var(--transition);
}

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

.profile-picture-container {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 1.5rem;
}

.profile-picture {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 5px solid var(--white);
  box-shadow: var(--shadow-xl);
  background: var(--gray-100);
  display: block;
}

.profile-username {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0 0 2rem;
}

/* ===========================
   PROFILE STATS (INSIDE CARD)
   =========================== */
.profile-stats {
  width: 100%;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

.stats-item {
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  padding: 1rem;
  text-align: center;
  border: 1px solid var(--gray-200);
  transition: var(--transition);
  cursor: pointer;
}

.stats-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.stats-item i {
  width: 40px;
  height: 40px;
  background: var(--primary-light);
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
  transition: var(--transition);
}

.stats-item:hover i {
  background: var(--primary);
  color: white;
  transform: scale(1.1);
}

.stats-item p {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin: 0 0 0.25rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stats-item h3 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
  line-height: 1;
}

@media (min-width: 1024px) {
  .stats-item {
    padding: 1rem;
  }
  
  .stats-item i {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }
  
  .stats-item h3 {
    font-size: 1.5rem;
  }
}

/* ===========================
   TAB CONTENT AREA (BELOW PROFILE CARD)
   =========================== */
.tab-content-area {
  flex: 1;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  padding: 1.5rem;
}

@media (min-width: 768px) {
  .tab-content-area {
    padding: 2rem;
  }
}

/* ===========================
   TAB NAVIGATION
   =========================== */

.tabs {
  display: flex;
  gap: 0.5rem;
  background: var(--gray-50);
  padding: 0.5rem;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow-x: auto;
}

.tab-btn {
  flex: 1;
  min-width: fit-content;
  padding: 0.875rem 1.25rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-lg);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.tab-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-md);
}

/* ===========================
   MOBILE PROFILE VIEW
   =========================== */
.mobile-profile-view {
  width: 100%;
}

@media (min-width: 1024px) {
  .mobile-profile-view {
    display: none;
  }
}

/* Mobile specific styles */
.profile-hero {
  margin-bottom: 1.5rem;
}

.profile-info-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
  padding: 1.5rem;
  text-align: center;
}

.profile-stats-section {
  margin-bottom: 1.5rem;
}

.profile-stats-section .stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 640px) {
  .profile-stats-section .stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ===========================
   MOBILE MENU ICON
   =========================== */
.menu-icon {
  display: flex;
  width: 44px;
  height: 44px;
  background: var(--primary);
  border-radius: var(--radius-full);
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 10px;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

@media (min-width: 1024px) {
  .menu-icon {
    display: none;
  }
}

.menu-icon:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

.menu-icon div {
  width: 20px;
  height: 2.5px;
  background: white;
  border-radius: 2px;
  transition: var(--transition);
}

/* ===========================
   QUICK FIXES
   =========================== */

/* Fix for desktop sidebar position */
@media (min-width: 1024px) {
  .sidebar-desktop {
    margin-top: 0;
    position: sticky;
    top: 90px;
  }
  
  .main-layout {
    align-items: flex-start;
  }
}

/* Fix for profile card on desktop */
@media (min-width: 1024px) {
  .profile-card-column {
    margin-top: 0;
  }
  
  .profile-card {
    position: sticky;
    top: 90px;
  }
}

/* Ensure content area takes full height */
.content-wrapper {
  min-height: calc(100vh - 160px);
}

/* Fix for tab navigation sticking */
@media (min-width: 1024px) {
  .tab-navigation {
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 40;
    padding: 1rem 0;
    margin: -1.5rem -2rem 1.5rem;
    padding-left: 2rem;
    padding-right: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  }
}

/* Mobile fixes */
@media (max-width: 1023px) {
  .mobile-profile-view {
    width: 100%;
  }
  
  .profile-hero {
    margin-top: 1rem;
  }
}
/* ===========================
   BANK BUTTON CONTAINER
   =========================== */
.bank-button-container {
  margin: 1.5rem 1rem;
  width: calc(100% - 2rem);
}

@media (min-width: 768px) {
  .bank-button-container {
    margin: 1.5rem;
    width: calc(100% - 3rem);
  }
}

@media (min-width: 1024px) {
  .bank-button-container {
    margin: 1.5rem 0;
    width: 100%;
  }
}

/* ===========================
   MAIN CONTAINER
   =========================== */
.profile-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--gray-50);
}

/* ===========================
   HEADER
   =========================== */
.profile-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  height: 70px;
  display: flex;
  align-items: center;
  width: 100%;
}

.header-content {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#profileHeaderUsr {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===========================
   MAIN LAYOUT
   =========================== */
.main-layout {
  flex: 1;
  width: 100%;
  margin: 70px auto 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* Tablet and up */
@media (min-width: 768px) {
  .main-layout {
    padding: 1.5rem;
    max-width: 1400px;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .main-layout {
    flex-direction: row;
    gap: 2rem;
    padding: 1.5rem 2rem;
    min-height: calc(100vh - 70px);
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ===========================
   DESKTOP SIDEBAR
   =========================== */
.sidebar-desktop {
  display: none;
}

@media (min-width: 1024px) {
  .sidebar-desktop {
    display: flex;
    flex-direction: column;
    width: 280px;
    flex-shrink: 0;
    background: var(--white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    align-self: flex-start;
    position: sticky;
    top: 90px;
    height: calc(100vh - 110px);
  }
  
  .desktop-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
  }
  
  .sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
  }
}

/* ===========================
   CONTENT AREA
   =========================== */
.content-area {
  flex: 1;
  width: 100%;
}

@media (min-width: 1024px) {
  .content-area {
    width: calc(100% - 280px - 2rem);
  }
}

/* ===========================
   PROFILE HERO SECTION (Mobile Edge-to-Edge)
   =========================== */
.profile-hero {
  margin-bottom: 1.5rem;
  width: 100%;
}

.profile-info-card {
  background: var(--white);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  padding: 1.5rem;
  text-align: center;
  transition: var(--transition);
  width: 100%;
  border-radius: 0;
}

/* Add border radius from tablet up */
@media (min-width: 768px) {
  .profile-info-card {
    border-radius: var(--radius-xl);
  }
}

/* ===========================
   STATS SECTION (Mobile Edge-to-Edge)
   =========================== */
.profile-stats-section {
  margin-bottom: 1.5rem;
  width: 100%;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .profile-stats-section {
    padding: 0;
  }
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  width: 100%;
}

@media (min-width: 640px) {
  .stats {
    gap: 1rem;
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ===========================
   BANK BUTTON CONTAINER
   =========================== */
.bank-button-container {
  margin: 1.5rem 1rem;
  width: calc(100% - 2rem);
}

@media (min-width: 768px) {
  .bank-button-container {
    margin: 1.5rem;
    width: calc(100% - 3rem);
  }
}

@media (min-width: 1024px) {
  .bank-button-container {
    margin: 1.5rem 0;
    width: 100%;
  }
}

/* ===========================
   TAB NAVIGATION
   =========================== */
.tab-navigation {
  margin: 1.2rem 1rem;
  position: sticky;
  top: 70px;
  z-index: 50;
  background: var(--gray-50);
  padding: 0.2rem 0;
  width: calc(100% - 2rem);
}

@media (min-width: 768px) {
  .tab-navigation {
    margin: 1.5rem;
    width: calc(100% - 3rem);
    top: 70px;
    padding: 0.75rem 0;
  }
}

@media (min-width: 1024px) {
  .tab-navigation {
    position: static;
    background: transparent;
    padding: 0;
    margin: 1.5rem 0;
    width: 100%;
  }
}

/* ===========================
   TAB CONTENT SECTION
   =========================== */
.tab-content-section {
  width: 100%;
  padding: 0 1rem;
  margin-bottom: 80px;
}

@media (min-width: 768px) {
  .tab-content-section {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .tab-content-section {
    padding: 0;
    margin-bottom: 2rem;
  }
}

/* ===========================
   MOBILE MENU ICON
   =========================== */
.menu-icon {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 10px;
  z-index: 101;
  transition: var(--transition);
}

@media (min-width: 1024px) {
  .menu-icon {
    display: none;
  }
}

.menu-icon:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

.menu-icon div {
  width: 20px;
  height: 2.5px;
  background: white;
  border-radius: 2px;
  transition: var(--transition);
}

/* ===========================
   DARK MODE SUPPORT
   =========================== */
@media (prefers-color-scheme: dark) {
  .profile-container {
    background: #0f0f0f;
  }

  .main-layout {
    background: #0f0f0f;
  }

  .sidebar-desktop {
    background: #1a1a1a;
    border-right-color: #2d2d2d;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
  }

  .desktop-sidebar-nav {
    background: #1a1a1a;
  }

  .sidebar-section-title {
    color: #b3b3b3;
  }

  .sidebar-nav a {
    color: #d4d4d4;
    border-left-color: transparent;
  }

  .sidebar-nav a:hover {
    background: #2d2d2d;
    color: #28a745;
    border-left-color: #28a745;
  }

  .sidebar-nav a.active {
    background: linear-gradient(90deg, #28a745 0%, #1e7e34 100%);
    color: white;
    border-left-color: #28a745;
  }

  .content-area {
    background: #0f0f0f;
  }

  .navbar {
    background: #1a1a1a;
    border-top-color: #2d2d2d;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
  }

  .navbar a {
    color: #b3b3b3;
  }

  .navbar a:hover {
    color: #28a745;
  }

  .navbar a.active {
    color: #28a745;
    background: #2d2d2d;
  }

  .modern-sidebar {
    background: #1a1a1a;
    border-right-color: #2d2d2d;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.3);
  }

  .modern-sidebar-header {
    background: #1a1a1a;
    border-bottom-color: #2d2d2d;
  }

  .close-sidebar-btn {
    color: #d4d4d4;
  }

  .close-sidebar-btn:hover {
    background: #2d2d2d;
  }

  .sidebar-menu li a {
    color: #d4d4d4;
  }

  .sidebar-menu li a:hover {
    background: #2d2d2d;
    color: #28a745;
  }

  .sidebar-menu li a.active {
    background: linear-gradient(90deg, #28a745 0%, #1e7e34 100%);
    color: white;
  }

  .sidebar-logout {
    color: #ef4444;
    border-top-color: #2d2d2d;
  }

  .sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.1);
  }
}