/* Custom Properties (Variables) */
:root {
    --bg-color: #1a1a1a;
    --secondary-bg-color: #121212;
    --text-color: #e0e0e0;
    --light-text-color: #f5f5f5;
    --accent-color: #00f0f0; /* Cyan/Aqua */
    --secondary-accent-color: #00e060; /* Green */
    --border-color: rgba(0, 240, 240, 0.3);
    --card-bg: #222222;
    --shadow-dark: rgba(0, 0, 0, 0.6);
    --shadow-light: rgba(0, 240, 240, 0.15);
    --hover-effect-scale: 1.03;
    --transition-speed: 0.4s ease;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: 'Lato', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Headings & Text */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    color: var(--light-text-color);
    margin-bottom: 0.8em;
}

p {
    margin-bottom: 1em;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--secondary-accent-color);
}

.heading {
    font-size: 3.5em;
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    padding-bottom: 15px;
    color: var(--light-text-color);
}

.heading span {
    color: var(--accent-color);
}

.heading::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--secondary-accent-color);
    border-radius: 2px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    transition: all var(--transition-speed);
    cursor: pointer;
    border: none;
    text-align: center;
    font-size: 1.1em;
}

.primary-btn {
    background-color: var(--accent-color);
    color: var(--bg-color);
    box-shadow: 0 5px 15px var(--shadow-light);
}

.primary-btn:hover {
    background-color: var(--secondary-accent-color);
    color: var(--secondary-bg-color);
    box-shadow: 0 5px 20px rgba(0, 224, 96, 0.3);
    transform: translateY(-3px);
}

/* Header */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 7%;
    background: var(--secondary-bg-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 10px var(--shadow-dark);
}

.logo {
    font-size: 2.5em;
    color: var(--light-text-color);
    font-weight: 700;
    cursor: default;
    opacity: 0;
    animation: slideRight 1s ease forwards;
    display: flex;
    align-items: center;
}

.logo span {
    color: var(--accent-color);
}

.logo img {
    height: 40px; /* Ensure logo image is styled */
    margin-right: 10px;
}

.navbar-nav a {
    font-size: 1.15em;
    color: var(--text-color);
    font-weight: 500;
    margin-left: 35px;
    transition: var(--transition-speed);
}

.navbar-nav a:hover,
.navbar-nav a.active {
    color: var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 3px;
}

#menu-icon {
    font-size: 3.6em;
    color: var(--light-text-color);
    cursor: pointer;
    display: none; /* Hidden on large screens */
}

/* Sections */
.section {
    min-height: 100vh; /* Ensure sections take full viewport height */
    padding: 80px 7% 40px; /* Top padding adjusted for fixed header */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

/* Home Section */
.home-section {
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('https://via.placeholder.com/1920x1080/0d0d0d/00f0f0?text=Abstract+Background') no-repeat center center/cover;
    display: flex;
    flex-direction: column; /* Changed to column to stack elements */
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
}

.home-detail {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    gap: 50px;
    flex-wrap: wrap-reverse; /* Image above text on smaller screens */
}

.home-text {
    flex: 1;
    min-width: 300px;
    text-align: left; /* Align text left within its flex item */
}

.home-text h1 {
    font-size: 5.6em;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 10px;
    animation: slideBottom 1s ease forwards;
    animation-delay: 1s;
    opacity: 0;
}

/* Normal display for h2 content (no typing animation) */
.home-text h2 {
    font-size: 3.2em;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
    animation: slideLeft 1s ease forwards;
    animation-delay: 1.5s;
    opacity: 0;
    color: var(--accent-color); /* Static color for the h2 text */
    /* All typing animation specific display, overflow, and height properties removed */
}
.dynamic-heading {
  font-family: monospace; /* Or your preferred font */
  font-size: 2.5em; /* Adjust as needed */
  display: flex; /* To align the text and cursor */
  white-space: nowrap; /* Keep content on one line */
  overflow: hidden; /* Hide overflow if text temporarily exceeds container */
}

#typed-word {
  display: inline-block; /* Essential for proper rendering of the text as it changes */
}

.blinking-cursor {
  opacity: 1; /* Initially visible */
  animation: 
    blink 0.75s step-end infinite; /* Blinking animation for the cursor */
}

/* Keyframes for the blinking cursor */
@keyframes blink {
  from, to { opacity: 0; } /* Cursor invisible */
  50% { opacity: 1; } /* Cursor visible */
}
.home-text h1 span {
    color: var(--secondary-accent-color); /* Color for the span text */
    margin-right: 10px; /* Spacing between spans */
    white-space: nowrap; /* Prevent line breaks within span */
}

/* If you use <span> tags within h2 for static styling (not animation),
   you can add styling here. Example:
.home-text h2 span {
    color: var(--light-text-color);
    margin-right: 10px;
    white-space: nowrap;
}
*/

.home-text p {
    font-size: 1.1em;
    max-width: 600px;
    margin-bottom: 40px;
    animation: slideLeft 1s ease forwards;
    animation-delay: 2s;
    opacity: 0;
}

.home-img {
    flex: 1;
    min-width: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: slideUp 1s ease forwards;
    animation-delay: 2.5s;
    opacity: 0;
}

.img-box {
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--accent-color), var(--secondary-accent-color));
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    box-shadow: 0 0 30px var(--shadow-light), inset 0 0 20px var(--accent-color);
    transition: box-shadow var(--transition-speed);
    position: relative; /* Needed for absolute positioning of pseudo-element */
}

/* Glowing Rotating Effect - Made more vibrant */
.img-box::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        transparent 0deg,
        transparent 180deg,
        var(--accent-color) 180deg,
        var(--secondary-accent-color) 270deg,
        var(--accent-color) 360deg
    );
    animation: rotateGlow 4s linear infinite;
    z-index: 0; /* Behind the image item */
    border-radius: 50%; /* Make it circular for rotation */
    filter: blur(50px); /* Increased blur for more vibrancy */
    opacity: 1; /* Increased opacity for more vibrancy */
}

@keyframes rotateGlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.img-box:hover .img-item img {
    transform: scale(1.1);
}

.img-item{
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-color); /* Inner background */
    position: relative; /* Ensure image is above glow */
    z-index: 1; /* Place above the ::after pseudo-element */
}
.about-img{
    overflow: hidden;
    display: flex;
    align-items: center;
    background-color: var(--bg-color); /* Inner background */
    position: relative; /* Ensure image is above glow */
    z-index: 1; /* Place above the ::after pseudo-element */
}
.about-text{
    padding-left: 78px;
}

.about-img img{
    width: 90px;
    margin-left: 4px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--accent-color);
}
.img-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: transform var(--transition-speed);
}



.btn-sci {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 50px;
    justify-content: center; /* Center buttons and social links */
    width: 100%;
    max-width: 1200px;
}

.sci a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    background: transparent;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    font-size: 2.5em;
    color: var(--accent-color);
    margin: 0 12px;
    transition: var(--transition-speed);
}

.sci a:hover {
    background: var(--accent-color);
    color: var(--bg-color);
    box-shadow: 0 0 15px var(--shadow-light);
    transform: translateY(-5px);
}

/* Services Section */
.services-section {
    background-color: var(--secondary-bg-color);
}

.services-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding-top: 20px;
    width: 100%;
    max-width: 1200px;
}

.service-box {
    background: var(--card-bg);
    padding: 40px 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 20px var(--shadow-dark);
    transition: transform var(--transition-speed), border var(--transition-speed);
    border-top: 5px solid transparent;
}

.service-box:hover {
    transform: translateY(-15px);
    border-top-color: var(--accent-color);
    box-shadow: 0 8px 25px var(--shadow-light);
}

.service-box .icon {
    font-size: 4.5em;
    color: var(--secondary-accent-color);
    margin-bottom: 20px;
    transition: color var(--transition-speed);
}

.service-box:hover .icon {
    color: var(--accent-color);
}

.service-box h3 {
    font-size: 2em;
    margin-bottom: 15px;
    color: var(--light-text-color);
}

.service-box p {
    font-size: 1.1em;
    color: var(--text-color);
}

/* Resume Section */
.resume-section {
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Align content to top */
    min-height: 100vh;
}

.resume-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    width: 100%;
    max-width: 1200px;
    margin-top: 40px;
}

.resume-box {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px var(--shadow-dark);
    flex: 1; /* Allow boxes to grow */
    min-width: 300px; /* Minimum width before wrapping */
}

.resume-box h2 {
    font-size: 2.2em;
    color: var(--light-text-color);
    margin-bottom: 20px;
    text-align: center;
}

.resume-box .desc {
    font-size: 1.1em;
    color: var(--text-color);
    margin-bottom: 30px;
}

.resume-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.resume-btn {
    background: var(--secondary-bg-color);
    color: var(--text-color);
    border: 2px solid var(--accent-color);
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all var(--transition-speed);
}

.resume-btn:hover {
    background: var(--accent-color);
    color: var(--bg-color);
}

.resume-btn.active {
    background: var(--accent-color);
    color: var(--bg-color);
    box-shadow: 0 0 15px var(--shadow-light);
}

.details-box {
    flex: 2; /* Details box takes more space */
}

.resume-details {
    display: none; /* Hide all details by default */
    padding: 20px 0;
    animation: fadeIn 0.8s ease forwards;
}

.resume-details.active {
    display: block; /* Show active detail box */
}

.resume-details .heading {
    font-size: 2em;
    margin-bottom: 20px;
    text-align: left;
}

.resume-details .heading::after {
    left: 0;
    transform: translateX(0);
    width: 60px;
    background-color: var(--secondary-accent-color);
}

.resume-list {
    margin-top: 20px;
}

.resume-item {
    margin-bottom: 25px;
    padding-left: 25px;
    position: relative;
    border-left: 3px solid var(--accent-color);
}

.resume-item::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 5px;
    width: 15px;
    height: 15px;
    background: var(--secondary-accent-color);
    border-radius: 50%;
    border: 2px solid var(--bg-color);
}

.resume-item .year {
    font-size: 0.9em;
    color: var(--primary-color);
    margin-bottom: 5px;
    font-weight: 700;
}

.resume-item h3 {
    font-size: 1.5em;
    margin-bottom: 5px;
    color: var(--light-text-color);
}

.resume-item .company {
    font-style: italic;
    color: var(--text-color);
    margin-bottom: 10px;
}

.resume-details ul {
    list-style: none;
    margin-top: 15px;
    padding-left: 0;
}

.resume-details ul li {
    margin-bottom: 10px;
    padding-left: 25px;
    position: relative;
    color: var(--text-color);
}

.resume-details ul li::before {
    content: '\2022'; /* Bullet point */
    color: var(--accent-color);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
    position: absolute;
    left: 0;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.skills-list li {
    background-color: var(--secondary-bg-color);
    color: var(--accent-color);
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 0.95em;
    border: 1px solid var(--accent-color);
}

.skills-links a {
    margin-right: 20px;
    font-weight: 600;
}


/* Portfolio Section */
.portfolio-section {
    background-color: var(--secondary-bg-color);
}

.portfolio-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 35px;
    padding-top: 20px;
    width: 100%;
    max-width: 1200px;
}

.portfolio-box {
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow-dark);
    position: relative; /* For image overlay or background effect */
    min-height: 280px; /* Minimum height for consistent cards */
    display: flex;
    align-items: flex-end; /* Align detail to bottom */
    transition: transform var(--transition-speed), box-shadow var(--transition-speed), border var(--transition-speed);
    border: 2px solid transparent;
    /* Optional: Add a background image here or use a default placeholder */
    background: url('https://via.placeholder.com/350x200/222222/00f0f0?text=Project+Thumbnail') no-repeat center center/cover;
}

.portfolio-box:nth-child(even) {
    background-image: url('https://via.placeholder.com/350x200/2a2a2a/00e060?text=Project+Thumbnail+2'); /* Alternate background */
}

.portfolio-box:hover {
    transform: translateY(-15px);
    border-color: var(--accent-color);
    box-shadow: 0 8px 25px var(--shadow-light);
}

.portfolio-box::before { /* Overlay for text readability */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0.1) 100%);
    z-index: 1;
}

.portfolio-detail {
    position: relative;
    z-index: 2;
    padding: 20px;
    width: 100%;
    color: var(--light-text-color);
}

.portfolio-detail .numb {
    font-family: 'Montserrat', sans-serif;
    font-size: 3em;
    font-weight: 900;
    color: rgba(0, 240, 240, 0.2); /* Faded accent */
    position: absolute;
    top: -5px;
    left: 20px;
    opacity: 0.8;
}

.portfolio-detail h3 {
    font-size: 1.8em;
    margin-bottom: 10px;
    color: var(--accent-color);
}

.portfolio-detail p {
    font-size: 1.05em;
    color: var(--text-color);
    margin-bottom: 15px;
}

.portfolio-detail .tech {
    font-size: 0.9em;
    color: var(--secondary-accent-color);
    font-weight: 600;
    display: block;
}

/* Contact Section */
.contact-section {
    background-color: var(--bg-color);
}

.contact-container {
    width: 100%;
    max-width: 800px;
    background: var(--card-bg);
    padding: 50px;
    border-radius: 10px;
    box-shadow: 0 4px 20px var(--shadow-dark);
    margin-top: 40px;
}

.contact-form .form-group {
    margin-bottom: 25px;
}

.contact-form label {
    display: block;
    font-size: 1.1em;
    color: var(--accent-color);
    margin-bottom: 8px;
    font-weight: 600;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px;
    background: var(--secondary-bg-color);
    border: 1px solid #333;
    border-radius: 5px;
    color: var(--light-text-color);
    font-size: 1.05em;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 10px var(--shadow-light);
    outline: none;
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-form .primary-btn {
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
}

/* Footer (within Contact Section) */
.footer {
    width: 100%;
    padding: 30px 0;
    text-align: center;
    margin-top: 60px;
    border-top: 2px solid var(--border-color);
    background-color: var(--secondary-bg-color);
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.footer-container {
    padding: 0 20px;
    color: var(--text-color);
    font-size: 1em;
}

.footer-container span {
    font-weight: 700;
    color: var(--light-text-color);
}

.footer-container a {
    color: var(--accent-color);
    font-weight: 600;
}

/* Back to Top Button */
#backToTopBtn {
    display: none; /* Hidden by default */
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    background-color: var(--accent-color);
    color: var(--dark-bg);
    border: none;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    font-size: 1.8em;
    cursor: pointer;
    box-shadow: 0 4px 10px var(--shadow-light);
    transition: background-color var(--transition-speed), transform var(--transition-speed);

    /* Centering the arrow */
    display: flex; /* Use flexbox */
    align-items: center; /* Vertically center */
    justify-content: center; /* Horizontally center */
}

#backToTopBtn:hover {
    background-color: var(--secondary-accent-color);
    transform: translateY(-8px);
    box-shadow: 0 6px 15px rgba(0, 224, 96, 0.4);
}

/* Keyframe Animations */
@keyframes slideRight {
    0% { transform: translateX(-100px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes slideLeft {
    0% { transform: translateX(100px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes slideBottom {
    0% { transform: translateY(100px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes slideUp {
    0% { transform: translateY(-100px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}


/* Responsive Design */
@media (max-width: 1200px) {
    .main-header {
        padding: 20px 5%;
    }
    .section {
        padding: 80px 5% 40px;
    }
    .home-text h1 {
        font-size: 4.8em;
    }
    .home-text h2 {
        font-size: 2.8em;
    }
}

@media (max-width: 992px) {
    .main-header {
        padding: 20px 4%;
    }
    .navbar-nav a {
        font-size: 1.05em;
        margin-left: 25px;
    }
    .home-text h1 {
        font-size: 4em;
    }
    .home-text h2 {
        font-size: 2.5em;
    }
    .home-detail {
        flex-direction: column-reverse; /* Image above text for smaller screens */
        text-align: center;
        gap: 30px;
    }
    .home-text {
        text-align: center; /* Center text when stacked */
        min-width: unset;
    }
    .home-img {
        margin-top: 30px;
        min-width: unset;
    }
    .img-box {
        width: 350px;
        height: 350px;
    }
    .btn-sci {
        flex-direction: column;
        align-items: center;
        margin-top: 30px;
    }
    .sci {
        margin-top: 20px;
    }

    .heading {
        font-size: 3em;
        margin-bottom: 50px;
    }
    .service-box, .portfolio-box, .resume-box {
        min-width: unset;
    }
    .resume-container {
        flex-direction: column;
        gap: 30px;
    }
    .resume-buttons {
        gap: 10px;
    }
}

@media (max-width: 768px) {
    #menu-icon {
        display: block; /* Show hamburger icon */
    }
    .navbar-nav {
        position: absolute;
        top: 100%; /* Below the header */
        left: 0;
        width: 100%;
        padding: 1rem 7%;
        background: var(--secondary-bg-color);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 5px 15px var(--shadow-dark);
        display: none; /* Hidden by default */
        flex-direction: column;
        text-align: center;
        transition: all var(--transition-speed);
        opacity: 0;
        transform: translateY(-20px);
    }
    .navbar-nav.active {
        display: flex;
        opacity: 1;
        transform: translateY(0);
    }
    .navbar-nav a {
        display: block;
        font-size: 1.5em;
        margin: 15px 0;
        border-bottom: none; /* Remove underline from active state */
    }
    .navbar-nav a:hover,
    .navbar-nav a.active {
        border-bottom: none; /* Ensure no underline on hover/active for mobile nav links */
    }

    .home-text h1 {
        font-size: 3.5em;
    }
    .home-text h2 {
        font-size: 2em;
    }
    .img-box {
        width: 300px;
        height: 300px;
    }
    .section {
        padding: 60px 4% 30px;
    }
    .heading {
        font-size: 2.5em;
        margin-bottom: 40px;
    }
    .service-box, .portfolio-box, .resume-box {
        padding: 30px 20px;
    }
    .contact-container {
        padding: 40px 30px;
    }
    #backToTopBtn {
        width: 48px;
        height: 48px;
        font-size: 1.6em;
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 2em;
    }
    .home-text h1 {
        font-size: 2.8em;
    }
    .home-text h2 {
        font-size: 1.6em;
    }
    .home-text p {
        font-size: 1em;
    }
    .img-box {
        width: 250px;
        height: 250px;
    }
    .btn {
        padding: 10px 20px;
        font-size: 1em;
    }
    .sci a {
        width: 45px;
        height: 45px;
        font-size: 2.2em;
        margin: 0 8px;
    }
    .heading {
        font-size: 2em;
        margin-bottom: 30px;
    }
    .service-box .icon {
        font-size: 3.8em;
    }
    .service-box h3 {
        font-size: 1.7em;
    }
    .resume-details .heading {
        font-size: 1.8em;
    }
    .resume-btn {
        padding: 8px 15px;
        font-size: 0.9em;
    }
    .portfolio-detail .numb {
        font-size: 2.5em;
    }
    .portfolio-detail h3 {
        font-size: 1.5em;
    }
    .contact-form input, .contact-form textarea {
        padding: 12px;
        font-size: 0.95em;
    }
    .contact-form .primary-btn {
        font-size: 1.1em;
    }
    .footer-container {
        font-size: 0.85em;
    }
}