/* Enhanced CSS for improved performance and accessibility */

/* CSS Variables for consistent theming */
:root {
  --primary-color: #8167a9;
  --secondary-color: #f3cfc6;
  --text-primary: #212112;
  --text-secondary: #666;
  --border-color: #e2e8f0;
  --bg-light: #fff;
  --bg-dark: #1f2029;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --transition: all 0.3s ease;
  --success-color: #10b981;
  --gradient-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* General Styles */
html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background: #f4f4f4;
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.dark body {
  background-color: #1a1a1a;
  color: #f4f4f4;
}

a {
  color: #007bff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Base styles with improved performance */
* {
  box-sizing: border-box;
}

/* Header */
header {
  background: #333;
  color: #fff;
  padding: 1rem 0;
  text-align: center;
}

.dark header {
  background-color: #222;
}

header h1 {
  margin: 0;
}

/* Navigation */
nav {
  background-color: #444;
  padding: 0.5rem 0;
  text-align: center;
}

.dark nav {
  background-color: #333;
}

nav ul {
  padding: 0;
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

nav ul li {
  display: inline;
  padding: 0 20px;
}

nav ul li a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  padding: 5px 0;
  transition: color 0.3s ease;
}

nav ul li a:hover {
  color: #007bff;
  text-decoration: none;
}

/* Main Content */
.main {
  padding: 20px;
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  background-color: #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}

.dark .main {
  background-color: #2a2a2a;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* Improved focus styles for accessibility */
*:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Skip to main content for screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sr-only:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: var(--primary-color);
  color: white;
  text-decoration: none;
  z-index: 9999;
  border-radius: 4px;
  font-weight: 500;
}

/* Enhanced navigation */
.navbar {
  transition: var(--transition);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.navbar-brand {
  font-weight: 700;
  transition: var(--transition);
}

.navbar-brand:hover {
  transform: scale(1.05);
}

.nav-link {
  transition: var(--transition);
  position: relative;
  border-radius: 6px;
  margin: 0 0.25rem;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--primary-color) !important;
  background-color: rgba(129, 103, 169, 0.1);
}

.nav-link.active {
  background-color: var(--primary-color);
  color: white !important;
}

/* Language switcher styling */
.language-switcher {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}

.language-switcher button {
  background-color: #007bff;
  color: #fff;
  border: none;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.dark .language-switcher button {
  background-color: #66b3ff;
}

.language-switcher button:hover {
  background-color: #0056b3;
}

.dark .language-switcher button:hover {
  background-color: #3399ff;
}

.language-switcher button.active {
  background-color: #0056b3;
  border: 2px solid #0056b3;
}

.dark .language-switcher button.active {
  background-color: #3399ff;
  border-color: #3399ff;
}

/* Improved button styles */
.btn {
  transition: var(--transition);
  border-radius: 6px;
  font-weight: 500;
}

.btn:focus {
  box-shadow: 0 0 0 3px rgba(129, 103, 169, 0.25);
}

.btn:hover {
  transform: translateY(-1px);
}

/* Enhanced card styles */
.card {
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
  border: 1px solid #ddd;
  overflow: hidden;
  background-color: #f9f9f9;
}

.dark .card {
  background-color: #3a3a3a;
  border-color: #555;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Enhanced DSE columns */
.dsecolumns {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  padding: 20px;
}

.dsecolumn {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  padding: 20px;
  width: 100%;
  max-width: 300px; /* Adjust as needed for desktop */
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.2s ease-in-out;
}

.dark .dsecolumn {
  background-color: #3a3a3a;
  border-color: #555;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.dsecolumn:hover {
  transform: translateY(-5px);
}

.dsecolumn h2 {
  margin-top: 0;
  font-size: 1.5em;
  color: #333;
}

.dark .dsecolumn h2 {
  color: #eee;
}

.dsecolumn p {
  font-size: 0.9em;
  color: #666;
}

.dark .dsecolumn p {
  color: #bbb;
}

.dsecolumn .nav-link {
  display: block;
  margin-top: 10px;
  color: #007bff;
  text-decoration: none;
}

.dark .dsecolumn .nav-link {
  color: #88c0f0; /* Lighter blue for dark mode links */
}

.dsecolumn .nav-link:hover {
  text-decoration: underline;
}

.dsecolumn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-bg);
  border-radius: 8px 8px 0 0;
}

/* Specific Styles for DSELIFE */
.profile-container,
.profile-container2,
.profile-container3 {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background-color: #f0f0f0;
  border-radius: 8px;
  margin-bottom: 20px;
}

.centerplease {
  text-align: center;
  margin: 0 10px;
}

.indexcontainer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  padding: 20px;
}

.cardLayout {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 1200px; /* Adjust as needed for desktop */
}

.firstRow,
.secondRow {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.subject-card {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease-in-out;
}

.subject-card:hover {
  transform: translateY(-5px);
}

.subject-card.long2 {
  width: 100%;
  flex-direction: row;
  align-items: center;
  text-align: left;
}

.subject-card.long2 .card-image {
  width: 50%;
  height: 200px;
}

.subject-card.long2 .card-content {
  width: 50%;
  padding: 20px;
}

.subject-card.sm {
  width: calc(50% - 10px);
  max-width: 250px;
}

.subject-card.xl {
  width: calc(50% - 10px);
  max-width: 500px;
}

.card-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.card-content {
  padding: 15px;
}

.card-content h2 {
  margin-top: 0;
  font-size: 1.2em;
  color: #333;
}

.dark .card-content h2 {
  color: #eee;
}

.card-content p {
  font-size: 0.9em;
  color: #666;
}

.dark .card-content p {
  color: #bbb;
}

.clear {
  clear: both;
}

.custom {
  font-size: 1.2em;
  color: #007bff;
  text-decoration: none;
}

.dark .custom {
  color: #88c0f0; /* Lighter blue for dark mode links */
}

.custom2 {
  font-size: 1.2em;
  color: #007bff;
  text-decoration: none;
}

.dark .custom2 {
  color: #88c0f0; /* Lighter blue for dark mode links */
}

.custom3 {
  text-align: center;
  font-size: 2em;
  color: #333;
  margin-top: 20px;
}

.dark .custom3 {
  color: #eee;
}

.subject-name {
  pointer-events: none; /* Make subject names non-clickable */
}

.file-links-container {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 10px;
}

.file-links-container a {
  display: block;
  padding: 5px 10px;
  background-color: #e9e9e9;
  border-radius: 5px;
  text-decoration: none;
  color: #333;
  transition: background-color 0.2s;
}

.file-links-container a:hover {
  background-color: #dcdcdc;
}

.dark .file-links-container a {
  background-color: #444;
  color: #eee;
}

.dark .file-links-container a:hover {
  background-color: #555;
}

/* Specific file type icons (optional, can be done with JS or more complex CSS) */
.file-links-container a[href$=".pdf"]::before {
  content: "\f1c1"; /* FontAwesome PDF icon */
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  color: #dc3545; /* Red for PDF */
}

.file-links-container a[href$=".mp3"]::before {
  content: "\f001"; /* FontAwesome Music icon */
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  color: #28a745; /* Green for MP3 */
}

/* Local image optimization */
.local-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
}

.dark .local-image {
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.local-image:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Smooth transitions for Next.js */
html {
  scroll-behavior: smooth;
}


}
