body {
    background-color: navy;
    background-image: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url('Mathematics Arslan Khan.JPG');
    background-repeat: no-repeat;
    background-size: cover;
    font-optical-sizing: auto;
    background-attachment: fixed;
    font-weight: 600;
    font-size: large;
    font-style: normal;
    font-variation-settings: "width", 100;
    color: linen;
    text-align: justify;
    font-family: 'Orbitron', 'Segoe UI', 'Roboto', 'Arial', sans-serif;
}

img {
    border-radius: 8px;
}
h1, h2, h3 {
    text-align: center;
}
h1, h2, h3, h4 {
    font-weight: bold;
}

.carousel-inner img {
    border-radius: 8px;
}

.contemporary {
    background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url('Contemporary.png');
    background-repeat: no-repeat;
    background-size: cover;
    font-optical-sizing: auto;
    background-attachment: fixed;
}

.muslim {
    background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url('Muslim.jpg');
    background-repeat: no-repeat;
    background-size: cover;
    font-optical-sizing: auto;
    background-attachment: fixed;
}

.greek {
    background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url('Greek.jpg');
    background-repeat: no-repeat;
    background-size: cover;
    font-optical-sizing: auto;
    background-attachment: fixed;
}

.antiquity {
    background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url('Antiquity.jpg');
    background-repeat: no-repeat;
    background-size: cover;
    font-optical-sizing: auto;
    background-attachment: fixed;
}

.indian {
    background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url('Indian.jpg');
    background-repeat: no-repeat;
    background-size: cover;
    font-optical-sizing: auto;
    background-attachment: fixed;
}

.east-asian {
    background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url('Chinese.jpg');
    background-repeat: no-repeat;
    background-size: cover;
    font-optical-sizing: auto;
    background-attachment: fixed;
}

.russian {
    background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url('Russian.jpg');
    background-repeat: no-repeat;
    background-size: cover;
    font-optical-sizing: auto;
    background-attachment: fixed;
}

.renaissance {
    background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url('Renaissance.jpg');
    background-repeat: no-repeat;
    background-size: cover;
    font-optical-sizing: auto;
    background-attachment: fixed;
}

@font-face {
    font-family: "Kallisto";
    font-weight: 700;
    font-style: normal;
    src: url("/wp-content/themes/alanwalker/assets/fonts/Kallisto/Kallisto Bold.otf") format("opentype");
}

.carousel-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 624px;
    background-size: contain;
    margin-bottom: 50px;
}

.myslides {
    display: none;
    max-height: 100%;
    max-width: 100%;
}

.azerbaycan {
    background-color: white;
}

.navbar {
    display: flex;
    justify-content: center;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    align-content: space-around;
    overflow: hidden;
    background-color: rgba(80, 126, 182, 0.524);
    padding: 7.5px;
    margin-top: 10px;
    margin-bottom: 2.4px;
    text-align: center;
    border-radius: 8.24px;
}

.navbar a {
    color: khaki;
    background-color: navy;
    font-weight: bold;
    padding: 7.5px;
    position: relative;
    text-align: center;
    text-decoration: none;
    font-size: 20px;
    padding-left: 24px;
    padding-right: 24px;
    box-shadow: 5px 5px 5px 3px rgba(24, 24, 24, 0.404);
    border-radius: 24px;
    margin-left: 10% relative;
    margin-right: 10% relative;
    margin-bottom: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.navbar a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 0;
    background-color: orangered;
    transform: scaleY(0);
    transition: all 0.3s ease;
}

.navbar a:hover::after {
    transform: scaleY(1);
    height: 24%;
    border-radius: 24px;
}

.navbar a:hover {
    background-color: dodgerblue;
    color: white;
    transform: translateY(-4px);
}

.navbar a.active {
    background-color: orange;
    color: rgb(10, 50, 87);
}

/* Navbar layout fix */
.custom-navbar {
    justify-content: space-between;
}

/* Menu & Profile buttons reuse navbar capsule style */
.menu-btn,
.profile-btn {
    font-size: 26px;
    cursor: pointer;
}

/* Logo stays centered */
.logo-link {
    background: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: -24%;
    width: 24%;
    height: 100%;
    background-color: rgba(80, 126, 182, 0.524);
    transition: left 0.4s ease;
    z-index: 1050;
}

/* Sidebar links – same capsule style */
.sidebar a {
    display: block;
    margin: 15px auto;
    text-align: center;
}

/* Sidebar links reuse navbar styles */
.sidebar a {
    color: khaki;
    background-color: navy;
    font-weight: bold;
    padding: 7.5px;
    position: relative;
    text-align: center;
    text-decoration: none;
    font-size: 20px;
    padding-left: 24px;
    padding-right: 24px;
    box-shadow: 5px 5px 5px 3px rgba(24, 24, 24, 0.404);
    border-radius: 24px;
    margin-left: 10% relative;
    margin-right: 10% relative;
    margin-bottom: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.sidebar a::after{
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 0;
    background-color: orangered;
    transform: scaleY(0);
    transition: all 0.3s ease;
}

.sidebar a:hover::after {
    transform: scaleY(1);
    height: 24%;
    border-radius: 24px;
}

.sidebar a:hover {
    background-color: dodgerblue;
    color: white;
    transform: translateY(-4px);
}

.sidebar a.active {
    background-color: orange;
    color: rgb(10, 50, 87);
}


/* Mobile width */
@media (max-width: 768px) {
    .sidebar {
        width: 40%;
        left: -40%;
    }
}

#page-content {
    transition: margin-left 0.4s ease, width 0.4s ease;
    width: 100%;
}

/* When sidebar is open (desktop) */
#page-content.shift-desktop {
    margin-left: 24%;
    width: 76%;
}

/* When sidebar is open (mobile) */
#page-content.shift-mobile {
    margin-left: 40%;
    width: 60%;
}

/* Desktop */
@media (min-width: 769px) {
    #sidebar-backdrop.active {
        width: 76%;
        /* 100 - 24 */
    }
}

/* Mobile */
@media (max-width: 768px) {
    #sidebar-backdrop.active {
        width: 60%;
        /* 100 - 40 */
    }
}

/* Icon styling */
.navbar svg,
.sidebar svg {
    width: 22px;
    height: 22px;
    margin-right: 8px;
    vertical-align: middle;
}

/* Better tap targets */
.menu-btn,
.profile-btn {
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
}

.mather {
    background-color: navy;
    color: khaki;
    font-weight: bold;
    padding: 7.5px;
    text-align: center;
    border: 3px solid cornsilk;
}

.mather a {
    background-color: #006ac0;
    color: navy;
}

.mather a:hover {
    background-color: dodgerblue;
    color: white;
    border-style: outset;
}

#submit {
    background-color: black;
    color: green;
    border: 2px solid white;
    padding: 5px;
    font-weight: bold;
    font-family: 'Courier New', Courier, monospace;
}

.footer {
    bottom: 10px;
    right: 10px;
    width: 100%;
    background-color: rgb(0, 0, 66);
    color: rgb(212, 235, 255);
    text-align: center;
    padding: 7.5px;
    border: 2px solid white;
}

#link {
    color: rgb(212, 235, 255);
    font-size: medium;
}

form {
    border: 2px solid white;
}

#horse {
    border: 2px solid white;
}

#Mathematical_Clock {
    text-align: center;
    position: sticky;
    top: 0;
    padding: 10px;
    background-color: black;
    color: orange;
    font-weight: bolder;
    height: 60px;
    font-size: large;
    border-radius: 8.24px;
    z-index: 1024;
}

.card-body {
    color: khaki;
    background-color: rgba(2, 0, 107, 1);
}

.card-title {
    font-weight: bold;
    font-size: 24px;
}

.card-img-top {
    width: 100%;
    height: 88px;
    object-fit: contain;
    background-color: dodgerblue;
}

th,
td {
    background-color: navy;
    color: khaki;
    font-weight: bold;
    padding: 8.24px;
    border: 2.4px solid white;
    width: 50% absolute;
}

.Math-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.math-card {
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 64, 0.85);
    color: khaki;
    text-decoration: none;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.math-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65);
}

.math-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #002060;
}

.math-card-body {
    padding: 14px;
    text-align: center;
}

.math-card-body h3 {
    margin: 6px 0;
    font-size: 1.2rem;
    font-weight: bold;
}

.math-card-body .dates {
    font-size: 0.9rem;
    opacity: 0.85;
    margin-bottom: 8px;
}

.math-card-body .desc {
    font-size: 0.95rem;
    line-height: 1.4;
}

.math-card a {
    background-color: #001f3f;
    color: white;
    text-decoration: none;
    position: relative;
    inset: 0;
}

.math-card, .math-card:link,
.math-card:visited {
    color: #ffffff;
    /* normal link color */
    text-decoration: none;
}

.math-card:hover,
.math-card:active {
    color: orange;
    /* hover and active link color */
    text-decoration: none;
}

/* === Timelapse banner only === */
#elapsedBanner {
    text-align: center;
    padding: 12px 0;
    margin: 18px 0;
    font-size: clamp(1.2rem, 4vw, 2.4rem);
    font-weight: 700;
    color: #fff;
    background: rgba(0, 0, 0, 0.45);
    /* dark transparent background */
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

#elapsedBanner .orange {
    color: orange;
    font-size: xx-large;
    height: 324px;
}

button {
    cursor: pointer;
    color: khaki;
    background-color: navy;
    font-weight: bold;
    padding: 7.5px;
    position: relative;
    text-align: center;
    text-decoration: none;
    font-size: 20px;
    padding-left: 24px;
    padding-right: 24px;
    border: 3px solid cornsilk;
    box-shadow: 5px 5px 5px 3px rgba(128, 128, 128, 0.404);
    border-radius: 8.24px;
    margin-left: 10% relative;
    margin-right: 10% relative;
    margin-bottom: 10px;
}/* Style the container */
.mather {
    display: flex;
    flex-direction: column; /* Stack buttons vertically */
    gap: 10px; /* Add spacing between buttons */
    width: 100%; /* Ensure the container spans the full width */
    padding: 0;
    margin: 0;
    border: none;
    background-color: none;
}

/* Style the buttons */
.mather button {
    background: linear-gradient(145deg, #3046bd, #0b1c57); /* Gradient background */
    border: none; /* Remove default border */
    border-radius: 5px; /* Rounded corners */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3); /* Add shadow for depth */
    padding: 15px; /* Add padding for better spacing */
    width: 100%; /* Make buttons occupy the full width of the container */
    text-align: center; /* Center-align the text */
    cursor: pointer; /* Change cursor to pointer */
    transition: all 0.3s ease; /* Smooth transition for hover effects */
}

/* Style the links inside buttons */
.mather button a {
    text-decoration: none; /* Remove underline */
    color: #ffffff; /* Set text color */
    font-weight: bold; /* Make text bold */
    font-size: 1.1em; /* Slightly increase font size */
    display: block; /* Ensure the link spans the entire button */
}

/* Add hover effects for buttons */
.mather button:hover {
    background: linear-gradient(145deg, #0b1c57, #3046bd); /* Reverse gradient on hover */
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.5); /* Increase shadow depth */
    transform: translateY(-3px); /* Slightly lift the button */
}

/* Add hover effects for links */
.mather button a:hover {
    color: #003131;
}

:root {
    --sidebar-gap: 12px;
}

/* Desktop */
#page-content.shift-desktop {
    margin-left: calc(24% + var(--sidebar-gap));
    width: calc(76% - var(--sidebar-gap));
}

/* Mobile */
#page-content.shift-mobile {
    margin-left: calc(40% + var(--sidebar-gap));
    width: calc(60% - var(--sidebar-gap));
}

@media (max-width: 768px) {
    body.sidebar-open #page-content {
        filter: brightness(0.6);
        transition: filter 0.3s ease;
    }
}

@media (max-width: 768px) {
    #sidebar {
        width: 40%;
        left: -40%;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.4);
    }
}

#page-content {
    border-radius: 8px;
}

/* --- RESET --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Orbitron', 'Segoe UI', 'Roboto', 'Arial', sans-serif;
    background-color: #000824;
    /* Deepest Blue */
    color: #fff;
    min-height: 100vh;
}

/* --- LOADER SCREEN --- */
#loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000824;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s;
    opacity: 1;
    visibility: visible;
}

body.loaded #loader-wrapper {
    opacity: 0;
    visibility: hidden;
}

body.loading #main-content {
    opacity: 0;
}

body.loaded #main-content {
    opacity: 1;
    transition: opacity 1s ease-in;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Increased gap slightly because the loader is bigger now */
    gap: 40px;
}

/* --- NEW SCALING WRAPPER --- */
/* This safely makes the whole animation bigger without breaking the math */
.wobble-scale-wrapper {
    /* 1.3 makes it 30% bigger. Adjust this number as needed (e.g., 1.5 for 50%) */
    transform: scale(1.3);
    /* Ensure it doesn't overlap text due to scaling */
    margin-bottom: 10px;
}


/* --- WOBBLE ANIMATION (Thinner tracks) --- */
.wobble-loader {
    width: calc(100px - 14px);
    height: 50px;
    border-radius: 50px;

    /* UPDATE FOR THINNER LOOP:
       I changed '15px' to '14.5px' in the gradients below. 
       This reduces the thickness of the line from 1px to 0.5px.
    */
    background:
        radial-gradient(farthest-side, #0000 calc(100% - 14.5px), rgba(255, 255, 255, 0.2) calc(100% - 14px) 99%, #0000) left,
        radial-gradient(farthest-side, #0000 calc(100% - 14.5px), rgba(255, 255, 255, 0.2) calc(100% - 14px) 99%, #0000) right;

    background-size: calc(50% + 7px) 100%;
    background-repeat: no-repeat;
    position: relative;
    animation: l10-0 1s infinite linear;
}

.wobble-loader:before {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    transform-origin: -14px 50%;
    animation: l10-1 0.5s infinite linear;
}

@keyframes l10-0 {

    0%,
    49.99% {
        transform: scaleX(1)
    }

    50%,
    100% {
        transform: scaleX(-1)
    }
}

@keyframes l10-1 {
    100% {
        transform: rotate(1turn)
    }
}

/* --- TEXT --- */
.loading-text {
    color: #fff;
    font-size: 1.2rem;
    letter-spacing: 2px;
    font-weight: bold;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}