:root {
    --bg: rgb(24, 24, 24);
    /* --button-bg: rgb(29, 29, 29); */
    --text: white;
    --hover: rgb(75, 75, 75);
    --hover-element: rgb(210, 210, 210);
    --border: rgba(255, 255, 255, 0.3);
    --shadow: rgba(255, 255, 255, 0.15);
    --accent: rgb(116, 192, 255);
}

body {
    background-color: var(--bg);
    color: var(--text);
}

/* Colors for light mode */
.light-mode {
    --bg: white;
    --text: rgb(41, 41, 41);
    --hover: rgb(241, 241, 241);
    --hover-element: rgb(86, 86, 86);
    --border: rgba(104, 104, 104, 0.3);
    --shadow: rgba(0, 0, 0, 0.15);
    --accent: rgb(0, 140, 255);
}

/* Top Navigation Bar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: row;
    justify-content: center; /* Horizontally center */
    align-items: center;    /* Vertically center */

    margin: 10px;

    /* Glass effect */
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    box-shadow: 0 4px 30px var(--shadow), inset 0 2px 10px var(--shadow);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid var(--border);
    
    /* Font */
    font-family: "Raleway", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
}

/* Theme toggle */
#theme-switch {
    border: none;
    outline: none;

    height: 2rem;
    width: 2rem;
    padding: 0;
    border-radius: 50%;
    background-color: var(--hover);
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    left: 10px;
}

#theme-switch:hover svg {
    cursor: pointer;
    fill: var(--hover-element);
}

#theme-switch svg {
    fill: var(--text);
}

#theme-switch svg:last-child {
    display: none;
}

.light-mode #theme-switch svg:first-child {
    display: none;
}

.light-mode #theme-switch svg:last-child {
    display: block;
}

/* Links inside the navbar */
.nav {
    color: var(--text);
    font-size: 16px;
    text-align: center;
    padding: 14px 10px;
    border-radius: 16px;
    
    text-decoration: none;

    transition: 0.2s ease-out;
}

/* The dropdown container */
.linksDropdown {
    float: left;
    overflow: hidden;
    
}

/* Dropdown button */
.linksDropdown .linksDropButton {
    border: none;
    outline: none;

    color: inherit;
    font-size: 16px;
    text-align: center;
    
    padding: 14px 10px;
    border-radius: 16px;
    margin: 0.2rem;
    text-decoration: none;

    background-color: inherit;
    font-family: inherit; /* Important for vertical align on mobile phones */
    font-weight: inherit;
    margin: 0; /* Important for vertical align on mobile phones */

    transition: 0.2s ease-out;
}

/* Navbar elements hover effect */
.navbar a:hover, .linksDropdown:hover .linksDropButton {
    background-color: var(--hover);
}

/* Dropdown content (hidden by default) */
.linksDropdownContent {
    display: none;
    position: absolute;
    
    background: var(--hover);
    
}

/* Links inside the dropdown */
.dropdown-link {
    text-decoration: none;
    color: var(--text); /* Sets your static color */
    font-family: inherit;
    padding: 12px 16px;
    
    display: flex; 
    position: relative; 
}

/* The Underline Setup */
.dropdown-link::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0); /* Start hidden (scaled to 0) */
    height: 2px; /* Thickness */
    
    bottom: 0;
    left: 0;
    background-color: var(--accent); /* Outline color */
    
    transform-origin: bottom center; 
    transition: transform 0.25s ease-out; 
}

a:hover::after {
    transform: scaleX(0.8); /* Scale to full width */
    cursor: pointer;
}

/* Show the dropdown menu on hover */
.linksDropdown:hover .linksDropdownContent {
    display: block;
    border-radius: 16px;
}

.container {
    
    margin: 0 auto;      /* centers horizontally */
    padding-inline: 20px;
    /*border: 1px solid #ccc;   /* Vertically center */
}

.container p {
    font-size: 2rem;
}

/* Collapsible buttpm */
.collapsible {
    background-color: var(--bg);
    cursor: pointer;
    border: none;
    outline: none;
    text-align: left;

    padding: 10px;
    margin-top: 21.44px;
    margin-bottom: 21.44px;
    border-radius: 1rem;

    /* Font */
    font-family: "Raleway", sans-serif;
    font-optical-sizing: auto;
    font-weight: 600;
    font-style: normal;
    font-size: 2em;
    color: inherit;
}

/* If you want an effect for when its collapsed */
/* .active, .collapsible:hover {
  background-color: var(--button-bg);
} */

.collapsible:hover {
    background-color: var(--hover);
}

.collapsible:after {
  content: '\002B';
  float: right;
  margin-left: 5px;
}

.active:after {
  content: "\2212";
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    
    
    padding-inline: 10px;
    transition: max-height 0.2s ease-out;
}

.collapsible-content a {
    color: var(--accent);
}

.container p {
    margin: 0;

    /* Font */
    font-family: "Raleway", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
}

.projectShowcase {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;

    padding-inline: 0px;
    justify-content: center;
    width: 100%;
    max-width: 324px;
    margin: 0 auto;
}

/* MOBILE font size */
@media (max-width: 710px) {
    .container p {
        font-size: 1rem !important;
    }
}

/* Medium screens (e.g., Tablets, small laptops) */
@media (min-width: 710px) {
    .projectShowcase {
        /* Changes to 2 equal-width columns */
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        max-width: 680px;
    }
    .container {
        width: 100%;
        max-width: 720px;
    }
}

/* Large screens (e.g., Desktops) */
@media (min-width: 1070px) {
    .projectShowcase {
        /* Changes back to the desired 3 equal-width columns */
        grid-template-columns: repeat(3, 1fr);
        /* You can optionally re-introduce a max-width if you want the grid to stop growing */
        gap: 20px;
        max-width: 1040px;
        /*margin: 0 auto; /* Center the entire grid container */
    }
    .container {
        width: 100%;          /* responsive */
        max-width: 1040px;    /* optional cap */
    }
}

.project {
    /* Fixed dimensions */
    width: 320px;
    height: 300px;
    
    border: 2px solid var(--border);
    /* Enables positioning of the text overlay */
    position: relative;
    /* Ensures the content (image) doesn't overflow the fixed dimensions */
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;

    /* Font */
    font-family: "Raleway", sans-serif;
    font-optical-sizing: auto;

    border-radius: 0.8rem;

    transition: 0.3s ease-out;
}

.project img {
    width: 100%;
    height: 135px;
    object-fit: cover;
    opacity: 50%;
}

.project-name {
    position: absolute;
    top: 0%;
    width: 320px;
    height: 135px;

    display: flex;
    justify-content: center; /* Horizontally center */
    align-items: center;    /* Vertically center */
    
    color: white;
    font-optical-sizing: auto;
    font-weight: 700;
    font-style: bold;
    font-size: 25px;

    text-shadow: 1px 1px 2px rgb(24, 24, 24);
}

.project-desc {
    position: absolute;
    top: 168px;
    width: 300px;
    height: 105px;
    
    margin: 8px;
    padding-inline: 4px;
    
    font-size: 13px;
    line-height: 1.4;
    text-align: left;
    font-weight: 400;
    
    color: var(--text);
    opacity: 0.85;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-source {
    position: absolute;
    bottom: 10px;
    left: 10px;
    
    display: flex;
    align-items: center;
    gap: 4px;
    
    font-size: 13px;
    font-weight: 500;
}

.project-source a {
    text-decoration: none;
    color: var(--text);
    display: inline-block;
    position: relative;
}

.project-tags {
    position: absolute;
    top: 135px;
    width: 300px;
    height: 25px;

    gap: 5px;

    margin: 8px;

    font-weight: 400;
    font-style: normal;

    text-shadow: none;
    
    display: flex;
    flex-wrap: wrap;
    /* justify-content: space-between; */
    align-items: center;    /* Vertically center */
    
}

.project-tags a {
    text-decoration: none;
    color: var(--text); /* Sets your static color */
    font-family: inherit;
    
    display: inline-block; 
    position: relative; 
}

#py {
    background-color: #c0a02d;
    color: #fff8da;
}

#cpp {
    background-color: #004482;
    color: #beddff;
}

#codecrafters {
    background-color: rgb(0, 95, 90);
    color: rgb(240, 253, 250);
}

#node-js {
    background-color: #82CD28;
    color: #005c00;
}

#github-actions {
    background-color: #222;
    color: #fff;
}

#go {
    background-color: #00ADD8;
    color: #f8feff;
}

#svelte {
    background-color: #FF3E00;
    color: #ffffff;
}

#js {
    background-color: #323330;
    color: #F0DB4F;
}

.project-tag {
    display: flex;
    align-items: center;
    /* Vertically centers children */
    justify-content: center;

    /* Adds space between the icon and text */
    gap: 2px;

    padding-left: 0.5rem;
    padding-right: 0.5rem;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;

    border-color: var(--border);
    border-width: 1px;
    border-style: solid;

    font-weight: bold;
    font-size: 0.65rem;
    line-height: 0.9rem;
    border-radius: 5rem;
    white-space: nowrap;
}

/* Hover Effect */
.project:hover {
  /*transform: translateY(-5px);*/
  border-color: var(--text);
  /* Enhances the shadow */
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}


.project:hover img {
    opacity: 25%;
}