@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@200;300;400;500;600;700;800;900&family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
  --color-primary: #7380ec;
  --color-danger: #ff7782;
  --color-success: #41f1b6;
  --color-warning: #ffbb55;
  --color-white: #fff;
  --color-info: #7d8da1;
  --color-dark: #363949;
  --color-light: rgba(132, 139, 200, 0.18);
  --color-dark-varient: #677483;
  --color-background: #f6f6f9;

  --card-border-radius: 2rem;
  --border-radius-1: 0.4rem;
  --border-radius-2: 1.2rem;

  --card-padding: 1.8rem;
  --box-shadow: 0 2rem 3rem var(--color-light)
}

.dark-theme {
  --color-background: #181a1e;
  --color-white: #202528;
  --color-dark: #edeffd;
  --color-dark-varient: #a3bdcc;
  --color-light: rgba(0, 0, 0, 0.4);
  --box-shadow: 0 2rem 3rem var(--color-light)
}

.dark-theme header .logo img {
  content: url("/image-content/Logo/Logo-Trans-PS-Weis.png");
}



* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
  list-style: none;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  font-size: .88rem;
  background: var(--color-background);
  color: var(--color-dark);
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}

@supports(min-height:100dvh) {
  body {
    min-height: 100dvh;
  }
}

main {
  flex: 1 0 auto;
  min-height: 0;
  overflow: visible;
}
*{
    color: var(--color-dark);
}
img{
    display: block;
    width: 100%;
}
h1{
    font-weight: 800;
    font-size: 1.8rem;
}
h2{font-size: 1.4rem;}
h3{font-size: .87rem;}
h4{font-size: .8rem;}
h5{font-size: .77rem;}
small{font-size: .75rem;}

.text-muted{color: var(--color-info);}
p{color: var(--color-dark-varient);}
b{color: var(--color-dark);}

.primary{color: var(--color-primary);}
.danger{color: var(--color-danger);}
.success{color: var(--color-success)}
.warning{color: var(--color-warning);}

.container{
    position: relative;
    display: grid;
    width: 93%;
    margin: 0 3rem;
    gap: 1.8rem;
    grid-template-columns: 14rem auto 23rem;
    padding-top: 4rem;
}
header h3{font-weight: 500;} 
/* ===== Header ===== */
header{
    position: fixed;
    width: 100vw;
    z-index: 1000;
    background-color: var(--color-background);
}
header.active{box-shadow: var(--box-shadow);}
header .logo{
    display: flex;
    gap: .8rem;
    margin-right: auto;
}
header .logo img {
    width: 6rem;  /* statt 5rem */
    height: 6rem; /* statt 5rem */
}

header,
header .navbar{
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 3rem;
    color: var(--color-info);
}
header .navbar a{
    display: flex;
    margin-left: 3.5rem;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    position: relative;
    height: 3.7rem;
    transition: all 300ms ease;
    padding: 0 2rem;
}

header .navbar a.active{
    background: var(--color-light);
    color: var(--color-primary);
}
header .navbar a.active::before{
    content: "";
    background-color: var(--color-primary);
    position: absolute;
    height: 5px;
    width: 100%;
    left: 0;top: 0;
}
header #profile-btn{
    display: none;
    font-size: 2rem;
    margin: .5rem 2rem 0 0;
    cursor: pointer;
}
header .theme-toggler{
    background: var(--color-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 1.6rem;
    width: 4.2rem;
    cursor: pointer;
    border-radius: var(--border-radius-1);
    margin-right: 2rem;
}
header .theme-toggler span{
    font-size: 1.2rem;
    width: 50%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
header .theme-toggler span.active{
    background-color: var(--color-primary);
    color: white;
    border-radius: var(--border-radius-1);
}
/* ===== Dropdown ===== */
.dropdown-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: calc(6.5rem + 12vh);
  min-height: auto;
  margin: 0 auto;
  overflow: visible;
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-select {
  padding: 0 14px;
  height: 44px;
  min-width: 220px;
  max-width: 92vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--color-light);
  border-radius: .55rem;
  background: var(--color-white);
  cursor: default;
}

.dropdown-select::after {
  content: "▾";
  opacity: .7;
  font-size: .9em;
}

.dropdown-content {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  display: grid;
  grid-template-columns: repeat(2, minmax(200px, 1fr));
  gap: .4rem;
  padding: .6rem;
  background: var(--color-white);
  border-radius: .75rem;
  box-shadow: 0 1.2rem 2rem rgba(0, 0, 0, .08);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
}

.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.dropdown-content a {
  padding: .7rem .9rem;
  border-radius: .5rem;
  font-size: .95rem;
  display: flex;
  align-items: center;
  transition: all .15s ease;
}

.dropdown-content a:hover {
  background: var(--color-light);
  color: var(--color-primary);
}

.dropdown-content.disabled {
  pointer-events: none;
  opacity: .5;
  filter: grayscale(.15);
}

/* ===== Footer ===== */
.footer-dark {
  background: #1e212e;
  color: rgba(255, 255, 255, .75);
  text-align: center;
  padding: 14px 10px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  margin-top: auto;
  flex-shrink: 0;
  width: 100%;
  position: static !important;
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .3rem .75rem;
  padding: 0;
  margin: 0 0 8px;
  list-style: none;
}

.footer-links li {
  display: inline-flex;
  align-items: center;
}

.footer-links li::before {
  content: "·";
  padding: 0 8px;
  color: rgba(255, 255, 255, .4);
}

.footer-links li:first-child::before {
  content: "";
  padding: 0;
}

.footer-links a {
  color: rgba(255, 255, 255, .85);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-copy {
  font-size: .78rem;
  color: rgba(255, 255, 255, .7);
  margin: 0;
}

/* ===== Responsive ===== */
@media(max-width:600px) {
  header {
    padding: 0 .6rem;
  }

  header .logo img {
    width: 3.8rem;
    height: 3.8rem;
  }

  header .navbar a h3 {
    display: none;
  }

  header .navbar a {
    padding: 0 .6rem;
    margin-left: .6rem;
    height: 3rem;
  }

  header .theme-toggler {
    transform: scale(.85);
    margin-right: .4rem;
  }

  #profile-btn {
    margin-right: .4rem;
  }

  .dropdown-container {
    padding-top: calc(6.5rem + 5vh);
    min-height: 36svh;
  }
}

@media(min-width:768px) and (max-width:1024px) {
  :root {
    --header-h: 7.2rem;
  }
}

/* Header-Hover: Unterstreichung wächst aus der Mitte (ohne Layout-Shift) */
header .navbar a{
  position: relative;                /* hast du schon – hier zur Sicherheit */
  transition: color .25s ease;
}

header .navbar a::after{
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.35rem;                   /* Abstand zur Unterkante des Links */
  width: 60%;                        /* Länge der Linie */
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;

  transform: translateX(-50%) scaleX(0);
  transform-origin: 50% 50%;
  transition: transform .25s ease;
}

/* Aktivierung bei Hover + Tastaturfokus */
header .navbar a:hover::after,
header .navbar a:focus-visible::after{
  transform: translateX(-50%) scaleX(1);
}

/* Optional: etwas Farbfeedback ohne Springen */
header .navbar a:hover,
header .navbar a:focus-visible{
  color: var(--color-primary);
}
/* === MOBILE FIX: iPhone & Smartphones < 600px === */
@media (max-width: 600px) {

  header {
    padding: 0 0.6rem;
  }

  /* Logo kleiner machen → mehr Platz für Navbar */
  header .logo img {
    width: 3.8rem;
    height: 3.8rem;
  }

  /* Navbar als horizontale Scroll-Leiste (verhindert Abschneiden) */
  header .navbar {
    max-width: 70vw;  
    margin-right: -2rem;             /* Platz für Toggle + Profile */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.6rem;
    scrollbar-width: none;         /* Firefox */
  }
  header .navbar::-webkit-scrollbar { display: none; }

  /* Text ausblenden → nur Icons → viel kompakter */
  header .navbar a h3 {
    display: none;
  }

  header .navbar a {
    padding: 0 0.6rem;
    margin-left: 0.6rem;
    height: 3rem;
  }

  /* Theme-Toggle etwas kleiner */
  header .theme-toggler {
    transform: scale(0.85);
    margin-right: 0.4rem;
  }

  #profile-btn {
    margin-right: 0.4rem;
  }

  /* Platz unter dem Header erhöhen */
  .container {
    padding-top: 5.5rem !important;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {

  /* Header kompakter, damit nichts umbrecht */
  header, header .navbar {
    padding: 0 0.8rem;
  }

  header .logo img {
    width: 4.2rem;
    height: 4.2rem;   /* kleiner als Desktop, damit mehr Platz für Nav bleibt */
  }

  /* Navbar: nur Icons zeigen, horizontal scrollbar statt Umbruch */
  header .navbar {
    gap: 0.4rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    max-width: 65vw;   /* verhindert Überschieben der Theme-Toggle/Profil-Buttons */
  }
  header .navbar a {
    margin-left: 0.6rem;
    padding: 0 0.8rem;
    height: 3.2rem;
  }
  header .navbar a h3 {    /* Text ausblenden → nur Icon */
    display: none;
  }
  header .navbar a:hover { /* kein „Hochschieben“ beim Hover auf iPad */
    padding-top: 0;
  }

  /* Platz unter dem fixen Header etwas erhöhen (dein Header ist fixed) */
  .container {
    padding-top: 7.2rem; /* vorher 6rem in deinen iPad-Styles, hier etwas mehr Luft */
    margin: 0 0.8rem;
  }
}

/* === SUBSCRIPTION FREEZE (identisch zu dashboard.css) === */
body.frozen header,
body.frozen main,
body.frozen .dropdown-container,
body.frozen footer {
    pointer-events: none;
    filter: grayscale(.2) brightness(.9);
}

/* Das Overlay darf nicht blockiert werden */
body.frozen #expired-overlay {
    pointer-events: auto !important;
    filter: none !important;
}

/* Optional: Vollbild-Overlay, falls showExpiredAndFreeze es nutzt */
#expired-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
}
/* Grid enger */
.subject-grid {
  margin-top: -7.5rem;
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.9rem;
}

/* Kleine Rectangle Tiles */
.subject-tile {
  background: var(--color-white);
  border-radius: var(--border-radius-2);
  border: 2px solid transparent;
  box-shadow: 0 0.5rem 1.4rem rgba(0, 0, 0, 0.07);

  display: flex;
  align-items: center;
  gap: 1rem;

  padding: 1rem 1.2rem;
  cursor: pointer;
  transition: all 160ms ease;
  min-height: 85px;     /* 👈 klare Verkleinerung */
}

/* Kleineres Icon */
.subject-tile .icon {
  font-size: 30px;      /* vorher 42 */
  opacity: 0.9;
}

/* Kleinerer Textblock */
.subject-tile .info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}



/* Hover Effekt */
.subject-tile:hover {
  transform: translateY(-3px);
  border-color: var(--color-primary);
  box-shadow: 0 0.8rem 2rem rgba(115, 128, 236, 0.14);
}

/* Active */
.subject-tile.active {
  background: var(--color-light);
  border-color: var(--color-primary);
  box-shadow: 0 1rem 2rem rgba(115, 128, 236, 0.28);
}

/* Dark Theme Fixes */
.dark-theme .subject-tile {
  background: var(--color-white);
}


.dark-theme .subject-tile .icon {
  color: var(--color-dark);
}



.quickmodes {
  margin: 2rem auto;
  width: min(900px, 95%);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.mode-tile {
  background: var(--color-white);
  padding: 1rem;
  border-radius: var(--border-radius-2);
  box-shadow: var(--box-shadow);
  text-align: center;
  cursor: pointer;
  transition: 120ms;
  -webkit-tap-highlight-color: transparent;

  /* FIX gegen Größensprung */
  border: 2px solid transparent;
}

.mode-tile.active {
  border-color: var(--color-primary);
     background: var(--color-light) !important;
}

.mode-tile:hover {
  background: var(--color-light);
}

.summary {
  margin: 3rem auto;
  width: min(600px, 95%);
  background: var(--color-white);
  padding: 1.5rem;
  border-radius: var(--border-radius-2);
  box-shadow: var(--box-shadow);
}

#startTestBtn {
  margin-top: 1rem;
  width: 100%;
  padding: 0.9rem;
  border-radius: var(--border-radius-1);
  border: none;
  background: var(--color-primary);
  color: white;
  cursor: pointer;
}

#startTestBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.mode-tile:focus {
    outline: none !important;
}

:root {
    --mode-bg-light: rgba(132, 139, 200, 0.18); /* hell & neutral */
}
.dark-theme {
    --mode-bg-light: rgba(255, 255, 255, 0.08); /* helles Grau im Dark Mode */
}

/* Override Hover & Active backgrounds */
.mode-tile:hover {
    background: var(--mode-bg-light) !important;
}

.mode-tile.active {
    background: var(--mode-bg-light) !important;
    border-color: var(--color-primary);
}
.dropdown-container {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}
.subject-grid {
    margin: 2rem auto 0 auto;            /* Abstand oben + zentriert */
    width: min(1100px, 90%);             /* ✔ Platz links & rechts */
    
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* ✔ Immer 3 Kacheln */
    gap: 1.2rem;                          /* Abstand zwischen Kacheln */
    padding: 0.5rem 0;                    /* Innenabstand */
}

/* TILES SCHMALER MACHEN */
.subject-tile {
    padding: 0.8rem 1rem;                /* weniger breit, kompakter */
    min-height: 70px;                    /* etwas kleiner */
}

/* Responsive */
@media (max-width: 900px) {
    .subject-grid {
        grid-template-columns: repeat(2, 1fr);
        width: min(700px, 92%);
    }
}

@media (max-width: 600px) {
    .subject-grid {
        grid-template-columns: 1fr;
        width: 92%;
    }
}
/* Prevent text selection on exam tiles and mode tiles */
.subject-tile,
.subject-tile * ,
.mode-tile,
.mode-tile * {
    user-select: none;
    -webkit-user-select: none;   /* iOS Safari */
    -ms-user-select: none;
    -moz-user-select: none;
    -webkit-tap-highlight-color: transparent; /* iOS blue highlight verhindern */
}

.subject-tile {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
}

.subject-tile .code {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-right: 0.3rem;   /* etwas Luft vor dem Titel */
}

.subject-tile .title {
    font-size: 1rem;
    font-weight: 600;
}
@supports (-webkit-touch-callout: none) {
  .subject-grid {
    margin-top: 7rem !important;
  }
}
.summary span {
    display: inline-block;
    transition: transform 200ms ease;
}

.summary span.bump {
    transform: scale(1.25);
}
