/* ClassCards Home Page - Inspired Design with Modern Colors */

:root {
  /* Blue educational color scheme inspired by easy4me.info */
  --primary: #1E5BA8;
  --primary-dark: #164480;
  --primary-light: #4A90E2;
  --secondary: #4A90E2;
  --accent-orange: #4A90E2;
  --success: #4CAF50;
  --danger: #F44336;
  --warning: #4A90E2;
  --text-primary: #212121;
  --text-secondary: #757575;
  --text-light: #9E9E9E;
  --bg-primary: #FFFFFF;
  --bg-secondary: #F5F5F5;
  --bg-tertiary: #EEEEEE;
  --border: #E0E0E0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.12);

  /* Responsive spacing scale */
  --space-xs: clamp(0.25rem, 0.5vw, 0.5rem);
  --space-sm: clamp(0.5rem, 1vw, 0.75rem);
  --space-md: clamp(0.75rem, 1.5vw, 1rem);
  --space-lg: clamp(1rem, 2vw, 1.5rem);
  --space-xl: clamp(1.5rem, 3vw, 2rem);

  /* Responsive font sizes */
  --text-xs: clamp(0.75rem, 1.5vw, 0.875rem);
  --text-sm: clamp(0.875rem, 2vw, 1rem);

  /* Container widths */
  --container-lg: min(100% - 2rem, 75rem);

  /* Border radius */
  --radius: 0.375rem;
  --radius-md: clamp(0.375rem, 0.75vw, 0.5rem);
  --radius-lg: clamp(0.5rem, 1vw, 0.75rem);
  --radius-xl: clamp(0.75rem, 1.5vw, 1rem);
}

[data-theme="dark"] {
  /* Dark mode with blue accents */
  --primary: #4A90E2;
  --primary-dark: #1E5BA8;
  --primary-light: #6BA5E7;
  --secondary: #4A90E2;
  --accent-orange: #6BA5E7;
  --success: #66BB6A;
  --danger: #EF5350;
  --warning: #6BA5E7;
  --text-primary: #FAFAFA;
  --text-secondary: #BDBDBD;
  --text-light: #9E9E9E;
  --bg-primary: #212121;
  --bg-secondary: #303030;
  --bg-tertiary: #424242;
  --border: #424242;
}

/* Ocean Blue Theme */
[data-theme="ocean-blue"] {
  --primary: #0077B6;
  --primary-dark: #005A8C;
  --primary-light: #00B4D8;
  --secondary: #00B4D8;
  --accent-orange: #00B4D8;
  --success: #06D6A0;
  --danger: #EF476F;
  --warning: #FFD166;
  --text-primary: #E0FBFC;
  --text-secondary: #98C1D9;
  --text-light: #6B9AC4;
  --bg-primary: #073B4C;
  --bg-secondary: #0A4F67;
  --bg-tertiary: #0D6384;
  --card-bg: #0A4F67;
  --border: #1A7A9D;
}

/* Forest Green Theme */
[data-theme="forest-green"] {
  --primary: #2D6A4F;
  --primary-dark: #1B4332;
  --primary-light: #40916C;
  --secondary: #52B788;
  --accent-orange: #95D5B2;
  --success: #74C69D;
  --danger: #E76F51;
  --warning: #F4A261;
  --text-primary: #D8F3DC;
  --text-secondary: #B7E4C7;
  --text-light: #95D5B2;
  --bg-primary: #1B4332;
  --bg-secondary: #2D6A4F;
  --bg-tertiary: #40916C;
  --card-bg: #2D6A4F;
  --border: #40916C;
}

/* Sunset Orange Theme */
[data-theme="sunset-orange"] {
  --primary: #E07A5F;
  --primary-dark: #C96148;
  --primary-light: #F2A65A;
  --secondary: #F4A261;
  --accent-orange: #E9C46A;
  --success: #81B29A;
  --danger: #E76F51;
  --warning: #F4A261;
  --text-primary: #FEF9EF;
  --text-secondary: #E8D5C4;
  --text-light: #D4B5A0;
  --bg-primary: #3D405B;
  --bg-secondary: #4A4E69;
  --bg-tertiary: #5A5F7A;
  --card-bg: #4A4E69;
  --border: #6B708A;
}

/* Purple Theme */
[data-theme="purple"] {
  --primary: #7B2CBF;
  --primary-dark: #5A189A;
  --primary-light: #9D4EDD;
  --secondary: #C77DFF;
  --accent-orange: #E0AAFF;
  --success: #57CC99;
  --danger: #FF6B6B;
  --warning: #FFD93D;
  --text-primary: #F3E8FF;
  --text-secondary: #D4BBFF;
  --text-light: #B794F6;
  --bg-primary: #240046;
  --bg-secondary: #3C096C;
  --bg-tertiary: #5A189A;
  --card-bg: #3C096C;
  --border: #7B2CBF;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  min-height: 100vh;
  color: var(--text-primary);
}

h1 {
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
}

h2 {
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
}

h3 {
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
}

/* Header Bar */
#backgroundHeader {
  min-height: clamp(2.5rem, 6vh, 3.5rem);
  width: 100%;
  background: linear-gradient(135deg, #1E5BA8 0%, #4A90E2 100%);
  border-bottom: 2px solid #164480;
  box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.1);
}

.header-content {
  width: var(--container-lg);
  margin-inline: auto;
  padding: var(--space-sm) var(--space-md);
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.header-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
}

.header-logo img {
  height: clamp(1.75rem, 5vw, 2.5rem);
}

.header-logo h2 {
  color: white;
  margin: 0;
}

.lang-select {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.lang-select .language-switcher,
.lang-select .theme-switcher {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: white;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.lang-select .language-switcher:hover,
.lang-select .theme-switcher:hover {
  background: rgba(255, 255, 255, 0.3);
  color: white;
}

/* Ensure theme dropdown works correctly inside lang-select */
.lang-select .theme-dropdown-container {
  position: relative;
}

.lang-select .theme-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  display: none;
  flex-direction: column;
  min-width: 160px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 1000;
  margin-top: 0.25rem;
}

.lang-select .theme-dropdown.show {
  display: flex;
}

.lang-select .theme-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  color: #333;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 0.875rem;
}

.lang-select .theme-dropdown-item:hover {
  background: #f5f5f5;
}

.lang-select .theme-dropdown-item.active {
  background: #1E5BA8;
  color: white;
}

.lang-select .theme-dropdown-item .theme-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #ddd;
  flex-shrink: 0;
}

.lang-select .theme-dropdown-item.active .theme-icon {
  border-color: rgba(255,255,255,0.5);
}

/* Content Wrapper */
.contentWrapper {
  border-radius: var(--radius-xl);
  width: var(--container-lg);
  margin-inline: auto;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-xl);
  padding: var(--space-md);
  background-color: var(--bg-primary);
  box-shadow: 0px 8px 13px 0px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.contentWrapper::after {
  content: "";
  display: table;
  clear: both;
}

/* Logo Circle - Theme Adaptive */
.logo-circle {
  --logo-bg: var(--primary, #1E5BA8);
  --logo-bg-light: var(--primary-light, #4A90E2);
  --logo-text: white;
  --logo-accent: var(--logo-bg);

  position: relative;
  flex-shrink: 0;
  width: clamp(5rem, 15vw, 9rem);
  height: clamp(5rem, 15vw, 9rem);
  background: linear-gradient(135deg, var(--logo-bg) 0%, var(--logo-bg-light) 100%);
  border-radius: var(--radius-lg);
  box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  color: var(--logo-text);
}

.logo-icon {
  width: clamp(2rem, 6vw, 3.125rem);
  height: clamp(1.5rem, 5vw, 2.5rem);
  margin-bottom: var(--space-sm);
}

.logo-icon svg {
  width: 100%;
  height: 100%;
}

.logo-text {
  text-align: center;
  line-height: 1.1;
}

.logo-main {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo-sub {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  opacity: 0.9;
}

/* Navigation */
.navigation-wrapper {
  position: relative;
  display: flex;
  align-items: flex-start;
}

.main-navigation {
  position: relative;
  list-style-type: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.125rem;
}

.nav-item {
  position: relative;
}

.nav-item a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-secondary);
  transition: all 0.2s;
  background: var(--bg-secondary);
  box-sizing: border-box;
}

.nav-item a:hover {
  background: #dbeafe;
  color: #1E5BA8;
}

.nav-item.active a {
  background: linear-gradient(135deg, #1E5BA8 0%, #4A90E2 100%);
  color: white;
}

.nav-item a svg {
  margin-bottom: 2px;
  width: 18px;
  height: 18px;
}

.nav-item a span {
  font-size: 0.65rem;
  font-weight: 500;
}

#contentHead {
  position: relative;
  width: 100%;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

/* Content Layout */
.content-layout {
  position: relative;
  float: left;
  width: 100%;
}

.content-layout::after {
  content: "";
  display: table;
  clear: both;
}

#sidebar {
  position: relative;
  float: left;
  width: clamp(8rem, 15vw, 9.125rem);
}

#contentBody {
  position: relative;
  float: left;
  padding-left: var(--space-sm);
  width: calc(100% - clamp(8rem, 15vw, 9.125rem));
}

#contentBody h1,
#contentBody h2 {
  color: var(--text-primary);
  line-height: 1.3;
}

/* Gradient Boxes */
.gradient-box {
  background: var(--bg-secondary);
  box-shadow: var(--shadow);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

/* Login Box */
.login-box {
  width: 100%;
}

.login-form {
  width: 100%;
}

.form-row {
  margin-bottom: var(--space-sm);
}

.form-row label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-secondary);
}

.form-row input {
  width: 100%;
  padding: var(--space-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
}

.form-row input:focus {
  outline: none;
  border-color: #1E5BA8;
  box-shadow: 0 0 0 3px rgba(30, 91, 168, 0.1);
}

.btn-submit {
  width: 100%;
  padding: var(--space-sm);
  background: linear-gradient(135deg, #1E5BA8 0%, #4A90E2 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
}

.btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 91, 168, 0.4);
}

.form-row a {
  color: #1E5BA8;
  text-decoration: none;
}

.form-row a:hover {
  text-decoration: underline;
}

/* Intro Box */
.intro-box {
  width: 100%;
  position: relative;
  clear: both;
  color: var(--text-primary);
}

/* Version Columns */
.version-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  clear: both;
}

.feature-column {
  padding: var(--space-lg);
}

.feature-column h2 {
  margin-top: 0;
  margin-bottom: var(--space-sm);
}

.feature-column p {
  color: var(--text-secondary);
  margin: 0 0 var(--space-sm) 0;
}

.feature-column hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-sm) 0;
}

.feature-list {
  list-style: none;
  padding-left: 0;
  margin: var(--space-sm) 0;
}

.feature-list li {
  padding-left: var(--space-lg);
  margin-bottom: var(--space-sm);
  position: relative;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text-primary);
}

.feature-list li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #059669;
  font-weight: bold;
}

.register-link {
  display: inline-block;
  padding: var(--space-sm) var(--space-lg);
  background: linear-gradient(135deg, #1E5BA8 0%, #4A90E2 100%);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-lg);
  font-weight: 600;
  margin-top: var(--space-sm);
  transition: transform 0.2s;
}

.register-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(30, 91, 168, 0.4);
}

.register-link.secondary {
  background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
}

.register-link.secondary:hover {
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.4);
}

/* Info Boxes */
.info-box {
  width: 100%;
  position: relative;
  clear: both;
}

.info-content {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

.info-icon {
  flex-shrink: 0;
}

.info-text h3 {
  margin-top: 0;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.info-text span,
.info-text p {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text-secondary);
}

/* Leitner Section */
#leitner {
  width: 100%;
  clear: both;
}

#leitner p {
  color: var(--text-primary);
}

/* CTA Box */
.cta-box {
  text-align: center;
  padding: var(--space-xl);
  width: 100%;
  clear: both;
}

.cta-box h2 {
  margin-top: 0;
}

.cta-box p {
  color: var(--text-primary);
}

.cta-buttons {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  margin-top: var(--space-lg);
}

/* Footer */
.info-footer {
  color: var(--text-secondary);
  text-align: center;
  margin: var(--space-lg) auto;
  padding-bottom: var(--space-lg);
}

.info-footer a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
}

.info-footer a:hover {
  text-decoration: underline;
}

/* Clear float helper */
.clearBoth {
  clear: both;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .contentWrapper {
    width: 95%;
    margin-inline: auto;
  }

  .header-content {
    width: 95%;
    margin-inline: auto;
  }
}

@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  /* Override inline grid styles */
  .advantages-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  #backgroundHeader {
    height: auto;
    min-height: 2.5rem;
    padding: var(--space-xs) 0;
  }

  .header-content {
    position: static;
    left: auto;
    margin-left: 0;
    width: 100%;
    padding: 0 var(--space-md);
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .header-logo h2 {
    font-size: var(--text-base);
  }

  .contentWrapper {
    position: static;
    left: auto;
    margin-left: 0;
    margin-top: 0;
    width: 100%;
    border-radius: 0;
    padding: var(--space-md);
    box-shadow: none;
  }

  #contentHead {
    flex-direction: column;
    align-items: center;
  }

  .logo-circle {
    width: 6.25rem;
    height: 6.25rem;
    margin: 0 auto var(--space-md) auto;
    padding: var(--space-sm);
  }

  .logo-circle .logo-icon {
    width: 2.2rem;
    height: 1.75rem;
    margin-bottom: 0.3rem;
  }

  .logo-circle .logo-main {
    font-size: var(--text-base);
  }

  .logo-circle .logo-sub {
    font-size: var(--text-xs);
  }

  .navigation-wrapper {
    margin: 0;
    width: 100%;
    justify-content: center;
  }

  .main-navigation {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.3rem;
  }

  .nav-item a {
    width: 3.125rem;
    height: 3.125rem;
    padding: 0.375rem var(--space-sm);
  }

  .nav-item a span {
    font-size: 0.5625rem;
  }

  .content-layout {
    float: none;
  }

  #sidebar {
    float: none;
    width: 100%;
    margin-bottom: var(--space-lg);
  }

  #contentBody {
    float: none;
    width: 100%;
    padding-left: 0;
  }

  .version-columns {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .feature-column {
    padding: var(--space-md);
  }

  .feature-column h2 {
    font-size: var(--text-lg);
  }

  .info-box {
    width: 100%;
    margin-right: 0;
  }

  .info-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }

  .cta-box {
    padding: var(--space-lg) var(--space-md);
  }
}

@media (max-width: 480px) {
  .header-content {
    padding: 0 var(--space-sm);
  }

  .header-logo img {
    height: 1.875rem;
  }

  .header-logo h2 {
    font-size: var(--text-sm);
  }

  .lang-select .language-switcher,
  .lang-select .theme-switcher {
    padding: 0.25rem var(--space-sm);
    font-size: var(--text-xs);
  }

  .contentWrapper {
    padding: var(--space-sm);
  }

  .logo-circle {
    width: 5rem;
    height: 5rem;
    padding: var(--space-xs);
  }

  .logo-circle .logo-icon {
    width: 1.75rem;
    height: 1.375rem;
    margin-bottom: 0.25rem;
  }

  .logo-circle .logo-main {
    font-size: var(--text-sm);
  }

  .logo-circle .logo-sub {
    font-size: 0.6rem;
  }

  .feature-column {
    padding: var(--space-sm);
  }

  .feature-list li {
    font-size: var(--text-xs);
  }

  .register-link {
    padding: var(--space-xs) var(--space-md);
    font-size: var(--text-sm);
  }
}
