/* Premium Personal Finance Tracker - White/Black Theme */

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

html, body {
  height: 100%;
}

body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: #ffffff;
  color: #1a1a1a;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* App Container */
.app-container {
  display: flex;
  min-height: 100vh;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  position: relative;
}

/* Mobile Header - Only show on mobile */
.mobile-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid #e8e8e8;
  display: none; /* Hidden by default on desktop */
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.mobile-header.hidden {
  display: none !important;
}

.menu-toggle {
  background: none;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #1a1a1a;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-toggle:hover {
  background-color: #f5f5f5;
  transform: scale(1.05);
}

.menu-toggle:active {
  background-color: #ebebeb;
  transform: scale(0.95);
}

/* Mobile Overlay */
.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(4px);
}

.mobile-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Sidebar - Always visible on desktop */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-right: 1px solid #e8e8e8;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  box-shadow: 
    2px 0 16px rgba(0, 0, 0, 0.05),
    inset 1px 0 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* On desktop, sidebar is always visible */
@media (min-width: 769px) {
  .sidebar {
    transform: translateX(0) !important;
    position: fixed;
    left: 0;
  }
}

/* On mobile, sidebar is hidden by default */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
}

.sidebar-header {
  padding: 28px 24px;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.8);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 24px;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: -0.5px;
}

.sidebar-logo .material-icons {
  font-size: 32px;
  background: linear-gradient(135deg, #3a86ff, #6948ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-menu-toggle {
  display: none;
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  color: #1a1a1a;
  transition: all 0.2s ease;
}

.sidebar-menu-toggle:hover {
  background-color: #f5f5f5;
}

.nav-menu {
  flex: 1;
  padding: 32px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  margin: 0 12px;
  background: none;
  border: none;
  color: #666666;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #3a86ff, #6948ff);
  border-radius: 0 4px 4px 0;
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover {
  background-color: rgba(58, 134, 255, 0.08);
  color: #3a86ff;
  transform: translateX(4px);
}

.nav-item:hover::before {
  opacity: 1;
  transform: translateX(0);
}

.nav-item.active {
  color: #3a86ff;
  background: linear-gradient(135deg, rgba(58, 134, 255, 0.12), rgba(106, 76, 255, 0.08));
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(58, 134, 255, 0.1);
}

.nav-item.active::before {
  opacity: 1;
  transform: translateX(0);
}

.nav-item .material-icons {
  font-size: 22px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover .material-icons {
  transform: scale(1.1);
}

.nav-footer {
  padding: 24px;
  border-top: 1px solid #e8e8e8;
  background: rgba(255, 255, 255, 0.8);
}

/* Auth View */
.view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  width: 100%;
}

.md-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 48px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.08),
    0 2px 12px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(232, 232, 232, 0.8);
  max-width: 420px;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.md-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3a86ff, #6948ff, #ff6b8b);
  border-radius: 24px 24px 0 0;
}

.auth-container h1 {
  font-size: 32px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 40px;
  letter-spacing: -0.75px;
  text-align: center;
  position: relative;
}

.auth-container h1::after {
  content: '';
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #3a86ff, #6948ff);
  border-radius: 2px;
}

.auth-tabs {
  display: flex;
  background: #f8f9fa;
  border-radius: 14px;
  padding: 6px;
  margin-bottom: 32px;
  border: 1px solid #e8e8e8;
}

.auth-tab {
  flex: 1;
  padding: 14px 16px;
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 600;
  color: #666666;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.auth-tab::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(58, 134, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.auth-tab:hover::before {
  width: 200px;
  height: 200px;
}

.auth-tab.active {
  background: #ffffff;
  color: #3a86ff;
  box-shadow: 
    0 4px 16px rgba(58, 134, 255, 0.15),
    0 2px 8px rgba(58, 134, 255, 0.1);
}

.auth-tab.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: linear-gradient(90deg, #3a86ff, #6948ff);
  border-radius: 2px;
}

.md-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 28px;
  background: linear-gradient(135deg, #3a86ff, #6948ff);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  box-shadow: 
    0 4px 16px rgba(58, 134, 255, 0.25),
    0 2px 8px rgba(58, 134, 255, 0.15);
  position: relative;
  overflow: hidden;
}

.md-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.md-btn:hover::before {
  width: 300px;
  height: 300px;
}

.md-btn:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 8px 24px rgba(58, 134, 255, 0.35),
    0 4px 16px rgba(58, 134, 255, 0.2);
}

.md-btn:active {
  transform: translateY(0);
  box-shadow: 
    0 2px 8px rgba(58, 134, 255, 0.25),
    0 1px 4px rgba(58, 134, 255, 0.15);
}

.md-btn .material-icons {
  font-size: 20px;
}

.w-full {
  width: 100%;
}

/* Form Inputs */
.md-input-group {
  position: relative;
  margin-bottom: 28px;
}

.md-input {
  width: 100%;
  padding: 18px;
  font-size: 16px;
  background: #f8f9fa;
  border: 2px solid #e8e8e8;
  border-radius: 12px;
  color: #1a1a1a;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.md-input:focus {
  border-color: #3a86ff;
  background: #ffffff;
  box-shadow: 
    0 0 0 4px rgba(58, 134, 255, 0.1),
    inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.md-input:focus + .md-label,
.md-input:not(:placeholder-shown) + .md-label {
  transform: translateY(-30px) scale(0.85);
  color: #3a86ff;
  background: linear-gradient(to bottom, #ffffff, #f8f9fa);
  padding: 0 8px;
  font-weight: 600;
}

.md-label {
  position: absolute;
  left: 18px;
  top: 18px;
  color: #666666;
  font-size: 16px;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: left top;
  z-index: 1;
}
.content-area {
  /* flex: 1; */
  /* margin-left: 280px; */
  padding: 40px;
  min-height: 100vh;
  background: #ffffff;

  opacity: 0;
  transition:
    opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  width: 100%;
  box-sizing: border-box;
}

/* Responsive Design */
@media (max-width: 768px) {
  /* Show mobile header on mobile */
  .mobile-header {
    display: flex;
  }
  
  /* Hide sidebar menu toggle on desktop, show on mobile */
  .sidebar-menu-toggle {
    display: flex;
  }
  
  /* Adjust sidebar for mobile */
  .sidebar {
    width: 100%;
    max-width: 320px;
    transform: translateX(-100%);
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
  
  /* Adjust content area for mobile */
  .content-area {
    margin-left: 0;
    padding: 24px;
    padding-top: 84px; /* Mobile header height + padding */
    width: 100%;
    /* min-height: calc(100vh - 64px); */
  }
  
  .md-card {
    padding: 32px 24px;
    margin: 0;
  }
  
  .auth-container h1 {
    font-size: 28px;
    margin-bottom: 32px;
  }
  
  .auth-container h1::after {
    bottom: -12px;
  }
}

@media (min-width: 769px) {
  /* Ensure sidebar is always visible on desktop */
  .sidebar {
    transform: translateX(0) !important;
  }
  
  .mobile-header {
    display: none;
  }
  
  /* Hide the close button in sidebar header on desktop */
  .sidebar-menu-toggle {
    display: none;
  }
  
  /* Ensure content area has proper spacing */
  .content-area {
    margin-left: 280px;
    /* width: calc(100% - 280px); */
  }
}

@media (max-width: 480px) {
  .view {
    padding: 16px;
  }
  
  .md-card {
    padding: 28px 20px;
    border-radius: 20px;
  }
  
  .auth-container h1 {
    font-size: 24px;
  }
  
  .auth-tabs {
    padding: 4px;
  }
  
  .auth-tab {
    padding: 12px 14px;
    font-size: 14px;
  }
  
  .md-btn {
    padding: 14px 24px;
    font-size: 15px;
  }
  
  .content-area {
    padding: 20px 16px;
    padding-top: 80px;
  }
}

/* Loading Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Premium Enhancements */
.md-card {
  position: relative;
  overflow: hidden;
}

.md-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3a86ff, #6948ff, #ff6b8b);
  border-radius: 24px 24px 0 0;
}

/* Button States */
.md-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: 
    0 2px 4px rgba(58, 134, 255, 0.1) !important;
  background: linear-gradient(135deg, #94a3b8, #64748b) !important;
}

/* Focus States */
.menu-toggle:focus,
.auth-tab:focus,
.md-btn:focus,
.md-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(58, 134, 255, 0.25);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #f8f9fa;
  border-radius: 8px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #c1c1c1, #a8a8a8);
  border-radius: 8px;
  border: 2px solid #f8f9fa;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #a8a8a8, #8f8f8f);
}

/* Selection Color */
::selection {
  background-color: rgba(58, 134, 255, 0.2);
  color: #1a1a1a;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Ensure no horizontal scroll */
html {
  overflow-x: hidden;
}

/* Fix for content area height on mobile */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
  }
  
  .content-area {
    overflow-x: hidden;
  }
}