/* General Setup */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    scroll-behavior: smooth;
}

body {
    background-color: #0f172a;
    color: #e2e8f0;
    overflow-x: hidden;
    position: relative;
}

/* Custom Cursor Animation */
@media (min-width: 768px) {
    body, a, button, .project-card, .social-links a {
        cursor: none !important;
    }
}

.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 30px;
    height: 30px;
    border: 2px solid #ec4899;
    border-radius: 50%;
    pointer-events: none;
    z-index: 100000;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.5);
    display: none; 
}

@media (min-width: 768px) {
    .custom-cursor {
        display: block; 
    }
}

.custom-cursor.hovered {
    width: 60px;
    height: 60px;
    background-color: rgba(99, 102, 241, 0.2);
    border-color: #6366f1;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

/* Background Glowing Orbs */
.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    animation: float 10s infinite alternate;
}
.circle-1 {
    width: 400px;
    height: 400px;
    background: rgba(99, 102, 241, 0.3);
    top: -100px;
    left: -100px;
}
.circle-2 {
    width: 300px;
    height: 300px;
    background: rgba(236, 72, 153, 0.2);
    bottom: 20%;
    right: -50px;
    animation-delay: 2s;
}

@keyframes float {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(50px) scale(1.1); }
}

/* Glassmorphism Card */
.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Navigation */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 8%;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.logo { font-size: 1.8rem; font-weight: 700; }
.logo span { color: #6366f1; }
nav ul { list-style: none; display: flex; gap: 30px; align-items: center; }
nav a { text-decoration: none; color: #cbd5e1; font-weight: 500; transition: 0.3s; }
nav a:hover { color: #fff; }

/* Buttons */
.btn-primary, .btn-secondary, .btn-outline {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.3s;
}
.btn-primary { background: linear-gradient(45deg, #6366f1, #ec4899); color: #fff; border: none; }
.btn-primary:hover { box-shadow: 0 0 15px rgba(99, 102, 241, 0.6); transform: translateY(-2px); }
.btn-secondary { background: rgba(255,255,255,0.1); color: #fff; }
.btn-secondary:hover { background: rgba(255,255,255,0.2); }
.btn-outline { border: 1px solid #6366f1; color: #fff; }
.btn-outline:hover { background: #6366f1; }

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 8% 50px;
}
.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
    width: 100%;
    max-width: 1200px;
    flex-wrap: wrap-reverse;
}
.hero-text { flex: 1; min-width: 300px; }
.greeting { font-size: 1.5rem; color: #cbd5e1; margin-bottom: 10px; }
.name { font-size: 3.5rem; font-weight: 700; margin-bottom: 20px; line-height: 1.2; }
.name span { background: linear-gradient(45deg, #6366f1, #ec4899); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { font-size: 1.1rem; color: #94a3b8; margin-bottom: 30px; }
.hero-btns { display: flex; gap: 15px; }

/* Profile Image */
.hero-image {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 300px;
}
.profile-pic {
    width: 320px;
    height: 320px;
    border-radius: 50%;
    object-fit: cover;
    z-index: 10;
    border: 4px solid rgba(255, 255, 255, 0.1);
}
.glow-ring {
    position: absolute;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: linear-gradient(45deg, #6366f1, #ec4899);
    filter: blur(20px);
    opacity: 0.6;
    animation: pulse 3s infinite alternate;
    z-index: 1;
}
@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.5; }
    100% { transform: scale(1.05); opacity: 0.8; }
}

/* Typewriter Cursor Animation */
.cursor {
    font-weight: bold;
    color: #60a5fa;
    animation: blink 0.8s infinite;
    margin-left: 5px;
}
@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

/* About Section Layout */
.about-section {
    padding: 80px 10%;
    text-align: center;
}
.about-section h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5rem;
}
.about-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
}
.about-img {
    flex: 1;
    max-width: 300px;
}
.about-img img {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}
.about-img img:hover {
    transform: scale(1.05);
}
.about-text {
    flex: 2;
    text-align: left;
    padding: 40px;
    line-height: 1.8;
    margin: 0; 
}

/* Mobile Responsive For About Section */
@media (max-width: 768px) {
    .about-content {
        flex-direction: column;
        text-align: center;
    }
    .about-img {
        max-width: 250px;
    }
    .about-text {
        text-align: center;
        padding: 25px;
    }
}

/* Education Timeline */
.education-section { padding: 80px 8%; }
.education-section h2, .skills-section h2, .projects-section h2 {
    text-align: center; font-size: 2.5rem; margin-bottom: 50px;
}
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding-left: 30px;
    border-left: 2px solid rgba(99, 102, 241, 0.5);
}
.timeline-item { position: relative; margin-bottom: 30px; padding: 25px; }
.timeline-dot {
    position: absolute;
    left: -42px;
    top: 30px;
    width: 20px;
    height: 20px;
    background: #ec4899;
    border-radius: 50%;
    box-shadow: 0 0 10px #ec4899;
}
.timeline-item h3 { color: #fff; font-size: 1.3rem; margin-bottom: 5px; }
.timeline-item h4 { color: #6366f1; font-size: 1rem; margin-bottom: 15px; font-weight: 500; }
.timeline-item p { color: #94a3b8; font-size: 0.95rem; }

/* Skills Section */
.skills-section { padding: 80px 8%; }
.skills-container {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; max-width: 800px; margin: 0 auto;
}
.skill-tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 500;
    transition: 0.3s;
}
.skill-tag:hover { background: #6366f1; color: #fff; transform: translateY(-3px); }

/* Projects Grid */
.projects-section { padding: 80px 8%; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 30px; }

/* Project Card & Anchor styles */
.project-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    overflow: hidden;
    transition: 0.4s;
    text-decoration: none; 
    color: inherit; 
    display: block; 
}
.project-card:hover {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 15px 35px rgba(0,0,0,0.4); 
}

/* Project Image & Zoom Effect */
.project-img { 
    height: 220px; 
    overflow: hidden; 
    display: block;
}
.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.5s ease;
}
.project-card:hover .project-img img {
    transform: scale(1.08);
}

.project-info { padding: 25px; }
.project-info h3 { font-size: 1.5rem; margin-bottom: 10px; }
.project-info p { color: #94a3b8; font-size: 0.95rem; margin-bottom: 20px; }
.tags { display: flex; gap: 10px; }
.tags span { font-size: 0.8rem; padding: 5px 12px; background: rgba(99, 102, 241, 0.2); color: #818cf8; border-radius: 15px; }

/* Scroll Animations */
.reveal { opacity: 0; transform: translateY(50px); transition: all 0.8s ease-in-out; }
.reveal.active { opacity: 1; transform: translateY(0); }

/* Remove default purple color from clicked links */
a:visited {
    color: inherit;
}
.project-card:visited h3 {
    color: #fff; 
}
.project-card:visited p {
    color: #94a3b8; 
}
a, .project-card, .project-card * {
    text-decoration: none !important;
}

/* Scroll Progress Indicator Styles */
.scroll-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.05);
    z-index: 10000;
}
.scroll-progress-bar {
    height: 5px;
    background: linear-gradient(45deg, #6366f1, #ec4899);
    width: 0%;
    border-radius: 0 5px 5px 0;
    transition: width 0.1s;
}

/* ---------------------------------
   අලුත් අංග: Preloader සහ Social Links 
-----------------------------------*/

/* Preloader Animation */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #0f172a;
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loader-logo {
    font-size: 4rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 5px;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #6366f1, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: pulse-logo 1.5s infinite alternate;
}

.loader-bar {
    width: 150px;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}

.loader-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 50%;
    height: 100%;
    background: linear-gradient(45deg, #6366f1, #ec4899);
    animation: loading-bar 1s infinite linear;
}

@keyframes pulse-logo {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.1); opacity: 1; filter: drop-shadow(0 0 15px rgba(236, 72, 153, 0.6)); }
}

@keyframes loading-bar {
    0% { left: -50%; }
    100% { left: 100%; }
}

/* Social Media Links Styles */
.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 35px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    font-size: 1.3rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.social-links a:hover {
    background: #6366f1;
    color: #fff;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.4);
    border-color: #6366f1;
}

/* Social links වලට වෙනම පාට (Hover කරද්දී) */
.social-links a:nth-child(2):hover {
    background: #0077b5; /* LinkedIn Blue */
    border-color: #0077b5;
    box-shadow: 0 10px 20px rgba(0, 119, 181, 0.4);
}
.social-links a:nth-child(3):hover {
    background: #1877f2; /* Facebook Blue */
    border-color: #1877f2;
    box-shadow: 0 10px 20px rgba(24, 119, 242, 0.4);
}
.social-links a:nth-child(4):hover {
    background: #25d366; /* WhatsApp Green */
    border-color: #25d366;
    box-shadow: 0 10px 20px rgba(37, 211, 102, 0.4);
}