/* GDES306 | MMDD253 - Coding Your Portfolio     */
/* Extra small devices (phones, less than 600px) */
/* No media query since this is the default CSS */

/* Basic page styling */
:root {
    /* Updated color scheme inspired by fontpair.co */
    --black: #1a1a1a;
    --dark-grey: #2c2c2c;
    --mid-grey: #6b6b6b;
    --light-grey: #a0a0a0;
    --extra-light-grey: #f7f7f7;
    --white: #ffffff;
    --accent-colour: #5e72e4;
    /* Soft blue accent */
    --secondary-accent: #f5f5f5;
    --border-color: #e0e0e0;
    --headline-font: "Sora", sans-serif;
    --body-font: "Geist", sans-serif;
    --horizontal-shift: 6px;
    --section-padding-top: 60px;
}

* {
    margin: 0;
    padding: 0;
    transition: 0.5s;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--body-font);
    background: var(--white);
    color: var(--dark-grey);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--headline-font);
    color: var(--black);
}

h1 {
    font-size: calc(40px + (72 - 40) * (100vw - 400px) / (1800 - 400));
}

h2 {
    font-size: calc(32px + (48 - 32) * (100vw - 400px) / (1800 - 400));
    margin-bottom: 1.5rem;
}

h3 {
    font-size: calc(20px + (28 - 20) * (100vw - 400px) / (1800 - 400));
}

p {
    font-size: calc(18px + (24 - 18) * (100vw - 400px) / (1800 - 400));
    margin-bottom: 2rem;
    color: var(--dark-grey);
    line-height: 1.6;
}

a {
    font-size: calc(18px + (24 - 18) * (100vw - 400px) / (1800 - 400));
    text-decoration: none;
    color: var(--accent-colour);
    transition: color 0.3s ease;
}

a:visited {
    color: var(--black);
}

a:hover {
    color: var(--black);
}

hr {
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.btn {
    background-color: var(--accent-colour);
    border: none;
    color: var(--white);
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: calc(16px + (20 - 16) * (100vw - 400px) / (1800 - 400));
    width: fit-content;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.btn:hover {
    background-color: var(--black);
    color: var(--white);
    padding-left: calc(32px + var(--horizontal-shift));
    transform: translateY(-2px);
}

.btn:visited {
    color: var(--white);
}

.btn:hover:visited {
    color: var(--white);
}

img {
    width: 100%;
}

/* Styling the Navigation */
header {
    position: fixed;
    width: 100%;
    z-index: 10;
    border-bottom: 1px solid var(--border-color);
    background: var(--white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

nav {
    overflow: hidden;
    background: var(--white);
    height: 50px;
}

.navexpanded {
    height: 220px;
}

nav ul {
    display: flex;
    list-style-type: none;
    flex-wrap: wrap;
    text-align: center;
}

nav ul>li {
    margin-top: 14px;
    flex-basis: 100%;
}

nav ul li a {
    text-decoration: none;
    color: var(--dark-grey);
    margin: 20px;
    font-weight: 500;
    font-size: calc(14px + (16 - 14) * (100vw - 400px) / (1800 - 400));
}

nav ul li a:hover {
    text-decoration: none;
    color: var(--accent-colour);
    background: transparent;
}

#logo {
    margin-right: auto;
    flex-basis: 50%;
    text-align: left;
}

#logo span {
    color: var(--black);
    font-family: var(--headline-font);
    font-weight: 900;
}


#menu-icon,
#close-icon {
    margin-left: auto;
    flex-basis: 50%;
    text-align: right;
    font-size: 30px;
    margin-top: 0px;
}

#menu-icon a,
#close-icon a {
    color: var(--dark-grey);
}

#close-icon {
    display: none;
}

.navexpanded #close-icon {
    display: inline-block;
}

.navexpanded #menu-icon {
    display: none;
}

#logo a:hover,
#menu-icon a:hover,
#close-icon a:hover {
    background: none;
}

ul {
    list-style: circle;
    margin-left: 20px;
    color: var(--dark-grey);
}

ul li {
    padding: 0.25rem 0;
}


/* Styling for the Sections */
section {
    display: grid;
    padding-top: var(--section-padding-top);
    grid-template-columns: 5% 1fr 5%;
    align-content: start;
    background: var(--white);
    padding: 50px 0 0 0;
}

section>* {
    grid-column: 2;
}

.two-columns {
    display: grid;
    grid-template-columns: 1fr;
    grid-gap: 2rem;
    margin-bottom: 2rem;
}

.two-columns-fixed {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 2rem;
    margin-bottom: 2rem;
}

.three-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 2rem;
    margin-bottom: 2rem;
}

.featured {
    grid-column: 1/-1;
}

.auto-height {
    min-height: auto;
}


/* Styling for the Introduction */
#introduction {
    align-content: center;
    background: var(--extra-light-grey);
}

/* Portfolio Section */
#puzzles {
    background: var(--white);
}

#puzzles a {
    color: var(--black);
    transition: all 0.3s ease;
}

#puzzles a:hover {
    color: var(--accent-colour);
}

#puzzles a:hover h3,
#puzzles a:hover p {
    padding-left: var(--horizontal-shift);
}

#puzzles h3 {
    color: var(--black);
    margin-bottom: 0.5rem;
}

/*#puzzles p {
    color: var(--mid-grey);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}*/

/* Tutorial Cards */
.tutorials {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 2rem;
    color: var(--black);
}

.filter-tabs {
    display: flex;
    gap: 1rem;
}

.filter-tab {
    padding: 0.5rem 1rem;
    background: var(--extra-light-grey);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--dark-grey);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tab.active,
.filter-tab:hover {
    background: var(--accent-colour);
    border-color: var(--accent-colour);
    color: white;
}

.tutorial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.tutorial-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tutorial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: var(--accent-colour);
}

.tutorial-thumbnail {
    position: relative;
    height: 290px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.play-button {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tutorial-card:hover .play-button {
    transform: scale(1.1);
    background: var(--accent-colour);
}

.play-button::after {
    content: '▶';
    color: var(--dark-grey);
    font-size: 1.5rem;
    margin-left: 5px;
}

.tutorial-card:hover .play-button::after {
    color: white;
}

.difficulty-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.difficulty-beginner {
    background: #10b981;
    color: white;
}

.difficulty-intermediate {
    background: #f59e0b;
    color: white;
}

.difficulty-advanced {
    background: #ef4444;
    color: white;
}

.tutorial-content {
    padding: 1.5rem;
}

.tutorial-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--mid-grey);
}

.tutorial-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.tutorial-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--black);
}

.tutorial-description {
    color: var(--dark-grey);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.tutorial-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    padding: 0.25rem 0.75rem;
    background: var(--extra-light-grey);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    font-size: 0.75rem;
    color: var(--dark-grey);
    transition: all 0.3s ease;
}

.tag:hover {
    background: var(--accent-colour);
    border-color: var(--accent-colour);
    color: white;
}

/* About Section */
#about {
    background: var(--white);
}


#about .two-columns-fixed p {
    font-size: initial;
}


/* Styling the Contact section */
#contact {
    min-height: auto;
    background: var(--dark-grey);
    padding-bottom: 50px;
}

#contact h2 {
    color: var(--white);
}

#contact p {
    color: var(--light-grey);
}

#contact ul {
    display: flex;
    list-style-type: none;
    margin-bottom: 1rem;
}

#contact ul li a {
    text-decoration: none;
    color: var(--dark-grey);
    margin: 0 20px 0 0;
    font-size: 32px;
    transition: color 0.3s ease;
}

#contact ul li a:hover {
    text-decoration: none;
    color: var(--accent-colour);
}

#contact .btn:hover {
    background-color: var(--white);
    color: var(--black);
}

/* Code block styling */
pre {
    background: #1a1a1a;
    color: #f0f0f0;
    padding: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    margin: 1.5rem 0;
    font-family: "Courier New", monospace;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
}

code {
    background: #f0f0f0;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: "Courier New", monospace;
    font-size: 1rem;
}

pre code {
    background: none;
    padding: 0;
}

.code-section {
    margin: 2rem 0;
}

.code-section h4 {
    margin-bottom: 1rem;
    color: var(--accent-colour);
}

/* Syntax highlighting */
.keyword {
    color: #ff79c6;
}

.string {
    color: #f1fa8c;
}

.comment {
    color: #6272a4;
    font-style: italic;
}

.function {
    color: #50fa7b;
}

.number {
    color: #bd93f9;
}

.variable {
    color: #8be9fd;
}

/* Component list styling */
.component-list {
    background: var(--extra-light-grey);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.component-list ul {
    list-style-type: none;
    padding: 0;
}

.component-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.component-list li:last-child {
    border-bottom: none;
}

/* Step styling */

.step-number {
    display: inline-block;
    width: 30px;
    height: 30px;
    background: var(--accent-colour);
    color: white;
    text-align: center;
    line-height: 30px;
    border-radius: 50%;
    margin-right: 1rem;
    font-weight: bold;
}

/* Warning box */
.warning-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 1rem;
    margin: 1.5rem 0;
}

.warning-box::before {
    content: "⚠️ ";
    font-size: 1.2em;
}

/* Info box */
.info-box {
    background: #d1ecf1;
    border: 1px solid #17a2b8;
    border-radius: 8px;
    padding: 1rem;
    margin: 1.5rem 0;
}

.info-box::before {
    content: "ℹ️ ";
    font-size: 1.2em;
}

main ul {
    margin: 20px;
}

/* Small devices (i.e. tablets in portrait) */
@media (min-width: 600px) {
    nav {
        height: 50px;
    }

    .navexpanded {
        height: 50px;
    }

    .navexpanded #close-icon {
        display: none;
    }

    nav ul {
        flex-direction: row;
        align-items: baseline;
    }

    nav ul>li {
        flex-basis: auto;
    }

    #logo {
        flex-basis: auto;
    }

    #menu-icon {
        display: none;
    }

    section {
        grid-template-columns: 15% 1fr 15%;
    }


}

/* Medium devices (i.e. tablets in landscape */
@media (min-width: 900px) {}

/* Large devices (i.e. desktop) */
@media (min-width: 1200px) {
    .two-columns {
        grid-template-columns: 1fr 1fr;
    }

    .three-columns {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* X-Large devices (i.e. big desktop) */
@media (min-width: 1800px) {}