:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-1: #4a9eff;
    --accent-2: #ff49db;
    --accent-3: #50fa7b;
    --mobile-width: 480px;
    --tablet-width: 768px;
    --laptop-width: 1024px;
    --desktop-width: 1200px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    background: var(--bg-primary);
    color: var(--text-primary);
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(74, 158, 255, 0.05) 0%, transparent 30%),
        radial-gradient(circle at 80% 30%, rgba(255, 73, 219, 0.05) 0%, transparent 30%),
        radial-gradient(circle at 40% 70%, rgba(80, 250, 123, 0.05) 0%, transparent 30%),
        radial-gradient(circle at 70% 80%, rgba(74, 158, 255, 0.05) 0%, transparent 30%);
    pointer-events: none;
    z-index: -1;
    animation: moveLights 20s ease-in-out infinite;
}

@keyframes moveLights {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: var(--desktop-width);
    margin: 0 auto;
    padding: 0 1rem;
}

section {
    padding: 3rem 0;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.project-card {
    background: var(--bg-secondary);
    padding: 1.125rem;
    border-radius: 12px;
    transition: transform 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
    position: relative;
    overflow: hidden;
    transform: scale(0.75);
}

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

.project-card::before {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--accent-1) 0%, transparent 70%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    left: var(--mouse-x, 0);
    top: var(--mouse-y, 0);
    transform: translate(-50%, -50%);
}

.project-card:hover::before {
    opacity: 0.1;
}

.project-thumbnail {
    width: 250px;
    height: 250px;
    display: block;
    margin: 0 auto 1rem auto;
    border-radius: 8px;
    object-fit: cover;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.skill {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 1rem;
    text-align: center;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
}

.skill:nth-child(3n+1):hover { background: var(--accent-1); }
.skill:nth-child(3n+2):hover { background: var(--accent-2); }
.skill:nth-child(3n+3):hover { background: var(--accent-3); }

.skill-bar {
    width: 100%;
    height: 10px;
    background: var(--bg-secondary);
    border-radius: 5px;
    margin: 10px 0;
    overflow: hidden;
}

.skill-progress {
    width: 0;
    height: 100%;
    background: var(--accent-1);
    transition: width 1.5s ease-in-out;
}

.skill-logo-container {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 1rem;
}

.skill-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.skill-item:hover .skill-logo {
    transform: scale(1.1);
}

.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
}

.skill-item img[alt="Python"] {
    filter: invert(1) brightness(1.5);
    padding: 0.8rem;
}

.skill-item:hover img[alt="Python"] {
    filter: invert(1) brightness(1.8);
}

.skill-item img[alt="CSS3"] {
    filter: invert(1) brightness(1.5);
    padding: 0.5rem;
    width: 90%;
    height: auto;
}

.skill-item:hover img[alt="CSS3"] {
    filter: invert(1) brightness(1.8);
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 500px;
    margin: 2rem auto;
}

input, textarea {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 1rem;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
}

input:focus, textarea:focus {
    border-color: var(--accent-1);
    outline: none;
}

button {
    background: var(--accent-1);
    color: var(--text-primary);
    padding: 1rem 2rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: bold;
    letter-spacing: 1px;
}

button:hover {
    background: var(--accent-2);
    transform: translateY(-2px);
}

footer {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
}

.typed-cursor {
    color: var(--accent-1);
}

[data-aos] {
    opacity: 0;
    transition-property: opacity, transform;
}

[data-aos].aos-animate {
    opacity: 1;
}

.contact-info {
    display: flex;
    flex-direction: row; /* Changed from column to row */
    gap: 1rem;
    width: 100%;
    max-width: 1000px; /* Increased from 300px */
    align-items: stretch;
    justify-content: center; /* Center the contact items */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.contact-item {
    flex: 1; /* Allow items to grow equally */
    min-width: 250px; /* Increased from 200px */
    max-width: 350px; /* Increased from 300px */
    padding: 1rem 1.5rem; /* Increased padding */
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
    font-size: 0.95rem; /* Added to make text smaller */
}

.contact-item:hover {
    transform: translateY(-2px);
    border-color: var(--accent-1);
}

.contact-item a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 1.1rem; /* Increased from 0.95rem */
    word-break: break-word; /* Added to handle long emails */
}

contact-item:hover a {
    color: var(--accent-1);
}

.contact-item i {
    font-size: 1.8rem; /* Increased from 1.5rem */
    color: var(--accent-1);
    transition: transform 0.3s ease;
    width: 35px; /* Increased from 30px */
    text-align: center;
}

.contact-item:hover i {
    transform: scale(1.2);
    color: var(--accent-2);
}

.profile-container {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.profile-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid var(--accent-1);
    object-fit: cover;
    box-shadow: 0 0 20px rgba(74, 158, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.profile-image:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(74, 158, 255, 0.3);
    border-color: var(--accent-2);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.social-links a {
    text-decoration: none;
}

.form-message {
    text-align: center;
    margin-bottom: 1rem;
    min-height: 1.5em;
    font-weight: 500;
}

.feedback-container {
    max-width: 600px;
    margin: 0; /* Remove auto margins */
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    width: 100%; /* Take full width of the grid cell */
}

.feedback-container h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--accent-1);
}

.feedback-field {
    margin-bottom: 1rem;
}

.feedback-field input,
.feedback-field textarea {
    width: 100%;
    background: rgba(255,255,255,0.05);
}

.feedback-message {
    text-align: center;
    margin: 1rem 0;
    min-height: 1.5em;
    color: var(--accent-3);
}

.cursor-trail {
    pointer-events: none;
    position: fixed;
    z-index: 9999;
}

.cursor-trail-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--accent-1);
    border-radius: 50%;
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
}

.name-highlight {
    animation: nameHighlight 1s ease-out;
    text-shadow: 0 0 20px var(--accent-1),
                 0 0 40px var(--accent-2),
                 0 0 60px var(--accent-3);
}

#animated-name {
    font-size: 3.5rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.greeting-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    opacity: 0;
    transform: translateX(100px);
    animation: slideIn 0.5s ease forwards;
}

.greeting-bubble {
    background: var(--bg-secondary);
    padding: 10px 20px;
    border-radius: 20px;
    border: 1px solid var(--accent-1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.greeting-text img {
    display: inline-block;
    margin-left: 5px;
    animation: wave 2s infinite;
}

/* Remove these classes:
.greeting-character,
@keyframes wave */

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Add before the media queries */
.services-grid {
    max-width: 600px;
    margin: 2rem auto;
}

.service-card {
    background: linear-gradient(145deg, var(--bg-secondary), #252525);
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.4s ease;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-1);
    box-shadow: 0 8px 25px rgba(74, 158, 255, 0.2);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 0%, rgba(74, 158, 255, 0.1), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.service-card:hover::before {
    opacity: 1;
}

.service-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 20px rgba(74, 158, 255, 0.3);
}

.service-title {
    color: var(--accent-1);
    margin-bottom: 2rem;
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.service-features {
    list-style: none;
    margin: 0;
    padding: 0;
}

.service-features li {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.service-features li::before {
    content: '◈';
    color: var(--accent-1);
    margin-right: 0.8rem;
    font-size: 0.9rem;
}

.service-features li:hover {
    color: var(--text-primary);
}

.service-features .sub-feature {
    padding-left: 1.5rem;
    font-size: 1rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.service-features .sub-feature::before {
    content: '•';
    font-size: 0.8rem;
}

.service-icon-img {
    width: 60px;
    height: 60px;
    filter: invert(1) brightness(1.5);
    transition: transform 0.3s ease;
}

.service-card:hover .service-icon-img {
    transform: scale(1.1);
    filter: invert(1) brightness(1.8);
}

/* Enhanced Contact Section Styles */
#contact {
    background: linear-gradient(145deg, var(--bg-primary), var(--bg-secondary));
    position: relative;
    overflow: hidden;
}

#contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 20%, rgba(74, 158, 255, 0.05) 0%, transparent 40%),
                radial-gradient(circle at 80% 80%, rgba(255, 73, 219, 0.05) 0%, transparent 40%);
    pointer-events: none;
}

/* Update contact section layout */
#contact .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.feedback-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
}

/* Back to Top Button Styles */
#back-to-top-btn {
    margin: 2rem auto 0 auto;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: var(--accent-1);
    color: var(--text-primary);
    border: none;
    border-radius: 8px;
    padding: 0.7rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background 0.3s, color 0.3s, transform 0.2s;
    box-shadow: 0 2px 8px rgba(74,158,255,0.08);
}

#back-to-top-btn:hover {
    background: var(--accent-2);
    color: #fff;
    transform: translateY(-2px) scale(1.03);
}

#back-to-top-btn .text,
#back-to-top-btn .clone {
    display: flex;
    gap: 0.3rem;
}

#back-to-top-btn .clone {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    pointer-events: none;
}

#back-to-top-btn svg {
    margin-left: 0.5rem;
    vertical-align: middle;
    transition: transform 0.3s;
}

#back-to-top-btn:hover svg {
    transform: translateX(4px) scale(1.1);
}

@media (max-width: 480px) {
    #back-to-top-btn {
        width: 100%;
        font-size: 1rem;
        padding: 0.7rem 1rem;
    }
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    /* Tablet and smaller */
    .container {
        padding: 0 15px;
    }

    #animated-name {
        font-size: 2.5rem;
    }

    .profile-container {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .profile-image {
        width: 120px;
        height: 120px;
    }

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-info {
        flex-direction: column; /* Stack on mobile */
        align-items: stretch;
    }
    
    .contact-item {
        max-width: none;
        padding: 1.2rem 1.5rem; /* Increased padding for mobile */
    }

    .lead {
        font-size: 1.2rem;
    }

    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .feedback-container {
        padding: 2rem;
    }

    .section {
        padding: 60px 0;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .heading {
        font-size: 2rem;
    }

    #contact .container {
        grid-template-columns: 1fr; /* Stack on mobile */
    }

    .contact-info,
    .feedback-container {
        max-width: 100%;
    }
}

@media screen and (max-width: 480px) {
    /* Mobile devices */
    section {
        padding: 4rem 0;
    }

    #animated-name {
        font-size: 2rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    nav ul li a {
        padding: 0.3rem 0.7rem;
        font-size: 0.9rem;
    }

    .contact-item {
        width: 100%;
        justify-content: center;
    }

    .feedback-container {
        padding: 1.5rem;
    }

    button {
        width: 100%;
    }

    .greeting-bubble {
        font-size: 0.9rem;
        padding: 8px 15px;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .heading {
        font-size: 1.5rem;
    }

    .section {
        padding: 40px 0;
    }
}

/* Handle cursor trail for touch devices */
@media (hover: none) {
    .cursor-trail {
        display: none;
    }
}

/* Adjust navigation for landscape mode on mobile */
@media screen and (max-height: 480px) and (orientation: landscape) {
    section {
        padding: 3rem 0;
    }

    .profile-container {
        flex-direction: row;
        align-items: center;
    }
}

/* Adjustments for larger screens */
@media screen and (min-width: 1024px) {
    .container {
        padding: 0 40px;
    }
}

/* Desktop (1200px and up) */
@media screen and (min-width: 1200px) {
    .container {
        padding: 0 2rem;
    }

    #animated-name {
        font-size: 4rem;
    }
}

/* Laptop (1024px to 1199px) */
@media screen and (min-width: 1024px) and (max-width: 1199px) {
    .container {
        max-width: 960px;
    }

    #animated-name {
        font-size: 3.5rem;
    }
}

/* Tablet (768px to 1023px) */
@media screen and (min-width: 768px) and (max-width: 1023px) {
    .container {
        max-width: 720px;
    }

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    #animated-name {
        font-size: 3rem;
    }

    #contact .container {
        grid-template-columns: 250px 1fr;
        gap: 2rem;
    }
}

/* Mobile (up to 767px) */
@media screen and (max-width: 767px) {
    .container {
        padding: 0 1rem;
    }

    #contact .container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    #animated-name {
        font-size: 2.5rem;
    }

    .profile-container {
        flex-direction: column;
        text-align: center;
    }

    .contact-item {
        width: 100%;
    }

    .feedback-container {
        padding: 1.5rem;
    }
}

/* Small Mobile (up to 480px) */
@media screen and (max-width: 480px) {
    section {
        padding: 3rem 0;
    }

    #animated-name {
        font-size: 2rem;
    }

    .profile-image {
        width: 120px;
        height: 120px;
    }

    nav ul li a {
        padding: 0.3rem 0.7rem;
        font-size: 0.9rem;
    }

    .contact-info {
        gap: 1rem;
    }
}

/* Handle orientation changes */
@media screen and (orientation: landscape) and (max-height: 600px) {
    .profile-container {
        flex-direction: row;
        align-items: center;
    }

    section {
        padding: 2rem 0;
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* High-resolution displays */
@media screen and (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }

    html {
        font-size: 18px;
    }
}

/* Print styles */
@media print {
    .cursor-trail,
    .particles,
    .code-symbols,
    .greeting-container {
        display: none;
    }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.project-card-modern {
  --font-color: var(--text-primary);
  --bg-color: var(--bg-secondary);
  width: 250px;
  height: 350px;
  border-radius: 20px;
  background: var(--bg-color);
  box-shadow: -9px 9px 18px #222,
              9px -9px 18px #222;
  display: flex;
  flex-direction: column;
  transition: .4s;
  position: relative;
}

.project-card-modern:hover {
  transform: scale(1.02);
  box-shadow: 0px 0px 10px 2px #222;
}

.project-card-modern__img {
  width: 100%;
  height: 55%;
  object-fit: cover;
  border-radius: 20px 20px 0 0;
  background-color: #22223b;
}

.project-card-modern__descr-wrapper {
  padding: 15px;
  display: grid;
}

.project-card-modern__title {
  color: var(--font-color);
  text-align: center;
  margin-bottom: 15px;
  font-weight: 900;
  font-size: 16px;
}

.project-card-modern__descr {
  color: var(--font-color);
}

.project-card-modern__svg {
  width: 25px;
  height: 25px;
  transform: translateY(25%);
  fill: var(--font-color);
}

.project-card-modern__links {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-self: flex-end;
}

.project-card-modern__links .link {
  color: var(--font-color);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}

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