/* ===== CSS RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Force navbar to be horizontal */
.navbar,
body .navbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 70px !important;
    z-index: 9999 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid var(--border-color) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.navbar .container,
body .navbar .container {
    max-width: 1200px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 2rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: 100% !important;
}

.navbar-nav,
body .navbar-nav {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2rem !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-direction: row !important;
    height: 100% !important;
}

.navbar-nav li,
body .navbar-nav li {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

.nav-link,
body .nav-link {
    color: var(--text-secondary) !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    transition: var(--transition) !important;
    position: relative !important;
    padding: 0.5rem 0 !important;
    display: block !important;
    white-space: nowrap !important;
}

.navbar-brand,
body .navbar-brand {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    text-decoration: none !important;
    transition: var(--transition) !important;
    display: block !important;
}

.navbar-toggler,
body .navbar-toggler {
    display: none !important;
}

/* ===== CSS VARIABLES ===== */
:root {
    --primary-color: #3b82f6;
    --secondary-color: #1e40af;
    --accent-color: #60a5fa;
    --hover-color: #60a5fa25;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-dark: #111827;
    --border-color: #e5e7eb;
    --border-dark: #374151;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1),
        0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1),
        0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1),
        0 8px 10px -6px rgb(0 0 0 / 0.1);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        sans-serif;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

body .navbar.scrolled,
.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: var(--shadow-md) !important;
}

body .navbar-brand:hover,
.navbar-brand:hover {
    color: var(--primary-color) !important;
}

body .nav-link::after,
.nav-link::after {
    content: "" !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 0 !important;
    height: 2px !important;
    background: var(--primary-color) !important;
    transition: var(--transition) !important;
}

body .nav-link:hover,
.nav-link:hover {
    color: var(--text-primary) !important;
}

body .nav-link:hover::after,
.nav-link:hover::after {
    width: 100% !important;
}

body .navbar-toggler:hover,
.navbar-toggler:hover {
    background: rgba(59, 130, 246, 0.1) !important;
}

body .navbar-toggler-icon,
.navbar-toggler-icon {
    width: 24px !important;
    height: 24px !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%231f2937' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: contain !important;
    transition: var(--transition) !important;
}

/* Mobile menu styles */
@media (max-width: 768px) {
    body .navbar-nav,
    .navbar-nav {
        position: fixed !important;
        top: 70px !important;
        left: 0 !important;
        right: 0 !important;
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        border-bottom: 1px solid var(--border-color) !important;
        box-shadow: var(--shadow-lg) !important;
        flex-direction: column !important;
        gap: 0 !important;
        padding: 1rem 0 !important;
        transform: translateY(-100%) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transition: all 0.3s ease !important;
        height: auto !important;
        max-height: none !important;
    }

    body .navbar-nav.show,
    .navbar-nav.show {
        transform: translateY(0) !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    body .navbar-nav li,
    .navbar-nav li {
        width: 100% !important;
    }

    body .nav-link,
    .nav-link {
        display: block !important;
        padding: 1rem 2rem !important;
        border-bottom: 1px solid var(--border-color) !important;
        color: var(--text-primary) !important;
        font-weight: 500 !important;
        text-align: left !important;
    }

    body .nav-link:last-child,
    .nav-link:last-child {
        border-bottom: none !important;
    }

    body .nav-link:hover,
    .nav-link:hover {
        background: rgba(59, 130, 246, 0.1) !important;
        color: var(--primary-color) !important;
    }

    body .nav-link::after,
    .nav-link::after {
        display: none !important;
    }

    body .navbar-toggler,
    .navbar-toggler {
        display: block !important;
    }

    body .navbar-toggler.active .navbar-toggler-icon,
    .navbar-toggler.active .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%231f2937' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M6 6L24 24M24 6L6 24'/%3e%3c/svg%3e") !important;
    }
}

@media (max-width: 480px) {
    body .navbar .container,
    .navbar .container {
        padding: 0 1rem !important;
    }

    body .navbar-nav,
    .navbar-nav {
        padding: 0.5rem 0 !important;
    }

    body .nav-link,
    .nav-link {
        padding: 0.75rem 1rem !important;
    }
}

/* ===== HERO SECTION ===== */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(
        180deg,
        rgba(147, 197, 253, 0.3) 0%,
        rgba(196, 181, 253, 0.25) 20%,
        rgba(167, 243, 208, 0.2) 40%,
        rgba(251, 207, 232, 0.15) 60%,
        rgba(255, 255, 255, 0.8) 80%,
        rgba(255, 255, 255, 1) 100%
    );
    position: relative;
    overflow: hidden;
    padding-top: 80px;
}

.hero-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
            circle at 90% 10%,
            rgba(147, 197, 253, 0.15) 0%,
            rgba(147, 197, 253, 0.03) 35%,
            transparent 70%
        ),
        radial-gradient(
            circle at 10% 90%,
            rgba(196, 181, 253, 0.15) 0%,
            rgba(196, 181, 253, 0.03) 35%,
            transparent 70%
        ),
        radial-gradient(
            circle at 50% 50%,
            rgba(167, 243, 208, 0.08) 0%,
            rgba(167, 243, 208, 0.01) 40%,
            transparent 80%
        );
    z-index: 1;
    animation: gradientShift 20s ease-in-out infinite;
}

.hero-section::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("./Images/Profile/Lasith_bg.png") center/cover;
    opacity: 0.02;
    z-index: 1;
}

@keyframes gradientShift {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(-10px, -10px) scale(1.05);
    }
    50% {
        transform: translate(10px, -5px) scale(0.95);
    }
    75% {
        transform: translate(-5px, 10px) scale(1.02);
    }
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.hero-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0.5rem 2rem 0;
    animation: fadeInUp 0.6s ease-out;
    box-shadow: var(--shadow-md);
    letter-spacing: 0.05em;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.1;
    animation: fadeInUp 0.6s ease-out 0.2s both;
    letter-spacing: 0.02em;
    word-wrap: break-word;
    overflow-wrap: break-word;
    -webkit-hyphens: auto;
    hyphens: auto;
}

.hero-subtitle {
    font-size: clamp(1.125rem, 2.5vw, 1.375rem);
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 0.6s ease-out 0.4s both;
    line-height: 1.4;
    font-weight: 400;
    word-wrap: break-word;
    overflow-wrap: break-word;
    -webkit-hyphens: auto;
    hyphens: auto;
}

.hero-cta-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    animation: fadeInUp 0.6s ease-out 0.6s both;
    flex-wrap: wrap;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    font-size: 1rem;
}

.hero-cta.primary {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

.hero-cta.primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.hero-cta.secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.hero-cta.secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.hero-tech-stack {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.tech-tag {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    padding: 0.4rem 1rem;
    border-radius: 25px; /* More oval/pill shape */
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(59, 130, 246, 0.2);
    transition: var(--transition);
    white-space: nowrap;
}

.tech-tag:hover {
    background: rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

/* ===== SECTIONS ===== */
section {
    padding: 5rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

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

/* ===== ABOUT SECTION ===== */
.about-section {
    background: var(--bg-secondary);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-content {
    max-width: 500px; /* Fixed width for description section */
}

.about-content h3 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.about-content p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.about-content strong {
    color: var(--primary-color);
    font-weight: 600;
}

.about-image {
    display: flex;
    justify-content: center;
}

/* ===== SKILLS SECTION ===== */
.skills-section {
    background: var(--bg-primary);
}

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

.skill-category {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    transition: var(--transition);
}

.skill-category:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.skill-category h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-category h4::before {
    content: "";
    width: 4px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 2px;
}

.skill-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.skill-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    transition: var(--transition);
    cursor: pointer;
}

.skill-item:hover {
    background: var(--hover-color);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.skill-item img {
    width: 35px;
    height: 35px;
    object-fit: contain;
    transition: var(--transition);
}

/* ===== PROJECTS SECTION ===== */
.projects-section {
    background: var(--bg-secondary);
}

.projects-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.875rem;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    align-items: stretch;
}

.project-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.project-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
    flex-shrink: 0;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
}

.project-content-section {
    padding: 1.5rem 1.5rem 0 1.5rem;
    flex: 1;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1rem; /* Reduced gap between content and tags */
    line-height: 1.6;
}

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

.project-tag {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    padding: 0.4rem 1rem;
    border-radius: 25px; /* More oval/pill shape */
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(59, 130, 246, 0.2);
    transition: var(--transition);
    white-space: nowrap;
}

.project-tag:hover {
    background: rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.project-links {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    margin-top: auto;
}

.project-link {
    flex: 1;
    text-align: center;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.875rem;
}

.project-link.primary {
    background: var(--primary-color);
    color: white;
}

.project-link.secondary {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.project-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.project-link.primary:hover {
    background: var(--secondary-color);
    color: white;
}

.project-link.secondary:hover {
    background: var(--primary-color);
    color: white;
}

/* ===== CONTACT SECTION ===== */
.contact-section {
    background: var(--bg-primary);
}

.contact-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 3rem;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
}

.contact-form {
    display: grid;
    gap: 1.5rem;
}

.form-group {
    display: grid;
    gap: 0.5rem;
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-primary);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: var(--bg-primary);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.submit-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-dark);
    color: white;
    padding: 3rem 0 2rem;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-brand {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-description {
    color: var(--text-light);
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

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

.social-link {
    color: var(--text-light);
    fill: var(--text-light);
    font-size: 1.5rem;
    transition: var(--transition);
    padding: 0.75rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: none;
    outline: none;
}

.social-link:hover {
    color: var(--primary-color);
    fill: var(--primary-color);
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-md);
}

.social-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.footer-bottom {
    border-top: 1px solid var(--border-dark);
    padding-top: 2rem;
    color: var(--text-light);
    font-size: 0.875rem;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .navbar-nav {
        display: none;
    }

    .navbar-toggler {
        display: block;
    }

    .hero-cta-group {
        flex-direction: column;
        align-items: center;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-content {
        max-width: 100%;
        text-align: center;
    }

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

    .contact-container {
        margin: 0 1rem;
        padding: 2rem;
    }

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

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

    .hero-content {
        padding: 0 1rem;
    }

    .projects-filters {
        flex-direction: column;
        align-items: center;
    }

    .filter-btn {
        width: 100%;
        max-width: 200px;
    }

    .hero-tech-stack {
        justify-content: center;
    }
}
