* { /* some default settings */
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Times New Roman', Times, serif;
}

body {
    background: #0f0f0f;
    color: #e6e6e6;
}

/* Main container section */
.container { /* main container for both panels */
    display: flex;
    height: 100vh;
    position: relative;
}

.container::after { /* Golden bar divider between left and right panel */
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 45%;
    width: 2px;
    z-index: 2; /* added because of particles */
    background: linear-gradient(
        to bottom,
        #2c220d,
        #7d6424,
        #2c220d
    );
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

/* Left Panel Section*/
.left-panel {
    width: 45%;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: sticky; /* when you scroll down, it sticks to the side */
    top: 0;
    z-index: 2;
}

/* Dark mode button */

.dark-mode-button {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 20px;
    background: #2c220d;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 2px;
    z-index: 5;
    transition: background 0.3s ease;
}

.dark-mode-button::before {
    content: "";
    width: 16px;
    height: 16px;
    background: #d4af37; /* knob color matches gold */
    border-radius: 50%;
    transition: transform 0.3s ease, background 0.3s ease;
}

/* Hover effect */
.dark-mode-button:hover {
    background: #7d6424;
}

/* Profile Pic section */
.profile-pic {
    width: 200px;
    height: 200px;
    border-radius: 35%; /* Dont really want profile picture to be too circular. may change later */
    object-fit: cover;
    display: block;
    z-index: 1;
}

.profile-pic-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin-bottom: 50px;
    z-index: 1;
}

/* darkening border of profile picture - kinda works? */

.profile-pic-container::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 35%;
    z-index: 1;

    background: radial-gradient(
        circle,
        rgba(0,0,0,0.15) 20%, /* RGBA colour as normal, percentage is gradient amount */
        rgba(0,0,0,0.65) 75%,
        rgba(0,0,0,0.85) 100%
    );
    pointer-events: none;
}

/* Biography Container section */

.bio-container {
    max-width: 65%;
    text-align: center;
    z-index: 1;
}

.bio-container p { /* makes name pop out a little more by making the title less opaque */
    opacity: 45%;
    z-index: 1;
}

/* Ticker Stuff */

.ticker-wrapper {
    width: 35%;
    overflow: hidden;
    margin-top: 25%;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.ticker {
    display: flex;
    width: max-content;
    animation: ticker-scroll 20s linear infinite;
    z-index: 1;
}

.ticker-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    z-index: 1;
}

.ticker-item img {
    width: 34px;
    height: 34px;
    opacity: 0.8;
    transition: transform 0.2s ease, opacity 0.2s ease;
    z-index: 1;
}

/* infinite scroll animation */

@keyframes ticker-scroll {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

/* Socials container */

.social-container { /* this is located at the bottom of the left panel */
    margin-top: auto;
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    gap: 25%;
    width: 100%;
    position: relative;
    padding-top: 25px;
}

.social-container::before { /* added a gradient at the top of the social container, similar to the divider, just to add more */
    content: "";
    position: absolute;
    top: 0;
    width: 100%;
    height: 2px;

    background: linear-gradient(
        to right,
        #2c220d,
        #7d6424,
        #2c220d
    );

    box-shadow: 0 0 6px rgba(255, 215, 0, 0.4);
}

.social-icon { /* defaults for each icon used. */
    width: 32px;
    height: 32px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.social-icon:hover { /* added flavour for when cursor is over an icon */
    transform: scale(1.1);
    opacity: 0.8;
}

/* Particles */

#particles-left {
    position: absolute;
    top: 0;
    left: 0;
    width: 45%; /* same width as left panel */
    height: 100%;
    z-index: 1; /* behind everything */
    pointer-events: none; /* clicks pass through */
}

/* Right panel section*/

.right-panel {
    width: 55%;
    padding: 40px;
    overflow-y: auto;
    background: #181818;
    z-index: 2;
}

.download-container { /* Same as social container, but doesn't have golden divider - only used for CV download container */
    margin-top: auto;
    display: flex;
    padding-bottom: 15px;
    justify-content: center;
    width: 100%;
    position: relative;
    padding-top: 10px;
}

.section {
    position: relative;
    margin-top: 0; /* remove any margin affecting top */
    padding-top: 20px; /* optional: space below the top divider */
}

.section:not(:first-child)::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;

    background: linear-gradient(
        to right,
        #2c220d,
        #7d6424,
        #2c220d
    );

    box-shadow: 0 0 6px rgba(255, 215, 0, 0.4);
}

.section h2 {
    margin-top: 0; /* remove default top margin */
    padding-top: 10px; /* optional spacing between divider and header */
}

.section p {
    padding-bottom: 30px;
    opacity: 0.75; /* fixed opacity */
}

/* Github Portfolio Styling */

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.project-header h3 {
    margin: 0;
}

.project-header a {
    color: #d4af37;
    text-decoration: none;
    font-size: 0.9rem;
}

.project-header a:hover {
    text-decoration: underline;

}

.project-screenshot-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;

    display: flex;
    flex-direction: column;   /* stack items vertically */
    align-items: center;      /* keep screenshot centered */
}

.project-screenshot-container p {
    margin-top: 10px;
    max-width: 90%;
}

.project-screenshot {
    width: 100%;
    max-width: 90%;
    border-radius: 6px;
    margin: 12px 0;
    border: 2px solid transparent;
    background:
        linear-gradient(#111, #111) padding-box,
        linear-gradient(to right, #2c220d, #7d6424, #2c220d) border-box;
}

.project-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.project-card {
    background: #111;
    padding: 20px;
    border-radius: 8px;
    position: relative;
    overflow: hidden; /* hides overflow bar above each portfolio project */
}

.project-card:last-child {
    margin-bottom: 30px;
}

.project-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 2px;
    width: 100%;

    background: linear-gradient(
        to right,
        #2c220d,
        #7d6424,
        #2c220d
    );

    box-shadow: 0 0 4px rgba(255, 215, 0, 0.25);
    opacity: 0.35;

    transition: opacity 0.25s ease, box-shadow 0.25s ease;
}

/* Hover effects for portfolio */

.project-card:hover .project-screenshot-container {
    max-height: 1000px;
}

.project-card:hover::before {
    opacity: 1;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

.project-card h3 {
    margin-bottom: 8px;
}

.project-card p {
    opacity: 0.75;
    margin-bottom: 10px;
}

.project-card a {
    color: #d4af37;
    text-decoration: none;
    font-size: 0.9rem;
}

.project-card a:hover {
    text-decoration: underline;
}

/* Light mode Stuff */

body.light-mode .dark-mode-button {
    background: #7b5cff; /* purple track */
}

body.light-mode .dark-mode-button::before {
    background: #a987fa; /* knob color */
    transform: translateX(20px); /* slide knob to right */
}

body.light-mode {
    background: #d1d1d1;  /* main body background */
    color: #3c0d5b; /* dark purple text */
}

body.light-mode .left-panel {
    color: #3c0d5b;
}

body.light-mode .right-panel {
    background: #e9e9e9;
    color: #3c0d5b;
}

/* Golden dividers -> purple dividers */
body.light-mode .container::after,
body.light-mode .social-container::before,
body.light-mode .section:not(:first-child)::before,
body.light-mode .project-card::before {
    background: linear-gradient(
        to bottom,
        #a987fa,
        #7b5cff,
        #a987fa
    );
    box-shadow: 0 0 8px rgba(123, 92, 255, 0.5);
}

body.light-mode .project-header a,
body.light-mode .project-card a {
    color: #7b5cff;
}

body.light-mode .project-card {
    background: #d1d1d1;
}

body.light-mode .project-screenshot {
    background:
        linear-gradient(#f8f8f8, #f8f8f8) padding-box,
        linear-gradient(to right, #a987fa, #7b5cff, #a987fa) border-box; /* match divider color */
}

/* Smaller Screen Section */
/* When using website on phone, it wont look good, so this is to help that */

@media screen and (max-width: 568px) {

  /* Make container vertical */
  .container {
    flex-direction: column;
    height: auto; /* let it grow with content */
    position: relative;
  }

  /* Move divider below socials instead of vertical */
  .container::after {
    top: auto;
    bottom: 30px; /* position just above the bottom padding or socials */
    left: 0;
    width: 100%;
    height: 2px;
    box-shadow: 0 0 6px rgba(255, 215, 0, 0.5);
  }

  /* Left panel full width */
  .left-panel {
    width: 100%;
    height: auto;
    position: relative;
    top: auto;
    padding: 20px;
    margin-bottom: 20px;
  }

  /* Keep particle effects absolute inside left panel */
  #particles-left {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200px; /* reduce height for mobile, can adjust */
  }

  /* Right panel full width, stacked below left panel */
  .right-panel {
    width: 100%;
    padding: 20px;
    overflow: visible; /* no scroll inside panel, body scroll works */
    margin-bottom: 30px;
  }

  /* Adjust ticker for mobile */
  .ticker-wrapper {
    width: 40%;
    margin-top: 20px;
    margin-bottom: 20px;
  }

  /* Social container full width */
  .social-container {
    width: 100%;
    justify-content: space-around;
    margin-bottom: 20px;
  }

  /* Adjust profile and bio containers */
  .profile-pic-container {
    width: 150px;
    height: 150px;
    margin-bottom: 30px;
    z-index: 2;
  }

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

  .bio-container {
    max-width: 90%;
  }

  /* Portfolio: automatically expand all screenshots */
  .project-screenshot-container {
    max-height: 1000px !important; /* force open */
  }
}
