@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Color Palette */
  --bg-dark: #0f172a;
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  --surface: rgba(30, 41, 59, 0.7);
  --surface-hover: rgba(30, 41, 59, 0.9);
  --primary: #818cf8;
  --primary-hover: #6366f1;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  
  /* Typography */
  --font-main: 'Inter', sans-serif;
}

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

body {
  font-family: var(--font-main);
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Glassmorphism utility */
.glass {
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  box-shadow: var(--glass-shadow);
  border-radius: 16px;
}

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

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

/* App Container */
#app {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Login View */
#login-view {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  padding: 3rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.logo-icon {
  width: 48px;
  height: 48px;
  color: var(--primary);
  margin-bottom: 1rem;
}

.login-title {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.login-subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.input-group {
  margin-bottom: 1rem;
  text-align: left;
}

.input-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.input-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 1rem;
  outline: none;
  transition: all 0.2s;
}

.input-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.2);
}

.btn {
  width: 100%;
  padding: 0.875rem;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn:hover {
  background: var(--primary-hover);
}

.btn:active {
  transform: scale(0.98);
}

.error-msg {
  color: #ef4444;
  font-size: 0.85rem;
  margin-top: 1rem;
  min-height: 1.2rem;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  margin-bottom: 2rem;
}

.nav-brand {
  font-weight: 600;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.logout-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Dashboard View */
.view-header {
  margin-bottom: 2rem;
}

.view-header h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.view-header p {
  color: var(--text-muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.semester-card {
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.semester-card:hover {
  transform: translateY(-5px);
  background: var(--surface-hover);
  border-color: var(--primary);
}

.semester-icon {
  width: 40px;
  height: 40px;
  background: rgba(129, 140, 248, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.semester-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.semester-stats {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Semester Detail View */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.back-btn:hover {
  color: var(--text-main);
}

.tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  overflow-x: auto;
}

.tab {
  padding: 0.5rem 1rem;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 6px;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.tab.active {
  background: rgba(129, 140, 248, 0.15);
  color: var(--primary);
  font-weight: 500;
}

/* Resource Items */
.resource-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.resource-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem;
  transition: background 0.2s;
}

.resource-item:hover {
  background: var(--surface-hover);
}

.resource-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.resource-icon {
  color: var(--primary);
}

.resource-name {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.resource-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.download-btn {
  background: rgba(129, 140, 248, 0.1);
  color: var(--primary);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.download-btn:hover {
  background: var(--primary);
  color: #fff;
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}
