:root {
    --bg-color: #fff;
    --text-color: #333;
    --card-bg: #e7e7e7;
    --card-border: #ddd;
    --accent: #1F6FEB;
    --muted-text: #666;
    --strobe-light: #84cc16;
}

html {
    scroll-behavior: smooth;
}

/* Default light mode */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: monospace, sans-serif;
    margin: 0;
    padding: 0;
    transition: background-color 0.9s ease, color 0.9s ease;
}
  

/* Dark mode */
body.dark-mode {
  --bg-color: #0D1117;
  --text-color: #eee;
  --card-bg: #262C36;
  --card-border: #3d444d;
  --accent: #66b2ff;
  --muted-text: #aaa;
}

body.dark-mode .projects > div::-webkit-scrollbar-track {
  background: #3d444d;
}

body.dark-mode .projects > div::-webkit-scrollbar-thumb {
  background-color: #3d444d;
  border-radius: 5px;
  border: 2px solid #262C36;
}

.dark-mode .projects ul li,
.dark-mode .experience-box ul li {
  background-color: #262C36;
  color: #ddd;
}

#light-dark-toggle {
    display: flex;
    margin-left: auto; /* Align to the right */
    background: transparent;
    color: var(--text-color);
    border: none;
    cursor: pointer;
    padding: 0;
}

#light-dark-mode {
    position: relative;
    width: 40px;
    height: 40px;
}

.mode-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease, transform 0.4s ease;
    cursor: pointer;
    font-size: 1.2rem;
}

#light-mode,
#dark-mode {
  display: none;
} 

/* Focus States for better accessibility and keyboard navigation */
a:focus,
button:focus,
li:focus,
input:focus,
textarea:focus {
    outline: 2px dashed #007bff;
    outline-offset: 2px;
    background-color: #f0f8ff;
}

/* Transition for smoothness */
a,
button,
li,
input,
textarea {
    transition: background-color 0.2s ease, outline 0.2s ease;
}

#header {
    width: 100%;
}

.container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 2rem 0;
    max-width: 1200px;
    margin: 0 auto;
}

.column {
    padding: 0.5rem;
    flex: 1;
    /* min-width: 300px; */
    box-sizing: border-box;
}

h2, h3 {
    color: var(--text-color);
    font-size: 16px;
    font-weight: 700;
}

p {
    color: var(--muted-text);
}

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

li {
    cursor: pointer;
    position: relative;
    display: flex; 
    flex-direction: column; 
    align-items: flex-start;
    justify-content: space-between; 
    padding-bottom: 5px;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-color);
    border-radius: 3px;
    margin: 5px 0;
    padding: 10px;
    width: 100%;
}

li .toggle-icon {
    position: absolute; /* Keep the icon fixed */
    top: 10px;
    right: 10px;
    margin-left: 0;
    font-size: 0.9rem;
    color: var(--muted-text);
    display: flex; 
    justify-content: flex-end;
    align-items: center; 
}

li .description {
    display: none;
    margin-top: 10px; 
    font-size: 0.85rem;
    color: var(--muted-text)
    clear: both;
    word-wrap: break-word;
}

li.active .description {
    display: block;
}

/* Media Queries */
@media (max-width: 768px) {
    body {
        display: flex;
        flex-direction: column;
    }

    .container {
        flex-direction: column;
    }

    .column {
        min-width: 100%;
    }

    #other-columns {
        display: grid;
        grid-template-columns: 1fr !important;
        grid-template-rows: auto;
    }

    #exp-container {
        display: flex !important;
        flex-wrap: wrap;
        gap: 1.5rem;
        box-sizing: border-box;
        align-items: start;
    }

    #years-experience,
    #cv-box {
        flex: 1;
        min-width: fit-content;
    }


    #third {
        order: 3; /* Ensure the third column appears in the correct order */
    }

    #fourth {
        grid-column: span 1;
    }

    .github-chart {
        width: 100%;
    }

}

@media (max-width: 389px) {
    #header {
        flex-direction: column;
        align-items: flex-start;
    }

    #profile-name {
        align-items: flex-start;
    }

    #profile-name h2 {
        font-size: 1.2rem;
    }

    #profile-name p {
        font-size: 0.8rem;
    }

    #light-dark-mode {
        margin-left: 0; /* Reset margin for smaller screens */
    }

    #exp-container {
        display: grid;
        grid-template-columns: 1fr 1fr !important;
        gap: 1.5rem;
        box-sizing: border-box;
        align-items: start;
    }

    #years-experience,
    #cv-box {
        flex: 1;
        min-width: fit-content;
    }
}

/* Global CSS ends here */

#header {
    display: flex;
    flex-wrap: wrap;
    padding: 20px;
    align-items: center;
    gap: 20px;
    padding-left: 20px; /* Add padding from the left */
}

#profile-picture {
    width: 3em;
    height: 3em;
    border-radius: 50%;
    object-fit: cover;
}

#profile-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#profile-name h2 {
    margin: 0;
    font-size: 0.9rem;
}

#profile-name p {
    margin: 0;
    font-size: 12px;
}

hr {
    margin: 0 auto;
    border: 0;
    border-top: 0.1rem solid var(--card-border);
    width: 73%;
}

#light-dark-mode {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto; /* Align to the right */
}
#light-dark-mode label {
    font-size: 0.9rem;
    color: var(--text-color);
}

/* First Column Starts here */
#first {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

#tiny-box-container {
    display: flex;
    gap: 1rem;
}

.tiny-box {
    flex: 1;
    height: 200px;
    box-sizing: border-box;
    border: 1px solid var(--card-border);
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    display: flex;
}

#location {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#location h3 {
    margin: 0;
    font-size: 0.9rem;
    text-decoration: underline;
}

.map-container {
    position: relative;
    overflow: hidden;
}

.map-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    mix-blend-mode: saturation;
    pointer-events: none;
}

#weather-widget {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-size: 0.8rem;
}

#weather-loading-spinner {
    display: flex;
    margin: auto;
    align-items: center;
    justify-content: center;
}

/* Mode blinking light starts*/
.blinking-light {
    display: inline-block;
    margin: 0;
    padding: 0;
    width: 10px;
    height: 10px;
    background-color: var(--strobe-light);
    border-radius: 50%;
    animation: blink 1s infinite;
    align-items: end;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}


.projects {
    display: flex;
    flex-direction: column;
    /* height: 370px; */
    box-sizing: border-box;
    border: 1px solid var(--card-border);
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    overflow: hidden; /* Remove vertical scrolling from the container */
}

.projects > div {
    overflow-y: auto; /* Enable vertical scrolling for the inner div */
    height: 100%; 
    scrollbar-width: thin; /* For Firefox */
    scrollbar-color: #888 #e7e7e7; /* For Firefox */
}

/* Stylish scrollbar for Webkit browsers */
.projects > div::-webkit-scrollbar {
    width: 8px;
}

.projects > div::-webkit-scrollbar-track {
    background: var(--card-bg);
    border-radius: 5px;
}

.projects > div::-webkit-scrollbar-thumb {
    background-color: var(--text-color);
    border-radius: 5px;
    border: 2px solid var(--card-border);
}

.tech-stack {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 160px;
    box-sizing: border-box;
    border: 1px solid var(--card-border);
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1rem;
}

/* First Column Ends here */

/* Other Columns: 2nd, 3rd and 4th columns */
#other-columns{
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    flex: 2;
}

/* Second Column Starts here */
#second {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.about {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: fit-content;
    box-sizing: border-box;
    border: 1px solid var(--card-border);
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1rem;
}

.about p {
    margin: 0;
    font-size: 0.9rem;
}

.contact {
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-sizing: border-box;
    border: 1px solid var(--card-border);
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1rem;
}

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

.contact ul {
    display: flex;
    gap: 10px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.contact ul a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.contact ul a:hover {
    color: var(--accent);
}

.additional-contact {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-top: 10px;
}

.additional-contact a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-size: 0.9rem;
    color: var(--muted-text);
    transition: color 0.3s ease;
}

.additional-contact a:hover {
    color: var(--accent);
}

.additional-contact a i {
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.additional-contact a:hover i {
    color: var(--accent);
}

#exp-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    box-sizing: border-box;
    align-items: start; 
}

#years-experience,
#cv-box {
    border: 1px solid var(--card-border);
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    gap: 1rem; 
    display: flex;
    flex-direction: column;
    }

#years-experience h3,
#cv-box h3 {
    margin-bottom: 1rem; 
}

.exp-button {
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
    border: 2px dashed var(--accent);
}

.exp-button:hover {
    background-color: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
}

#experience-breakdown {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 1.5rem; 
}

/* #experience-breakdown {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    justify-content: space-around;
    align-items: center;
} */

.experience-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem; 
}

.experience-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--muted-text);
    margin-bottom: 0.5rem;
}

.experience-text {
    font-size: 1rem;
    color: var(--muted-text);
}

/* Third Column Starts here */
#third {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.experience-box {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border: 1px solid var(--card-border);
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1rem;
}

.education-box {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border: 1px solid var(--card-border);
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1rem;
}

.certification-box {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border: 1px solid var(--card-border);
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1rem;
}

/* Third Column ends */

/* Fourth starts */
#fourth {
    grid-column: span 2;
}

.github-chart {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border: 1px solid var(--card-border);
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    /* height: stretch; */
}

/* Tools List Styles */
.tools-list ul {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.tools-list li {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    color: var(--muted-text);
    padding: 5px 10px;
}

.tools-list li i {
    font-size: 1.2rem;
    color: var(--accent);
}