/* --------------------------------------------------
 :: SUBJECT THEME VARIABLES WITH CATEGORY FALLBACKS
 -------------------------------------------------- */

/* Mathematics themes */
.theme-mathematics,
.theme-mathematics-statistics {
  --theme-primary: var(--md-red-400);
  --theme-light: var(--md-red-200);
  --theme-dark: var(--md-red-600);
  --theme-darker: var(--md-red-800);
  --theme-rgba: rgba(239, 83, 80, 0.5);
  --theme-text-on-light: var(--black);
  --theme-text-on-dark: var(--white);
}

/* English/Language themes */
.theme-english,
.theme-languages-literacy {
  --theme-primary: var(--md-light-blue-400);
  --theme-light: var(--md-light-blue-200);
  --theme-dark: var(--md-light-blue-600);
  --theme-darker: var(--md-light-blue-800);
  --theme-rgba: rgba(41, 182, 246, 0.5);
  --theme-text-on-light: var(--black);
  --theme-text-on-dark: var(--white);
}

/* French - keeping separate as requested */
.theme-french {
  --theme-primary: var(--md-blue-400);
  --theme-light: var(--md-blue-200);
  --theme-dark: var(--md-blue-600);
  --theme-darker: var(--md-blue-800);
  --theme-rgba: rgba(66, 165, 245, 0.5);
  --theme-text-on-light: var(--black);
  --theme-text-on-dark: var(--white);
}

/* Science themes */
.theme-science,
.theme-sciences {
  --theme-primary: var(--md-deep-purple-400);
  --theme-light: var(--md-deep-purple-200);
  --theme-dark: var(--md-deep-purple-600);
  --theme-darker: var(--md-deep-purple-800);
  --theme-rgba: rgba(126, 87, 194, 0.5);
  --theme-text-on-light: var(--black);
  --theme-text-on-dark: var(--white);
}

/* History themes */
.theme-history,
.theme-humanities-social-sciences {
  --theme-primary: var(--md-amber-400);
  --theme-light: var(--md-amber-200);
  --theme-dark: var(--md-amber-600);
  --theme-darker: var(--md-amber-800);
  --theme-rgba: rgba(255, 202, 40, 0.5);
  --theme-text-on-light: var(--black);
  --theme-text-on-dark: var(--black);
}

/* Geography - keeping separate but could share with history if needed */
.theme-geography {
  --theme-primary: var(--md-green-400);
  --theme-light: var(--md-green-200);
  --theme-dark: var(--md-green-600);
  --theme-darker: var(--md-green-800);
  --theme-rgba: rgba(102, 187, 106, 0.5);
  --theme-text-on-light: var(--black);
  --theme-text-on-dark: var(--white);
}

/* Computing themes */
.theme-computing,
.theme-technology-computing {
  --theme-primary: var(--md-purple-400);
  --theme-light: var(--md-purple-200);
  --theme-dark: var(--md-purple-600);
  --theme-darker: var(--md-purple-800);
  --theme-rgba: rgba(171, 71, 188, 0.5);
  --theme-text-on-light: var(--black);
  --theme-text-on-dark: var(--white);
}

/* Art themes */
.theme-art-design,
.theme-arts-creative-expression {
  --theme-primary: var(--md-pink-400);
  --theme-light: var(--md-pink-200);
  --theme-dark: var(--md-pink-600);
  --theme-darker: var(--md-pink-800);
  --theme-rgba: rgba(236, 64, 122, 0.5);
  --theme-text-on-light: var(--black);
  --theme-text-on-dark: var(--white);
}

/* PSHE themes */
.theme-pshe,
.theme-physical-education-health,
.theme-personal-development-life-skills {
  --theme-primary: var(--md-orange-400);
  --theme-light: var(--md-orange-200);
  --theme-dark: var(--md-orange-600);
  --theme-darker: var(--md-orange-800);
  --theme-rgba: rgba(255, 167, 38, 0.5);
  --theme-text-on-light: var(--black);
  --theme-text-on-dark: var(--white);
}

/* Music - keeping separate */
.theme-music {
  --theme-primary: var(--md-pink-400);
  --theme-light: var(--md-pink-200);
  --theme-dark: var(--md-pink-600);
  --theme-darker: var(--md-pink-800);
  --theme-rgba: rgba(236, 64, 122, 0.5);
  --theme-text-on-light: var(--black);
  --theme-text-on-dark: var(--white);
}

/* Foreign Languages */
.theme-foreign-languages {
  --theme-primary: var(--md-deep-orange-400);
  --theme-light: var(--md-deep-orange-200);
  --theme-dark: var(--md-deep-orange-600);
  --theme-darker: var(--md-deep-orange-800);
  --theme-rgba: rgba(255, 112, 67, 0.5);
  --theme-text-on-light: var(--black);
  --theme-text-on-dark: var(--white);
}

/* Design Technology themes */
.theme-design-technology,
.theme-applied-vocational-studies {
  --theme-primary: var(--md-deep-purple-400);
  --theme-light: var(--md-deep-purple-200);
  --theme-dark: var(--md-deep-purple-600);
  --theme-darker: var(--md-deep-purple-800);
  --theme-rgba: rgba(126, 87, 194, 0.5);
  --theme-text-on-light: var(--black);
  --theme-text-on-dark: var(--white);
}

/* Citizenship */
.theme-citizenship {
  --theme-primary: var(--md-lime-400);
  --theme-light: var(--md-lime-200);
  --theme-dark: var(--md-lime-600);
  --theme-darker: var(--md-lime-800);
  --theme-rgba: rgba(212, 225, 87, 0.5);
  --theme-text-on-light: var(--black);
  --theme-text-on-dark: var(--black);
}

/* Religious Education themes */
.theme-religious-education,
.theme-religious-moral-education {
  --theme-primary: var(--md-deep-orange-400);
  --theme-light: var(--md-deep-orange-200);
  --theme-dark: var(--md-deep-orange-600);
  --theme-darker: var(--md-deep-orange-800);
  --theme-rgba: rgba(255, 112, 67, 0.5);
  --theme-text-on-light: var(--black);
  --theme-text-on-dark: var(--white);
}

/* Physical Education */
.theme-physical-education {
  --theme-primary: var(--md-teal-400);
  --theme-light: var(--md-teal-200);
  --theme-dark: var(--md-teal-600);
  --theme-darker: var(--md-teal-800);
  --theme-rgba: rgba(38, 166, 154, 0.5);
  --theme-text-on-light: var(--black);
  --theme-text-on-dark: var(--white);
}

/* Business themes */
.theme-business-commerce {
  --theme-primary: var(--md-teal-400);
  --theme-light: var(--md-teal-200);
  --theme-dark: var(--md-teal-600);
  --theme-darker: var(--md-teal-800);
  --theme-rgba: rgba(38, 166, 154, 0.5);
  --theme-text-on-light: var(--black);
  --theme-text-on-dark: var(--white);
}

/* Early Childhood Development */
.theme-early-childhood-development {
  --theme-primary: var(--md-orange-400);
  --theme-light: var(--md-orange-200);
  --theme-dark: var(--md-orange-600);
  --theme-darker: var(--md-orange-800);
  --theme-rgba: rgba(255, 167, 38, 0.5);
  --theme-text-on-light: var(--black);
  --theme-text-on-dark: var(--white);
}

/* Generic fallback */
.theme-generic {
  --theme-primary: var(--md-amber-400);
  --theme-light: var(--md-amber-200);
  --theme-dark: var(--md-amber-600);
  --theme-darker: var(--md-amber-800);
  --theme-rgba: rgba(255, 202, 40, 0.5);
  --theme-text-on-light: var(--black);
  --theme-text-on-dark: var(--black);
}

/* --------------------------------------------------
 :: SUBJECT TEXT COLOR CLASSES (Legacy Support)
 -------------------------------------------------- */
.mathematics { color: var(--md-red-400); }
.english { color: var(--md-light-blue-400); }
.french { color: var(--md-blue-400); }
.science { color: var(--md-deep-purple-400); }
.history { color: var(--md-amber-400); }
.geography { color: var(--md-green-400); }
.computing { color: var(--md-purple-400); }
.art-design { color: var(--md-pink-400); }
.pshe { color: var(--md-orange-400); }
.music { color: var(--md-pink-400); }
.foreign-languages { color: var(--md-deep-orange-400); }
.design-technology { color: var(--md-deep-purple-400); }
.citizenship { color: var(--md-lime-400); }
.religious-education { color: var(--md-deep-orange-400); }
.physical-education { color: var(--md-teal-400); }
.generic { color: var(--md-amber-400); }

/* --------------------------------------------------
 :: SUBJECT BARS
 -------------------------------------------------- */
.subject-bar {
  width: 6px;
  border-radius: 3px;
  background-color: var(--theme-primary);
}

/* --------------------------------------------------
 :: THEMED COMPONENTS
 -------------------------------------------------- */
.themed-text { color: var(--theme-primary); }
.themed-bg { background-color: var(--theme-primary); }
.themed-border { border-color: var(--theme-primary); }

/* --------------------------------------------------
 :: UNIVERSAL THEMED BUTTON STYLES
 -------------------------------------------------- */
.btn.btn-themed,
[class*="theme-"] .btn.btn-themed {
    background-color: var(--theme-primary);
    color: var(--theme-text-on-dark);
    box-shadow:
        inset 0 0 0 0.0625rem var(--theme-dark),
        inset 0 -0.25rem 0 var(--theme-dark);
}

.btn.btn-themed:hover,
[class*="theme-"] .btn.btn-themed:hover {
    background-color: var(--theme-dark);
    box-shadow:
        inset 0 0 0 0.0625rem var(--theme-dark),
        inset 0 -0.25rem 0 var(--theme-darker),
        0 0 0 0.2rem var(--theme-rgba);
}

.btn.btn-themed:active,
.btn.btn-themed:focus:active,
[class*="theme-"] .btn.btn-themed:active,
[class*="theme-"] .btn.btn-themed:focus:active {
    background-color: var(--theme-dark) !important;
    box-shadow:
        inset 0 0 0 0.0625rem var(--theme-dark),
        inset 0 0.125rem 0 var(--theme-darker);
}

.btn.btn-themed:disabled,
.btn.btn-themed.disabled,
[class*="theme-"] .btn.btn-themed:disabled,
[class*="theme-"] .btn.btn-themed.disabled {
    background-color: var(--theme-light);
    color: var(--theme-dark) !important;
    cursor: not-allowed;
    box-shadow:
        inset 0 0 0 0.0625rem var(--theme-light),
        inset 0 -0.25rem 0 var(--theme-primary);
    transform: none;
}

/* --------------------------------------------------
 :: DYNAMIC SUBJECT BUTTON CLASSES
 -------------------------------------------------- */

/* Mathematics buttons */
.btn.btn-mathematics,
.btn.btn-mathematics-statistics {
    background-color: var(--md-red-400);
    color: var(--white);
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-red-600),
        inset 0 -0.25rem 0 var(--md-red-600);
}
.btn.btn-mathematics:hover,
.btn.btn-mathematics-statistics:hover {
    background-color: var(--md-red-600);
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-red-600),
        inset 0 -0.25rem 0 var(--md-red-800),
        0 0 0 0.2rem rgba(239, 83, 80, 0.25);
}
.btn.btn-mathematics:active,
.btn.btn-mathematics:focus:active,
.btn.btn-mathematics-statistics:active,
.btn.btn-mathematics-statistics:focus:active {
    background-color: var(--md-red-600) !important;
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-red-600),
        inset 0 0.125rem 0 var(--md-red-800);
}
.btn.btn-mathematics:disabled,
.btn.btn-mathematics.disabled,
.btn.btn-mathematics-statistics:disabled,
.btn.btn-mathematics-statistics.disabled {
    background-color: var(--md-red-100);
    color: var(--md-red-600) !important;
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-red-100),
        inset 0 -0.25rem 0 var(--md-red-400);
}

/* English/Language buttons */
.btn.btn-english,
.btn.btn-languages-literacy {
    background-color: var(--md-light-blue-400);
    color: var(--white);
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-light-blue-600),
        inset 0 -0.25rem 0 var(--md-light-blue-600);
}
.btn.btn-english:hover,
.btn.btn-languages-literacy:hover {
    background-color: var(--md-light-blue-600);
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-light-blue-600),
        inset 0 -0.25rem 0 var(--md-light-blue-800),
        0 0 0 0.2rem rgba(41, 182, 246, 0.25);
}
.btn.btn-english:active,
.btn.btn-english:focus:active,
.btn.btn-languages-literacy:active,
.btn.btn-languages-literacy:focus:active {
    background-color: var(--md-light-blue-600) !important;
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-light-blue-600),
        inset 0 0.125rem 0 var(--md-light-blue-800);
}
.btn.btn-english:disabled,
.btn.btn-english.disabled,
.btn.btn-languages-literacy:disabled,
.btn.btn-languages-literacy.disabled {
    background-color: var(--md-light-blue-100);
    color: var(--md-light-blue-600) !important;
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-light-blue-100),
        inset 0 -0.25rem 0 var(--md-light-blue-400);
}

/* French buttons */
.btn.btn-french {
    background-color: var(--md-blue-400);
    color: var(--white);
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-blue-600),
        inset 0 -0.25rem 0 var(--md-blue-600);
}
.btn.btn-french:hover {
    background-color: var(--md-blue-600);
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-blue-600),
        inset 0 -0.25rem 0 var(--md-blue-800),
        0 0 0 0.2rem rgba(66, 165, 245, 0.25);
}
.btn.btn-french:active,
.btn.btn-french:focus:active {
    background-color: var(--md-blue-600) !important;
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-blue-600),
        inset 0 0.125rem 0 var(--md-blue-800);
}
.btn.btn-french:disabled,
.btn.btn-french.disabled {
    background-color: var(--md-blue-100);
    color: var(--md-blue-600) !important;
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-blue-100),
        inset 0 -0.25rem 0 var(--md-blue-400);
}

/* Science buttons */
.btn.btn-science,
.btn.btn-sciences {
    background-color: var(--md-deep-purple-400);
    color: var(--white);
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-deep-purple-600),
        inset 0 -0.25rem 0 var(--md-deep-purple-600);
}
.btn.btn-science:hover,
.btn.btn-sciences:hover {
    background-color: var(--md-deep-purple-600);
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-deep-purple-600),
        inset 0 -0.25rem 0 var(--md-deep-purple-800),
        0 0 0 0.2rem rgba(126, 87, 194, 0.25);
}
.btn.btn-science:active,
.btn.btn-science:focus:active,
.btn.btn-sciences:active,
.btn.btn-sciences:focus:active {
    background-color: var(--md-deep-purple-600) !important;
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-deep-purple-600),
        inset 0 0.125rem 0 var(--md-deep-purple-800);
}
.btn.btn-science:disabled,
.btn.btn-science.disabled,
.btn.btn-sciences:disabled,
.btn.btn-sciences.disabled {
    background-color: var(--md-deep-purple-100);
    color: var(--md-deep-purple-600) !important;
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-deep-purple-100),
        inset 0 -0.25rem 0 var(--md-deep-purple-400);
}

/* History/Humanities buttons */
.btn.btn-history,
.btn.btn-humanities-social-sciences {
    background-color: var(--md-amber-400);
    color: var(--black);
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-amber-600),
        inset 0 -0.25rem 0 var(--md-amber-600);
}
.btn.btn-history:hover,
.btn.btn-humanities-social-sciences:hover {
    background-color: var(--md-amber-600);
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-amber-600),
        inset 0 -0.25rem 0 var(--md-amber-800),
        0 0 0 0.2rem rgba(255, 202, 40, 0.25);
}
.btn.btn-history:active,
.btn.btn-history:focus:active,
.btn.btn-humanities-social-sciences:active,
.btn.btn-humanities-social-sciences:focus:active {
    background-color: var(--md-amber-600) !important;
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-amber-600),
        inset 0 0.125rem 0 var(--md-amber-800);
}
.btn.btn-history:disabled,
.btn.btn-history.disabled,
.btn.btn-humanities-social-sciences:disabled,
.btn.btn-humanities-social-sciences.disabled {
    background-color: var(--md-amber-100);
    color: var(--md-amber-600) !important;
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-amber-100),
        inset 0 -0.25rem 0 var(--md-amber-400);
}

/* Computing buttons */
.btn.btn-computing,
.btn.btn-technology-computing {
    background-color: var(--md-purple-400);
    color: var(--white);
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-purple-600),
        inset 0 -0.25rem 0 var(--md-purple-600);
}
.btn.btn-computing:hover,
.btn.btn-technology-computing:hover {
    background-color: var(--md-purple-600);
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-purple-600),
        inset 0 -0.25rem 0 var(--md-purple-800),
        0 0 0 0.2rem rgba(171, 71, 188, 0.25);
}
.btn.btn-computing:active,
.btn.btn-computing:focus:active,
.btn.btn-technology-computing:active,
.btn.btn-technology-computing:focus:active {
    background-color: var(--md-purple-600) !important;
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-purple-600),
        inset 0 0.125rem 0 var(--md-purple-800);
}
.btn.btn-computing:disabled,
.btn.btn-computing.disabled,
.btn.btn-technology-computing:disabled,
.btn.btn-technology-computing.disabled {
    background-color: var(--md-purple-100);
    color: var(--md-purple-600) !important;
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-purple-100),
        inset 0 -0.25rem 0 var(--md-purple-400);
}

/* Art buttons */
.btn.btn-art-design,
.btn.btn-arts-creative-expression {
    background-color: var(--md-pink-400);
    color: var(--white);
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-pink-600),
        inset 0 -0.25rem 0 var(--md-pink-600);
}
.btn.btn-art-design:hover,
.btn.btn-arts-creative-expression:hover {
    background-color: var(--md-pink-600);
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-pink-600),
        inset 0 -0.25rem 0 var(--md-pink-800),
        0 0 0 0.2rem rgba(236, 64, 122, 0.25);
}
.btn.btn-art-design:active,
.btn.btn-art-design:focus:active,
.btn.btn-arts-creative-expression:active,
.btn.btn-arts-creative-expression:focus:active {
    background-color: var(--md-pink-600) !important;
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-pink-600),
        inset 0 0.125rem 0 var(--md-pink-800);
}
.btn.btn-art-design:disabled,
.btn.btn-art-design.disabled,
.btn.btn-arts-creative-expression:disabled,
.btn.btn-arts-creative-expression.disabled {
    background-color: var(--md-pink-100);
    color: var(--md-pink-600) !important;
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-pink-100),
        inset 0 -0.25rem 0 var(--md-pink-400);
}

/* Generic/fallback buttons */
.btn.btn-generic,
.btn.btn-business-commerce,
.btn.btn-early-childhood-development,
.btn.btn-religious-moral-education,
.btn.btn-applied-vocational-studies {
    background-color: var(--md-amber-400);
    color: var(--black);
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-amber-600),
        inset 0 -0.25rem 0 var(--md-amber-600);
}
.btn.btn-generic:hover,
.btn.btn-business-commerce:hover,
.btn.btn-early-childhood-development:hover,
.btn.btn-religious-moral-education:hover,
.btn.btn-applied-vocational-studies:hover {
    background-color: var(--md-amber-600);
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-amber-600),
        inset 0 -0.25rem 0 var(--md-amber-800),
        0 0 0 0.2rem rgba(255, 202, 40, 0.25);
}
.btn.btn-generic:active,
.btn.btn-generic:focus:active,
.btn.btn-business-commerce:active,
.btn.btn-business-commerce:focus:active,
.btn.btn-early-childhood-development:active,
.btn.btn-early-childhood-development:focus:active,
.btn.btn-religious-moral-education:active,
.btn.btn-religious-moral-education:focus:active,
.btn.btn-applied-vocational-studies:active,
.btn.btn-applied-vocational-studies:focus:active {
    background-color: var(--md-amber-600) !important;
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-amber-600),
        inset 0 0.125rem 0 var(--md-amber-800);
}
.btn.btn-generic:disabled,
.btn.btn-generic.disabled,
.btn.btn-business-commerce:disabled,
.btn.btn-business-commerce.disabled,
.btn.btn-early-childhood-development:disabled,
.btn.btn-early-childhood-development.disabled,
.btn.btn-religious-moral-education:disabled,
.btn.btn-religious-moral-education.disabled,
.btn.btn-applied-vocational-studies:disabled,
.btn.btn-applied-vocational-studies.disabled {
    background-color: var(--md-amber-100);
    color: var(--md-amber-600) !important;
    box-shadow:
        inset 0 0 0 0.0625rem var(--md-amber-100),
        inset 0 -0.25rem 0 var(--md-amber-400);
}