/* General Body Styles */
html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background: #121212;
    color: #e0e0e0;
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #0056b3;
}

h1, h2, h3 {
    color: #fff;
    margin-top: 0;
}

h1 { font-size: 4rem; margin-bottom: 0.5rem; }
h2 { font-size: 2.5rem; margin-bottom: 2rem; text-align: center; }
h3 { font-size: 1.5rem; }

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 6rem 0;
    border-bottom: 1px solid #222;
}

/* Header */
#main-header {
    background: rgba(18, 18, 18, 0.8);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: background-color 0.3s;
}

#main-header.scrolled {
    background: #1e1e1e;
    border-bottom: 1px solid #333;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

nav .logo a {
    color: #fff;
    font-size: 1.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
}

nav .logo img {
    max-height: 80px;
    width: auto;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav ul li a {
    color: #e0e0e0;
    font-size: 1rem;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-primary {
    background: #007bff;
    color: #fff;
    border: 1px solid #007bff;
}

.btn-primary:hover {
    background: transparent;
    color: #007bff;
}


/* Hero Section */
#hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
    position: relative;
}

#hero-object-canvas {
    position: fixed;
    top: 53%; /* Adjusted downward position */
    right: -13%; /* Adjusted position */
    transform: translateY(-50%);
    width: 1600px !important; /* Made slightly larger */
    height: 1600px !important; /* Made slightly larger */
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.hero-content > * {
    pointer-events: auto;
}

.hero-text-content {
    /* This class is no longer used */
}

.profile-photo {
    width: 18rem; /* A bit larger */
    height: auto;
    border-radius: 8px;
    object-fit: cover;
    margin-bottom: 2rem;
    transition: transform 0.2s ease-out; /* For smooth tilting */
}

.hero-intro {
    color: #007bff;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: bold;
}

#hero h2 {
    text-align: left;
    font-size: 2.5rem;
    color: #aaa;
}

.social-links {
    margin-top: 2rem;
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    color: #aaa;
    font-size: 1.5rem;
}

.social-links a:hover {
    color: #007bff;
}

.scroll-down {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    color: #aaa;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translate(-50%, 0);
    }
    40% {
        transform: translate(-50%, -20px);
    }
    60% {
        transform: translate(-50%, -10px);
    }
}


/* About Section */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.skills-list {
    list-style: none;
    padding: 0;
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.skills-list li {
    background: #222;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-family: 'Fira Code', monospace; /* Example for a more techy font */
}

.resume-btn {
    margin-top: 2rem;
}


/* Projects Section */
.project-grid {
    display: grid;
    gap: 4rem;
}

.project-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    align-items: center;
}

.project-card:nth-child(even) .project-image {
    order: 2;
}

.project-image img {
    width: 100%;
    border-radius: 8px;
    filter: grayscale(100%);
    transition: all 0.3s;
}

.project-card:hover .project-image img {
    filter: grayscale(0%);
}

.project-info {
    text-align: left;
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.project-tags span {
    background: #007bff;
    color: #fff;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.btn-view-project {
    color: #fff;
    font-weight: bold;
    margin-top: 1rem;
    display: inline-block;
}

.btn-view-project i {
    margin-left: 0.5rem;
    transition: transform 0.3s;
}

.btn-view-project:hover i {
    transform: translateX(5px);
}


/* New Portfolio Section */
.portfolio-subtitle {
    text-align: center;
    color: #ffffff;
    margin-bottom: 3rem;
    font-size: 1.1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.portfolio-list {
    max-width: 900px;
    margin: 0 auto;
}

.portfolio-list-item {
    display: flex;
    align-items: center;
    padding: 2rem;
    background: #fff;
    color: #121212;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 2px solid #fff;
}

.portfolio-list-item:hover {
    background: #121212;
    color: #fff;
    transform: scale(1.02);
}

.item-number {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0.3rem 0.6rem;
    margin-right: 2rem;
    font-weight: bold;
}

.portfolio-list-item:hover .item-number {
    border-color: #fff;
}

.item-title {
    flex-grow: 1;
    font-size: 2rem;
    font-weight: bold;
}

.item-arrow {
    font-size: 2rem;
    transition: transform 0.3s ease;
}

.portfolio-list-item:hover .item-arrow {
    transform: translateX(10px);
}


/* Portfolio Category Page */
.btn-back-portfolio {
    display: none;
}

#portfolio-category h2 {
    font-size: 3rem;
    margin-bottom: 3rem;
}

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

.portfolio-item {
    background: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.portfolio-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.logo-design-item {
    background: #ffffff;
}

.portfolio-item.email-design-item {
    background: #2a2a2a;
}

.portfolio-item.email-design-item img {
    object-fit: contain;
}

.portfolio-item img,
.portfolio-item video {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.pdf-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 220px;
    background: #2a2a2a;
    color: #fff;
    padding: 1rem;
    box-sizing: border-box;
}

.pdf-preview i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.pdf-preview span {
    font-weight: bold;
}


/* Lightbox Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    flex-direction: column;
}

.lightbox-main {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.modal-content {
    position: relative;
    margin: auto;
    padding: 0;
    width: auto;
    max-width: 85vw;
    max-height: 85vh;
}

#lightbox-image,
#lightbox-video {
    width: 100%;
    height: auto;
    max-height: 85vh;
    display: block;
}

#lightbox-image.logo-preview {
    background: white;
}

#lightbox-image.email-preview {
    object-fit: contain;
    background: #2a2a2a;
}

.close-button {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 1002;
}

.close-button:hover,
.close-button:focus {
    color: #bbb;
    text-decoration: none;
}


/* Contact Section */
#contact {
    text-align: center;
    max-width: 800px; /* Increased width for a wider form */
    margin: 0 auto;
}

#contact h2 {
    margin-bottom: 1rem;
}

#contact .btn-primary {
    margin-top: 2rem;
    padding: 1rem 3rem;
    font-size: 1.2rem;
}

#contact-form {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: flex;
    gap: 1.5rem;
}

.form-row input {
    width: 50%; /* Make each input take up half the space */
}

#contact-form input,
#contact-form textarea {
    flex-grow: 1; /* Allow fields to grow and fill the container */
    padding: 1rem;
    background: transparent;
    border: 1px solid #e0e0e0; /* Changed to white for better contrast */
    border-radius: 5px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

#contact-form input:focus,
#contact-form textarea:focus {
    border-color: #007bff;
    outline: none;
}

#contact-form ::placeholder {
    color: #e0e0e0;
    opacity: 1; /* For Firefox */
}

#contact-form button {
    align-self: flex-start; /* Aligns button to the left */
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem 0;
}

.footer-socials {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}
.footer-socials a {
    color: #aaa;
}

/* Animations on Scroll */
.hidden {
    opacity: 0;
    filter: blur(5px);
    transform: translateY(20px);
    transition: all 0.7s ease-out;
}

.show {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

/* Typing Animation Cursor */
#typing-text::after {
    content: '|';
    display: inline-block;
    animation: blink 0.7s infinite;
    margin-left: 4px;
    color: #007bff;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* Lightbox Navigation */
.prev, .next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  padding: 16px;
  margin-top: -22px;
  color: white;
  font-weight: bold;
  font-size: 20px;
  transition: 0.6s ease;
  user-select: none;
  background-color: transparent;
}

.prev {
    left: 0;
    border-radius: 0;
}

.next {
  right: 0;
  border-radius: 0;
}

.prev:hover, .next:hover {
  background-color: transparent;
  color: #007bff;
}

.prev:active, .next:active {
    background-color: transparent;
    color: #0056b3;
}

@media (min-width: 769px) {
    .lightbox-main {
        width: 100%;
        justify-content: space-between;
        align-items: center;
        box-sizing: border-box;
        padding: 0 1rem;
    }

    .prev, .next {
        position: static;
        transform: none;
        margin-top: 0;
        font-size: 3rem;
        padding: 1rem;
        background-color: transparent;
        border-radius: 10px;
        width: 120px;
        box-sizing: border-box;
        text-align: center;
        flex-shrink: 0;
    }

    .prev:hover, .next:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: #fff;
    }

    .close-button {
        font-size: 2rem;
        top: 2rem;
        right: 2rem;
        padding: 0.5rem 1rem;
        background-color: rgba(0,0,0,0.5);
        border-radius: 5px;
    }

    .close-button:hover {
        background-color: rgba(0,0,0,0.8);
    }
}

/* Thumbnail Styles */
.thumbnail-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    padding: 10px;
    background-color: rgba(0,0,0,0.5);
    border-radius: 10px;
}

.thumbnail {
    width: 80px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    border: 2px solid transparent;
}

.thumbnail:hover, .thumbnail.active {
    opacity: 1;
    border-color: #fff;
}

/* Responsive Styles */
@media (max-width: 992px) {
    #hero-object-canvas {
        opacity: 0.3; /* Make 3D object less prominent */
    }
}

@media (max-width: 768px) {
    h1 { font-size: 3rem; }
    h2 { font-size: 2rem; }
    section { padding: 4rem 0; }

    #portfolio-category {
        position: relative;
    }

    .btn-back-portfolio {
        display: block;
        position: absolute;
        top: 0;
        left: 1rem;
        font-size: 1.5rem;
        color: #fff;
        z-index: 10;
    }

    #portfolio-category h2 {
        text-align: center;
        margin-top: 3rem;
    }

    nav {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        padding: 0;
        gap: 1.5rem;
    }
    
    .logo img {
        max-height: 60px;
    }

    #hero {
        align-items: center;
        text-align: center;
    }

    #hero h2 {
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }

    #hero-object-canvas {
        display: none; /* Hide 3D object on smaller screens */
    }

    .profile-photo {
        width: 12rem;
    }

    .portfolio-list-item {
        padding: 1.5rem;
    }

    .item-title {
        font-size: 1.5rem;
    }

    .portfolio-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem; /* Slightly larger gap for tablets */
    }

    .portfolio-item img,
    .portfolio-item video,
    .pdf-preview {
        height: 180px; /* Reduced height for tablet */
    }
    
    .form-row {
        flex-direction: column;
        gap: 1.5rem;
    }

    .form-row input {
        width: 100%;
        box-sizing: border-box;
    }

    #contact-form button {
        align-self: center;
    }
}

@media (max-width: 480px) {
    main {
        padding: 0 1rem;
    }

    h1 { font-size: 2.5rem; }
    h2 { font-size: 1.8rem; }
    
    nav .btn-primary {
        display: none; /* Hide button on mobile to save space */
    }

    .portfolio-list-item {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .portfolio-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
    }

    .thumbnail-container {
        width: 100%;
        left: 0;
        transform: none;
        bottom: 0;
        border-radius: 0;
        justify-content: flex-start;
        padding: 10px;
        box-sizing: border-box;
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .thumbnail {
        width: 60px;
        height: 45px;
    }

    .item-number {
        margin-right: 0;
    }

    .item-arrow {
        display: none; /* Hide arrow on mobile */
    }
}
