/* Base Color Definitions for Light Theme */
:root {
    --page-color: #e5e4e4;
    --background-color: #F3F4F6;
    --background-color-inverted: #1E1E1E;
    --text-color: #333;
    --link-color: #007BFF;
    --link-color-hover: #1c8aff;
    --header-bg: var(--white);
    --nav-link-color: var(--dark-grey);
    --button-bg: var(--white);
    --button-text: var(--dark-grey);
    --modal-bg: var(--white);
    --shadow-color: rgba(0,0,0,0.3);
    --chat-ai: #E9E9EB;
}

/* Dark Theme Color Definitions */
.dark-theme {
    --page-color: #191919;
    --background-color: #262626;
    --background-color-inverted: #F3F4F6;
    --text-color: #f8f8f8;
    --link-color: #007BFF;
    --header-bg: #1E1E1E;
    --nav-link-color: #e6eef3;
    --button-bg: #333;
    --button-text: #FFF;
    --modal-bg: #2B2B2B;
    --shadow-color: rgba(0,0,0,0.3);
    --chat-ai: #3B3B3D;
}

@keyframes pageLoad {
    from { opacity: 0; }
    to { opacity: 1; }
}

body {
    animation-name: pageLoad;
    animation-duration: 1s;
    animation-fill-mode: both;
}

html, main {
    background: linear-gradient(-45deg, #ffcf99, #ffd2a6, #ffebc2, #f7d7e8, #c1e3ff, #a1c7e8, #d7c1e5, #f4e1f0);
    background-size: 300% 300%;
    animation: gradient 15s ease infinite;
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

a, button {
    color: var(--link-color);
}
/* Header Styling */
header {
    background: var(--header-bg);
    box-shadow: 0 2px 4px var(--shadow-color);
    padding: 5px 10%;
    text-align: center;
    position: fixed;
    width: 100%;
    z-index: 1;
    top: 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content {
    display: flex;
    align-items: center;
}

header h1 a {
    font-size: 0.8em;
    margin: 10px;
    color: var(--text-color);
    font-weight: bold;
    text-decoration: none;
    position: relative;
    transition: color 0.5s ease;
    display: flex;
    white-space: nowrap;
}

header h1 a:hover {
    color: #707070;
    text-decoration: none;  
}

nav ul {
    list-style-type: none;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

nav ul li {
    margin-left: 40px;
}

nav a {
    color: var(--nav-link-color);
    text-decoration: none;
    font-weight: bold;
    position: relative;
    display: flex;
    align-items: center;
}

nav a:hover {
    text-decoration: none;
    color: var(--text-color)
}

nav a::before {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--text-color);
    transition: width 0.5s ease;
}

nav a:hover::before {
    width: 100%;
}

nav a i {
    margin-right: 6px;
}

.hamburger-menu {
    display: none;
}

main {
    margin-top: 5rem;
    padding: 20px 10%;
}

.intro {
    font-size: 1.2em;
    margin-bottom: 20px;
}
/* Chat Styling */
.chat-header {
    padding: 12px 20px;
    background-color: var(--background-color);
    color: var(--text-color);
    text-align: left;
    font-size: 16px;
    font-family: var(--font-family);
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    box-shadow: inset 0 0 1px var(--shadow-color);
}

#chatHistory {
    overflow-y: auto;
    margin-bottom: 12px;
    flex-grow: 1;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    padding: 30px;
    box-shadow: inset 0 0 1px var(--shadow-color);
}

#chat {
    background: var(--modal-bg);
    border: 1px solid var(--shadow-color);
    border-radius: 20px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
    height: 82vh;
    max-height: 82vh;
    width: auto;
    box-shadow: 0 8px 16px var(--shadow-color);
}

#sendButton {
    padding: 6px 12px;
    background-color: var(--link-color);
    color: white;
    border: 0.5px solid var(--shadow-color);
    border-radius: 20%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    width: 50px;
    position: absolute;
    bottom: 10px;
    right: 10px;
    box-shadow: inset 0 0 1px var(--shadow-color);
    transition: background-color 0.3s ease;
}

#sendButton:hover {
    background-color: var(--link-color-hover);
}

#userInput {
    width: calc(100% - 60px);
    height: 50px;
    padding: 10px;
    border-width: 1px;
    box-sizing: border-box;
    border-radius: 10px;
    margin: 0;
    resize: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    background: var(--modal-bg);
    color: var(--text-color);
    border-color: var(--shadow-color);
}
#userInput::placeholder {
    color: var(--text-color);
    opacity: 0.8;
}
#userInput:focus {
    outline: none;
}

button {
    width: 100%;
    padding: 10px 0;
    margin-top: 10px;
}

.chat-message {
    padding: 8px 15px;
    margin: 5px 0 15px;
    border-radius: 20px;
    color: var(--text-color);
    background-color: var(--background-color);
    width: fit-content;
    max-width: 70%;
}

.chat-message.bot {
    color: var(--text-color);
    background-color: var(--chat-ai);
    align-self: flex-start;
    margin-right: auto;
}

.chat-message.user {
    color: white;
    background-color: #238DFF;
    align-self: flex-end;
    margin-left: auto;
}

.chat-message.error {
    background-color: #ff6d6d;
    align-self: center;
}

.container {
    max-width: 1200px;
    margin: 2rem 1rem;
    padding: 0 20px;
}
/* About Styling */
#about {
    padding: 20px 20px;
    margin-top: 50px;
    color: var(--text-color);
    background-color: var(--background-color);
    border-radius: 20px;
    border: 1px solid var(--shadow-color);
    box-shadow: 0 12px 24px var(--shadow-color);
}

.about-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px;
    border-radius: 20px;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

.about-text {
    margin: 0 8%;
    width: 80%;
}

.about-text h2 {
    font-size: 2em;
    margin-bottom: 20px;
}

.profile-image img {
    max-height: 300px;
    border-radius: 2rem;
    box-shadow: inset 0px 5px 10px var(--shadow-color); 
}
/* Education Styling */
.education-block h2,
.experience-block h2 {
    text-align: center;
    font-weight: bold;
    color: var(--text-color);
    margin-top: 50px;
}

.school,
.experience {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--modal-bg);
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin: 20px;
}

.school-info,
.experience.info {
    flex: 1;
}

.school h3,
.experience h3 {
    font-weight: bold;
}

.timeline {
    font-size: 0.8em;
    text-align: right;
    white-space: nowrap;
    margin-top: auto;
}

/* Add animations */
@keyframes fadeInFromPosition {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.chat-message {
    animation: fadeInFromPosition 0.25s ease forwards;
}

@keyframes typingAnimation {
    0%, 100% { content: "."; }
    33% { content: ".."; }
    66% { content: "..."; }
}

.typing::after {
    content: ".";
    animation: typingAnimation 2s infinite;
    letter-spacing: 0.2em;
}

* {
    transition: background-color 0.3s ease; 
}

/* Mobile Styling */
@media (max-width: 1024px) {

    header {
        padding: 0 5%;
        height: 60px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    header h1 a {
        margin-top: 1rem;
        font-size: 0.6em;
    }

    .hamburger-menu {
        background-color: transparent;
        border: none;
        cursor: pointer;
        display: flex;
        padding: 0;
        position: absolute;
        right: 20px;
        width: 50px;
        top: -20px;
      }
      
      .hamburger-menu:focus {
        outline: none;
      }
      
      .line {
        fill: none;
        stroke: var(--text-color);
        stroke-width: 6;
        transition: stroke-dasharray 600ms cubic-bezier(0.4, 0, 0.2, 1),
          stroke-dashoffset 600ms cubic-bezier(0.4, 0, 0.2, 1);
      }
      
      .line1 {
        stroke-dasharray: 60 207;
      }
      
      .line2 {
        stroke-dasharray: 60 60;
      }
      
      .line3 {
        stroke-dasharray: 60 207;
      }
      
      .hamburger-menu.opened .line1 {
        stroke-dasharray: 90 207;
        stroke-dashoffset: -134;
      }
      
      .hamburger-menu.opened .line2 {
        stroke-dasharray: 1 60;
        stroke-dashoffset: -30;
      }
      
      .hamburger-menu.opened .line3 {
        stroke-dasharray: 90 207;
        stroke-dashoffset: -134;
      }

    nav ul {
        display: none;
        position: absolute;
        border-bottom-left-radius: 10px;
        border-bottom-right-radius: 10px;
        background-color: var(--header-bg); 
        padding: 10px;
    }

    nav ul.active-nav {
        display: block;
        animation: fadeIn 0.3s ease forwards;
    }
    
    nav ul.fade-out {
        animation: fadeOut 0.3s ease forwards;
    }

    @keyframes fadeOut {
        from {
            opacity: 1;
            transform: translateY(0px);
        }
        to {
            opacity: 0;
            transform: translateY(-10px);
        }
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .active-nav {
        display: block;
        position: absolute;
        width: 100%;
        top: 40px;
        left: 0;
        box-shadow: 0 4px 5px var(--shadow-color);
    }

    .active-nav li {
        padding: 10px;
        border-bottom: 1px solid var(--light-grey);
        text-align: center;
    }

    main {
        padding: 10px 5%;
    }

    #chat {
        padding: 8px;
    }

    .chat-message {
        margin: 0 -20px 15px;
        max-width: 90%;
    }

    #sendButton, #userInput {
        height: 40px;
    }

    #sendButton {
        width: 40px;
    }

    #userInput {
        width: calc(100% - 50px);
    }

    .about-content {
        flex-direction: column;
        align-items: center;
    }

    .about-text, .projects-text {
        width: 100%;
        margin-right: 0;
        margin-bottom: 20px;
    }

    .profile-image img {
        max-width: 100%;
        height: auto;
        margin-bottom: 20px;
    }
    
    .school h3,
    .school h5,
    .experience h3,
    .experience h5 {
        font-size: 0.8em;
    }

    .school p,
    .experience p,
    .timeline {
        font-size: 0.6em;
    }
}

/* Photography */
.photo-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3%;
    padding: 3%;
}

.photo-item {
    width: 30%;
    max-width: 500px;
    flex: 1 1 auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background-color: white;
    margin-bottom: 25px;
}

.photo-item:hover {
    transform: scale(1.10);
    box-shadow: 0px 10px 20px var(--shadow-color);
}

.photo-item img {
    max-width: 100%;
    height: auto;
    border-radius: 20px;
}

@media (max-width: 768px) {
    .photo-item {
        width: 100%;
        max-width: none;
        margin-bottom: 25px;
    }
}