/* =========================================================
   Global layout and background (light mode)
   ========================================================= */

body {
    margin: 0;
    padding: 0;

    /* Mathematical SVG background (light mode only) */
    background-image: url("bg_math.svg");
    background-size: 600px;
    background-repeat: repeat;
    background-attachment: fixed;

    /* Fallback background color */
    background-color: #f9fbfe;

    /* Base font for the site */
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    color: #111827; /* dark gray text */
}

/* Main centered “card” that holds the content on every page */
.main-wrapper {
    max-width: 1130px;            /* limit width for readability */
    margin: 3rem auto;           /* center horizontally + vertical margin */
    padding: 3rem 2.5rem 3rem;   /* inner spacing */
    background: rgba(255, 255, 255, 0.92);
    border-radius: 20px;	/*stroggulemenes gwnies tou plaisiou ths istoselidas*/
    box-shadow: 0 0 22px rgba(0, 0, 0, 0.06);
    /* NEW: so absolutely-positioned children are relative to this box */
    position: relative;
}

/* =========================================================
   Headings and basic typography
   ========================================================= */

.title {
    font-size: 2.6rem;
    margin: 0 0 0.3rem 0;
}

.subtitle {
    font-size: 1.1rem;
    color: #4b5563; /* muted gray */
    margin-top: 0;
}

h1, h2 {
    margin-top: 0;
}

/* =========================================================
   Top navigation bar (with math under each tab)
   ========================================================= */

.top-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.8rem;
    margin-bottom: 1.8rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.75rem;
}

/* Navigation item */
.nav-item {
    position: relative;
    text-decoration: none;
    color: #111827;
    padding: 0.45rem 0.95rem;
    border-radius: 10px;

    display: flex;
    flex-direction: column;
    align-items: flex-start;

    background: #edf2ff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

/* ===== Option A: simple sweeping underline (inactive tabs only) ===== */

.nav-item {
  position: relative; /* required for ::after positioning */
}

/* Create the green line (hidden by default) */
.nav-item:not(.active)::after {
  content: "";
  position: absolute;

  /* place it near the bottom inside the tab */
  left: 10px;
  right: 10px;
  bottom: 6px;

  height: 2px;
  border-radius: 999px;
  background: #22c55e;

  /* start invisible (collapsed) */
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease;
  pointer-events: none;
}

/* On hover: expand the line */
.nav-item:not(.active):hover::after {
  transform: scaleX(1);
}


/* Hover background (NO animation here) */
.nav-item:hover {
    background: #dbe4ff;
    transform: translateY(-1px);
}

/* Active tab */
.nav-item.active {
  background-color: #4CAF50; /* Green background */
  color: white;
}

/* Label + equation */
.nav-label {
    font-weight: 600;
    font-size: 0.95rem;
}

.nav-eq {
    font-size: 0.8rem;
    opacity: 0.85;
    font-family: "STIX Two Math", "Times New Roman", serif;
    width: 100%;
    text-align: center		/*Place the equation in the center*/
}


/* =========================================================
   Top-right scientific quote box (image + text)
   ========================================================= */

/* Container for the quote + image */
.quote-box {
    position: absolute;    /* stick to the top-right inside main-wrapper */
    top: 1.5rem;
    right: 1.5rem;

    display: flex;
    align-items: center;
    gap: 0.6rem;

    max-width: 260px;
    padding: 0.4rem 0.6rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 999px; /* pill shape */
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    font-size: 0.8rem;
}

/* Small circular portrait (Einstein, Feynman, etc.) */
.quote-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* Quote text */
.quote-text {
    margin: 0;
    font-style: italic;
    color: #374151;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .quote-box {
        background: rgba(17, 24, 39, 0.95);
        box-shadow: 0 2px 10px rgba(0,0,0,0.8);
    }

    .quote-text {
        color: #e5e7eb;
    }
}

/* Responsive: on small screens, don't overlay the header */
@media (max-width: 768px) {
    .quote-box {
        position: static;    /* no longer fixed in the corner */
        margin-top: 0.8rem;
        margin-bottom: 0.4rem;
        align-self: flex-end;
    }
}


/* =========================================================
   Homepage hero section (photo + formulas + intro)
   ========================================================= */

.hero {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-top: 2rem;
}

/* Portrait (currently uses rubiks.png as placeholder) */
.profile-photo {
    width: 220px;
    height: 220px;
    border-radius: 50%;  /* circle */
    object-fit: cover;   /* fill the circle nicely */
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
    flex-shrink: 0;
}

/* Right-hand side text in the hero */
.hero-text {
    flex: 1;
}

/* Main equation in hero */
.eq {
    font-size: 2rem;
    color: #003366;   /* dark blue */
    margin: 0;
}

/* Smaller equation in hero and other places */
.eq-small {
    color: #003366;
    opacity: 0.8;
    margin-top: 0.3rem;
    font-family: "STIX Two Math", serif;
}

/* Short introduction paragraph */
.intro {
    margin-top: 0.9rem;
    line-height: 1.6;
    color: #1f2933;
}

/* ClusterMaps */
.visitor-map{
  margin-top: 1rem;
  display: flex;
  justify-content: center;
}
/* =========================================================
   Homepage: big navigation cards
   ========================================================= */

.nav-cards {
    margin-top: 3rem;
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;  /* wrap when not enough width */
}

/* =========================================================
   Animated graph section (random network in motion)
   ========================================================= */

/* Wrapper for the animated graph on the homepage */
.graph-section {
    margin-top: 3rem;
}

/* Title above the animated graph */
.graph-title {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
}

/* Responsive canvas for the animated graph */
.graph-canvas {
    width: 100%;          /* canvas width follows the main-wrapper width */
    height: 260px;        /* visual height in CSS pixels */
    border-radius: 16px;
    display: block;

    /* Soft background gradient behind the graph */
    background: radial-gradient(circle at top left, #e5f0ff, #f9fbfe);
    border: 1px solid #d0e0ff;
}

/* Dark mode background tweak for the canvas */
@media (prefers-color-scheme: dark) {
    .graph-canvas {
        background: radial-gradient(circle at top left, #111827, #020617);
        border-color: #1f2937;
    }
}



/* Each card linking to another page */
.card {
    background: #e6eef9;
    color: #003366;
    padding: 0.9rem 1.4rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.18s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
}

.card:hover {
    background: #cddcf2;
    transform: translateY(-2px);
}

/* =========================================================
   Generic section styling (used on inner pages)
   ========================================================= */

.block {
    margin-top: 2rem;
    padding-bottom: 1.4rem;
    border-bottom: 1px solid #e5e7eb;
}

/* =========================================================
   Link styling
   ========================================================= */

a {
    color: #1f4acc;   /* blue for links */
}

a:hover {
    color: #16338f;
}

/* =========================================================
   Dark mode (automatic, using system preference)
   ========================================================= */

@media (prefers-color-scheme: dark) {
    body {
        /* In dark mode, we skip the bright SVG background
           and use a dark plain color instead. */
        background-image: none;
        background-color: #050816;
        color: #e5e7f5;
    }

    .main-wrapper {
        background: rgba(10, 15, 30, 0.96);
        box-shadow: 0 0 26px rgba(0, 0, 0, 0.85);
    }

    .subtitle {
        color: #c3cffb;
    }

    .eq,
    .eq-small {
        color: #a5c4ff;
    }

    .intro {
        color: #e5e7f5;
    }

    .card {
        background: #141b3f;
        color: #dbe2ff;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    }

    .card:hover {
        background: #1e2956;
    }

    .block {
        border-bottom-color: #374151;
    }

    a {
        color: #a5b8ff;
    }

    a:hover {
        color: #c7d3ff;
    }

    .profile-photo {
        box-shadow: 0 10px 26px rgba(0, 0, 0, 0.9);
    }

    .top-nav {
        border-bottom-color: #374151;
    }

    .nav-item {
        background: #0f172a;
        color: #e5e7f5;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
    }

    .nav-item:hover {
        background: #111827;
        box-shadow: 0 2px 7px rgba(0, 0, 0, 0.9);
    }

    .nav-item.active {
        background: #1d2954;
        box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.4);
    }

    .nav-eq {
        color: #a5b4fc;
    }
}

/* =========================================================
   Responsive layout (tablet and mobile)
   ========================================================= */

/* Medium screens: slightly smaller margins and fonts */
@media (max-width: 768px) {
    .main-wrapper {
        margin: 1.5rem;
        padding: 1.5rem 1.4rem 2.3rem;
	align-items: center;
    }

    .title {
        font-size: 2.2rem;
    }

    .subtitle {
        font-size: 1rem;
    }
}

/* Small screens (tablets / large phones) */
@media (max-width: 768px) {
    .hero {
        flex-direction: column;  /* stack photo over text */
        align-items: center;
        text-align: center;
    }

    .profile-photo {
        width: 180px;
        height: 180px;
        margin-bottom: 0.6rem;
    }
    
    .hero-text {
        width: 100%;
    }

    .nav-cards {
        flex-direction: column;
        align-items: stretch;
    }

    .card {
        text-align: center;
        width: 100%;
        justify-content: center;
    }

    .top-nav {
        justify-content: center;
    }

    .nav-item {
        align-items: center; /* center label + equation */
    }
}

/* Very small screens (phones) */
@media (max-width: 480px) {
    .main-wrapper {
        margin: 0.8rem;
        padding: 1.2rem 1rem 2rem;
        border-radius: 0.75rem;
    }

    .title {
        font-size: 1.9rem;
    }

    .profile-photo {
        width: 150px;
        height: 150px;
    }

    .eq {
        font-size: 1.6rem;
    }

    .eq-small {
        font-size: 0.9rem;
    }

    .top-nav {
        gap: 0.5rem;
    }

    .nav-item {
        padding: 0.3rem 0.7rem;
    }

    .nav-label {
        font-size: 0.9rem;
    }

    .nav-eq {
        font-size: 0.75rem;
    }
}
/* Footer counter */
.site-footer{
  margin: 2rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.15);
  text-align: center;
}

.visitor-map{
  display: flex;
  justify-content: center;
  margin-top: 0.75rem;
}

