@import "tailwindcss";

/* ==========================================
   Portal do Aluno — Global Styles
   ========================================== */

:root {
  /* Default Dark Mode Variables */
  --color-primary: #6366f1;
  --color-primary-light: #818cf8;
  --color-primary-dark: #4f46e5;
  --color-accent: #06b6d4;
  --color-accent-light: #22d3ee;
  --color-surface: #0f172a;
  --color-surface-light: #1e293b;
  --color-surface-lighter: #334155;
  --color-text: #f8fafc;
  --color-text-secondary: #94a3b8;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #3b82f6;
  --color-border: #334155;

  /* Alphas and Complex colors */
  --bg-info-alpha: rgba(59, 130, 246, 0.15);
  --bg-primary-alpha: rgba(99, 102, 241, 0.15);
  --bg-accent-alpha: rgba(6, 182, 212, 0.15);
  --bg-danger-alpha: rgba(239, 68, 68, 0.15);
  --bg-success-alpha: rgba(16, 185, 129, 0.15);
  --bg-warning-alpha: rgba(245, 158, 11, 0.15);
  --border-danger-alpha: rgba(239, 68, 68, 0.3);
  --border-success-alpha: rgba(16, 185, 129, 0.3);
  
  --overlay-bg: rgba(0, 0, 0, 0.4);
  --header-bg: rgba(15, 23, 42, 0.9);

  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  --gradient-dark: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  --gradient-sidebar: linear-gradient(180deg, #0c1222 0%, #131b2e 50%, #0f172a 100%);
  --gradient-login: linear-gradient(135deg, #0c1222 0%, #1a1040 50%, #0f172a 100%);
  --gradient-warning: linear-gradient(135deg, rgba(245,158,11,0.2) 0%, rgba(234,179,8,0.1) 100%);
  
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(148, 163, 184, 0.1);
  --table-hover: rgba(99, 102, 241, 0.05);
  --table-border: rgba(51, 65, 85, 0.5);
}

:root[data-theme="light"] {
  /* Light Mode Equivalents */
  --color-primary: #4f46e5;
  --color-primary-light: #6366f1;
  --color-primary-dark: #3730a3;
  --color-accent: #0891b2;
  --color-accent-light: #06b6d4;
  --color-surface: #f8fafc;
  --color-surface-light: #ffffff;
  --color-surface-lighter: #f1f5f9;
  --color-text: #0f172a;
  --color-text-secondary: #475569;
  --color-success: #059669;
  --color-warning: #b45309; 
  --color-danger: #dc2626;  
  --color-border: #cbd5e1;

  /* Alphas and Complex colors */
  --bg-primary-alpha: rgba(79, 70, 229, 0.1);
  --bg-accent-alpha: rgba(8, 145, 178, 0.1);
  --bg-danger-alpha: rgba(220, 38, 38, 0.1);
  --bg-success-alpha: rgba(5, 150, 105, 0.1);
  --bg-warning-alpha: rgba(180, 83, 9, 0.1);
  --border-danger-alpha: rgba(220, 38, 38, 0.3);
  --border-success-alpha: rgba(5, 150, 105, 0.3);

  --overlay-bg: rgba(15, 23, 42, 0.5);
  --header-bg: rgba(255, 255, 255, 0.9);

  --gradient-primary: linear-gradient(135deg, #4f46e5 0%, #0891b2 100%);
  --gradient-dark: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  --gradient-sidebar: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  --gradient-login: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 50%, #f8fafc 100%);
  --gradient-warning: linear-gradient(135deg, rgba(245,158,11,0.1) 0%, rgba(234,179,8,0.05) 100%);

  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(15, 23, 42, 0.08);
  --table-hover: rgba(79, 70, 229, 0.05);
  --table-border: rgba(203, 213, 225, 0.5);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--color-surface);
  color: var(--color-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#root {
  min-height: 100vh;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--color-surface);
}
::-webkit-scrollbar-thumb {
  background: var(--color-surface-lighter);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.15); }
  50% { box-shadow: 0 0 30px rgba(99, 102, 241, 0.3); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

.animate-slide-left {
  animation: slideInLeft 0.4s ease-out forwards;
}

.animate-slide-right {
  animation: slideInRight 0.4s ease-out forwards;
}

.animate-scale-in {
  animation: scaleIn 0.3s ease-out forwards;
}

.animate-pulse {
  animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.98); }
}

@keyframes pulse-glow {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* ===== Glass Card ===== */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  transition: all 0.3s ease;
}

.glass-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.1);
}

/* ===== Gradient Text ===== */
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== Buttons ===== */
.btn-primary {
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: var(--color-surface-lighter);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: 0.625rem 1.25rem;
  border-radius: 12px;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-secondary:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

/* ===== Input ===== */
.input-field {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  color: var(--color-text);
  font-size: 0.9375rem;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s ease;
  outline: none;
}

.input-field::placeholder {
  color: var(--color-text-secondary);
}

.input-field:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.badge-info {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
}

/* ===== Table ===== */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table thead th {
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table tbody td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  font-size: 0.875rem;
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.2s ease;
}

.data-table tbody tr:hover {
  background: rgba(99, 102, 241, 0.05);
}

/* ===== Page Layout ===== */
.page-container {
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.page-subtitle {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
}

/* ===== Stagger Animation Children ===== */
.stagger-children > * {
  opacity: 0;
  animation: fadeIn 0.5s ease-out forwards;
}
.stagger-children > *:nth-child(1) { animation-delay: 0s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.08s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.16s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.24s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.32s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.40s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.48s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.56s; }

/* ===== Loading Skeleton ===== */
.skeleton {
  background: linear-gradient(90deg, var(--color-surface-light) 25%, var(--color-surface-lighter) 50%, var(--color-surface-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .page-container {
    padding: 1rem;
  }
  .page-title {
    font-size: 1.375rem;
  }
  .data-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
