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

a {
  text-decoration: none;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
  line-height: 1.6;
}

/* Navigation Bar */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.nav-brand h2 {
  color: #667eea;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.nav-menu {
  display: flex;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  font-size: 1rem;
  transition: all 0.3s ease;
  position: relative;
  padding: 0.5rem 0;
}

.nav-link:hover {
  color: #667eea;
  transform: translateY(-2px);
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* Mobile Navigation Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 4px;
}

.bar {
  width: 25px;
  height: 3px;
  background: #333;
  transition: all 0.3s ease;
  border-radius: 2px;
}

/* Main Content */
.main-content {
  margin-top: 70px;
  padding: 2rem 0;
  min-height: calc(100vh - 70px);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Entity Hero Section */
.entity-hero {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.entity-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #667eea, #764ba2, #4facfe, #00f2fe);
}

.entity-hero-content {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.entity-hero-image {
  width: 100px;
  height: 100px;
  border-radius: 15px;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.entity-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.entity-hero-info {
  flex: 1;
}

.entity-hero-title {
  font-size: 1.8rem;
  color: #333;
  margin-bottom: 0.5rem;
}

.entity-hero-subtitle {
  color: #666;
  font-size: 1rem;
}

/* Loading and Error States */
.loading {
  text-align: center;
  padding: 3rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  color: #667eea;
  font-size: 1.2rem;
}

.error {
  text-align: center;
  padding: 3rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  color: #dc3545;
  font-size: 1.2rem;
}

/* Card Styles */
.card {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.card-header {
  margin-bottom: 1.5rem;
}

.card-header h3 {
  color: #333;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.card-header p {
  color: #666;
  font-size: 0.9rem;
}

/* Controls Section */
.controls-card {
  padding: 1rem 1.5rem;
}

.controls-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.year-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.year-selector label {
  font-weight: 500;
  color: #333;
}

.year-input {
  width: 100px;
  padding: 0.5rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.year-input:focus {
  outline: none;
  border-color: #667eea;
}

/* Button Styles */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(245, 87, 108, 0.4);
}

/* Scanner Section */
.scanner-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.qr-scanner-container {
  text-align: center;
  padding: 1rem;
}

.qr-video {
  width: 100%;
  max-width: 400px;
  border-radius: 15px;
  margin: 0 auto;
  display: block;
}

.scanner-status {
  color: #667eea;
  margin-top: 1rem;
  font-weight: 500;
}

/* Stats Section */
.stats-card {
  padding: 2rem;
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-box {
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
  border-radius: 15px;
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.3s ease;
}

.stat-box:hover {
  transform: translateY(-3px);
}

.stat-box.stat-highlight {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-box.stat-highlight .stat-value,
.stat-box.stat-highlight .stat-label {
  color: white;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #333;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.9rem;
  color: #666;
  font-weight: 500;
}

/* Monthly Breakdown */
.monthly-section {
  margin-top: 2rem;
}

.monthly-section h4 {
  color: #333;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.monthly-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.month-card {
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.month-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.month-card.has-attendance {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  border-color: #4caf50;
}

.month-name {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.month-count {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
}

.month-card.has-attendance .month-count {
  color: #2e7d32;
}

/* Notification System */
.notification-container {
  position: fixed;
  top: 90px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
}

.notification {
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateX(100px);
  transition: all 0.3s ease;
  cursor: pointer;
}

.notification-show {
  opacity: 1;
  transform: translateX(0);
}

.notification-hide {
  opacity: 0;
  transform: translateX(100px);
}

.notification-error {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
  color: white;
}

.notification-success {
  background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
  color: white;
}

.notification-message {
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    padding: 1rem;
    display: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  }

  .nav-menu.active {
    display: block;
  }

  .nav-links {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-toggle.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-toggle.active .bar:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .entity-hero-content {
    flex-direction: column;
    text-align: center;
  }

  .controls-row {
    flex-direction: column;
    align-items: stretch;
  }

  .year-selector {
    justify-content: center;
  }

  .stats-summary {
    grid-template-columns: 1fr;
  }

  .monthly-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .stat-value {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .nav-brand h2 {
    font-size: 1.2rem;
  }

  .entity-hero-title {
    font-size: 1.4rem;
  }

  .monthly-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .btn {
    width: 100%;
  }
}
