/* Base styles */
:root {
  --primary-color: #007bff;
  --secondary-color: #6c757d;
  --background-color: #ffffff;
  --text-color: #333333;
  --border-color: #dee2e6;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --error-color: #dc3545;
  --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition-speed: 0.3s;
}

/* Dark mode variables */
[class*='dark'] {
  --primary-color: #4dabf7;
  --secondary-color: #adb5bd;
  --background-color: #1a1a1a;
  --text-color: #ffffff;
  --border-color: #404040;
  --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.app {
  min-height: 100vh;
  background-color: var(--background-color);
  color: var(--text-color);
  transition: all var(--transition-speed) ease;
  animation: fadeIn 0.5s ease-in-out;
}

/* Theme toggle button */
.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
}

.theme-toggle button {
  background: none;
  border: 2px solid var(--border-color);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all var(--transition-speed) ease;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle button:hover {
  background-color: var(--border-color);
  transform: scale(1.1);
}

/* Enhanced input styling */
input, textarea {
  background-color: var(--background-color);
  color: var(--text-color);
  border: 2px solid var(--border-color);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin: 0.5rem 0;
  transition: all var(--transition-speed) ease;
  font-size: 1rem;
  width: 100%;
}

input:focus, textarea:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* Button styles */
button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  font-size: 1rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.5px;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

button:active {
  transform: translateY(0);
}

/* Container with animation */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  animation: slideIn 0.5s ease-out;
}

/* Enhanced card styling */
.card {
  background-color: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1rem 0;
  box-shadow: var(--card-shadow);
  transition: all var(--transition-speed) ease;
  animation: slideIn 0.5s ease-out;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Loading animation */
.loading {
  display: inline-block;
  width: 50px;
  height: 50px;
  border: 3px solid var(--border-color);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  button {
    width: 100%;
  }
  
  .theme-toggle {
    top: 0.5rem;
    right: 0.5rem;
  }
  
  .theme-toggle button {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
}

/* Utility classes */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.App {
  text-align: center;
}

.App-logo {
  height: 40vmin;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .App-logo {
    animation: App-logo-spin infinite 20s linear;
  }
}

.App-header {
  background-color: #282c34;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: calc(10px + 2vmin);
  color: white;
}

.App-link {
  color: #61dafb;
}

@keyframes App-logo-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Dashboard Layout */
.dashboard-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  padding: 16px;
  height: 100vh;
  max-width: 1800px;
  margin: 0 auto;
  overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
  position: sticky;
  top: 16px;
  height: calc(100vh - 32px);
  padding: 16px !important;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-title {
  margin-bottom: 24px !important;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-color);
  font-weight: 500 !important;
}

.sidebar-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Main Content Styles */
.main-content {
  height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 16px !important;
  background-color: var(--background-color) !important;
  border: 1px solid var(--border-color) !important;
}

.content-title {
  margin-bottom: 24px !important;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-color);
  font-weight: 500 !important;
}

.graphs-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  padding: 16px 0;
}

.graph-placeholder {
  aspect-ratio: 16/9;
  background-color: rgba(0, 0, 0, 0.04);
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  transition: all var(--transition-speed) ease;
}

[class*='dark'] .graph-placeholder {
  background-color: rgba(255, 255, 255, 0.04);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .dashboard-container {
    grid-template-columns: 250px 1fr;
    gap: 16px;
    padding: 16px;
  }
}

@media (max-width: 768px) {
  .dashboard-container {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .sidebar, .main-content {
    height: auto;
    position: relative;
  }

  .graph-image-container {
    min-height: 250px;
  }
}

/* Scrollbar Styling */
.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track {
  background: var(--background-color);
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

/* Animation for graph placeholders */
.graph-placeholder {
  animation: fadeIn 0.5s ease-out;
}

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

/* Contributors section */
.contributors {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.contributors-title {
  font-size: 0.875rem !important;
  color: var(--text-color);
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px !important;
}

.contributors-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contributors-list li {
  padding: 8px 0;
  font-size: 0.8rem;
  color: var(--text-color);
  opacity: 0.9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.contributor-email {
  opacity: 0.6;
  transition: opacity var(--transition-speed) ease !important;
  color: var(--text-color) !important;
}

.contributor-email:hover {
  opacity: 1;
}

.graphs-section {
  padding: 8px;
}

.graph-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.graph-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.graph-info {
  flex: 1;
}

.graph-title {
  font-size: 1rem !important;
  margin-bottom: 4px !important;
}

.graph-image-container {
  flex: 1;
  position: relative;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.04);
  border-radius: 8px;
  overflow: hidden;
}

.graph-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  padding: 8px;
}

/* Adjust heights for different graph sizes */
.graph-card:first-child .graph-image-container {
  min-height: 300px;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .dashboard-container {
    grid-template-columns: 240px 1fr;
  }
}

@media (max-width: 768px) {
  .dashboard-container {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .sidebar, .main-content {
    height: auto;
    position: relative;
  }

  .graph-image-container {
    min-height: 250px;
  }
}

.dashboard-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dashboard-controls .MuiFormControl-root {
  margin-bottom: 16px;
}

.dashboard-controls .MuiChip-root {
  transition: all 0.2s ease;
}

.dashboard-controls .MuiChip-root:hover {
  transform: translateY(-1px);
}

.dashboard-controls .MuiPaper-root {
  border: 1px solid var(--border-color);
}

.dashboard-controls .MuiDatePicker-root {
  width: 100%;
}

/* Date picker dark mode compatibility */
[class*='dark'] .MuiDatePicker-root {
  background-color: var(--background-color);
  color: var(--text-color);
}

/* Add to existing CSS */
.page-transition-enter {
  opacity: 0;
  transform: translateY(20px);
}

.page-transition-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 300ms, transform 300ms;
}

.page-transition-exit {
  opacity: 1;
  transform: translateY(0);
}

.page-transition-exit-active {
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 300ms, transform 300ms;
}

/* Add responsive drawer styles */
@media (max-width: 600px) {
  .MuiDrawer-paper {
    width: 100% !important;
  }
}

/* Add smooth transitions */
.MuiDrawer-paper {
  transition: transform 0.3s ease-in-out !important;
}

/* Add hover effects */
.menu-item:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

[data-theme='dark'] .menu-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
}
