/* Material Design 3 Theme Variables */
:root {
  --md-sys-color-primary: #1976d2;
  --md-sys-color-primary-dark: #1565c0;
  --md-sys-color-on-primary: #FFFFFF;
  --md-sys-color-secondary: #03dac6;
  --md-sys-color-secondary-dark: #00bfa5;
  --md-sys-color-on-secondary: #000000;
  --md-sys-color-surface: #fafafa;
  --md-sys-color-on-surface: #212121;
  --md-sys-color-surface-variant: #f5f5f5;
  --md-sys-color-on-surface-variant: #757575;
  --md-sys-color-outline: #e0e0e0;
  --md-sys-color-surface-container: #ffffff;
  --md-sys-color-surface-container-high: #f8f9fa;
  --md-sys-color-surface-container-highest: #f1f3f4;
  --md-sys-color-error: #f44336;
  --md-sys-color-warning: #ff9800;
  --md-sys-color-success: #4caf50;
  --md-sys-color-tertiary: #9c27b0;
  
  /* Shadow levels */
  --shadow-1: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
  --shadow-2: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
  --shadow-3: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
  --shadow-4: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
  
  /* Responsive breakpoints */
  --bp-mobile: 480px;
  --bp-tablet: 768px;
  --bp-desktop: 1024px;
  --bp-wide: 1200px;
}

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

body {
  font-family: 'Roboto', sans-serif;
  background: linear-gradient(135deg, var(--md-sys-color-surface) 0%, var(--md-sys-color-surface-variant) 100%);
  color: var(--md-sys-color-on-surface);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Removed: Main Content Container classes - now using Tailwind CSS */

/* App Bar */
.app-bar {
  background: var(--md-sys-color-surface-container);
  padding: clamp(16px, 3vw, 24px) 0;
  border-bottom: 1px solid var(--md-sys-color-outline);
  margin-bottom: clamp(16px, 4vw, 32px);
  box-shadow: var(--shadow-1);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  width: 100%;
}

.app-bar .container {
  padding: 0 clamp(16px, 4vw, 32px);
}

.app-bar h1 {
  margin: 0;
  font-size: clamp(20px, 5vw, 28px);
  font-weight: 500;
  color: var(--md-sys-color-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Removed: Nav actions layout - now using Tailwind CSS */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: clamp(8px, 2vw, 12px) clamp(16px, 4vw, 24px);
  border: none;
  border-radius: 24px;
  font-family: 'Roboto', sans-serif;
  font-size: clamp(12px, 2.5vw, 14px);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 44px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-1);
  white-space: nowrap;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn:hover::before {
  opacity: 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--md-sys-color-primary) 0%, var(--md-sys-color-primary-dark) 100%);
  color: var(--md-sys-color-on-primary);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--md-sys-color-secondary) 0%, var(--md-sys-color-secondary-dark) 100%);
  color: var(--md-sys-color-on-secondary);
}

.btn-outline {
  background: var(--md-sys-color-surface-container);
  border: 2px solid var(--md-sys-color-primary);
  color: var(--md-sys-color-primary);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-3);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-1);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  min-height: 32px;
  border-radius: 16px;
}

.btn-danger {
  background: linear-gradient(135deg, var(--md-sys-color-error) 0%, #d32f2f 100%);
  color: white;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-3);
}

.btn-icon {
  min-width: 44px;
  padding: 8px;
  border-radius: 50%;
  background: var(--md-sys-color-surface-container);
  border: none !important;
}

.btn-icon:hover {
  background: var(--md-sys-color-surface-container-high);
    border: none !important;

}

/* Disabled button styles */
.btn.disabled,
.btn:disabled,
.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
  box-shadow: none !important;
}

.btn.disabled::before,
.btn:disabled::before,
.btn[disabled]::before {
  display: none;
}

/* Cards */
.card {
  background: var(--md-sys-color-surface-container);
  border-radius: 24px;
  padding: clamp(24px, 5vw, 40px);
  box-shadow: var(--shadow-2);
  margin-bottom: clamp(20px, 4vw, 32px);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--md-sys-color-primary), var(--md-sys-color-secondary));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-4);
  transform: translateY(-4px);
  border-color: rgba(0, 0, 0, 0.08);
}

.card:hover::before {
  opacity: 1;
}

/* Card Header */
.card h2 {
  margin-top: 0;
  margin-bottom: clamp(16px, 3vw, 24px);
  color: var(--md-sys-color-on-surface);
  font-weight: 500;
  font-size: clamp(20px, 4vw, 26px);
  line-height: 1.3;
}

.card h2 .material-icons {
  margin-right: 12px;
  font-size: 1.2em;
  vertical-align: text-bottom;
}

/* Removed: Table wrapper layout - now using Tailwind CSS */

table {
  width: 100%;
  min-width: 800px;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--md-sys-color-surface-container);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-1);
  border: 1px solid var(--md-sys-color-outline);
}

th, td {
  padding: clamp(12px, 2vw, 16px);
  text-align: left;
  border-bottom: 1px solid var(--md-sys-color-outline);
  vertical-align: middle;
}

th {
  background: linear-gradient(135deg, var(--md-sys-color-primary) 0%, var(--md-sys-color-primary-dark) 100%);
  font-weight: 500;
  font-size: clamp(12px, 2vw, 14px);
  color: var(--md-sys-color-on-primary);
  position: sticky;
  top: 0;
  z-index: 10;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: all 0.2s ease;
}

tbody tr:hover {
  background: rgba(25, 118, 210, 0.08);
  transform: scale(1.01);
}

/* Removed: Form layout classes - now using Tailwind CSS */

input, select, textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--md-sys-color-outline);
  border-radius: 8px;
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  transition: all 0.3s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

input:disabled {
  background: var(--md-sys-color-surface-variant);
  color: var(--md-sys-color-on-surface-variant);
  cursor: not-allowed;
}

.secret-field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.secret-field-wrapper input {
  padding-right: 48px;
}

/* Removed: Form action classes - now using Tailwind CSS */

.danger-zone {
  margin-top: 32px;
  padding: 20px;
  background: rgba(244, 67, 54, 0.05);
  border: 1px solid rgba(244, 67, 54, 0.2);
  border-radius: 12px;
}

/* Utility classes */
.hidden { 
  display: none; 
}

.loading {
  animation: pulse 1.5s ease-in-out infinite alternate;
}

/* Mobile responsive button text */
@media (max-width: 600px) {
  .btn-text {
    display: none;
  }
}

/* Mobile First Responsive Design - Layout now handled by Tailwind CSS */
@media (max-width: 480px) {
  .card {
    padding: 16px;
    border-radius: 16px;
  }
}

@media (max-width: 768px) {
  th, td {
    padding: 8px 12px;
  }
}

/* Print styles */
@media print {
  .app-bar, .nav-actions, .btn {
    display: none;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --md-sys-color-surface: #121212;
    --md-sys-color-on-surface: #e0e0e0;
    --md-sys-color-surface-variant: #1e1e1e;
    --md-sys-color-on-surface-variant: #b0b0b0;
    --md-sys-color-outline: #333333;
    --md-sys-color-surface-container: #1e1e1e;
    --md-sys-color-surface-container-high: #252525;
    --md-sys-color-surface-container-highest: #2c2c2c;
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Focus styles for accessibility */
*:focus {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

/* Loading animation */
@keyframes pulse {
  from {
    opacity: 1;
  }
  to {
    opacity: 0.5;
  }
}

/* Sidebar Styles */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: var(--md-sys-color-surface-container);
  border-right: 1px solid var(--md-sys-color-outline-variant);
  box-shadow: var(--shadow-3);
  z-index: 1000;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar.active {
  transform: translateX(0);
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-high);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-close {
  background: none;
  border: none;
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-close:hover {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.sidebar-content {
  flex: 1;
  padding: 0;
  overflow-y: auto;
}

.sidebar-nav {
  list-style: none;
  padding: 8px;
  margin: 0;
}

.sidebar-nav li {
  margin-bottom: 4px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--md-sys-color-on-surface);
  text-decoration: none;
  border-radius: 12px;
  transition: all 0.2s ease;
  font-weight: 400;
  position: relative;
}

.sidebar-nav a:hover {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.sidebar-nav a.active {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  font-weight: 500;
}

.sidebar-nav a .material-icons {
  font-size: 20px;
  opacity: 0.8;
}

.sidebar-nav a.active .material-icons {
  opacity: 1;
}

.sidebar-nav-group {
  margin: 16px 0 8px 0;
  padding: 0 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-high);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--md-sys-color-surface-container-highest);
  border-radius: 12px;
  margin-bottom: 12px;
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  background: var(--md-sys-color-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--md-sys-color-on-primary);
  font-size: 16px;
  font-weight: 500;
}

.sidebar-user-info {
  flex: 1;
}

.sidebar-user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  margin: 0;
}

.sidebar-user-role {
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
  margin: 0;
}

/* Menu toggle button */
.menu-toggle {
  background: none;
  border: none;
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
}

.menu-toggle:hover {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

/* Home Page Specific Styles */
.home-header {
  background: linear-gradient(135deg, var(--md-sys-color-primary), var(--md-sys-color-secondary));
  color: var(--md-sys-color-on-primary);
  margin: -40px -40px 32px -40px;
  padding: 32px 40px;
  border-radius: 24px 24px 0 0;
}

.home-header h2 {
  color: var(--md-sys-color-on-primary);
  margin: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.home-header .material-icons {
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Enhanced feedback messages - keeping only custom styling */
.feedback-card {
  background: linear-gradient(135deg, #E6F4EA, #F0F8F0);
  border: 1px solid var(--md-sys-color-success);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.feedback-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--md-sys-color-success);
}

.feedback-card.error {
  background: linear-gradient(135deg, #FFEBEE, #FFF5F5);
  border-color: var(--md-sys-color-error);
}

.feedback-card.error::before {
  background: var(--md-sys-color-error);
}

/* Removed: Empty state layout - now using Tailwind CSS */

/* Removed: Enhanced nav actions layout - now using Tailwind CSS */

/* Responsive sidebar adjustments */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    max-width: 320px;
  }
  
  .home-header {
    margin: -24px -24px 24px -24px;
    padding: 24px;
  }
}
