/* ==========================================================================
   Mohanraj Portfolio - Style Sheet
   ========================================================================== */

/* --- Root Color Variables --- */
:root {
    --bg-dark: #0b0f19;
    --bg-card: #151d30;
    --bg-card-hover: #1c2742;
    --primary: #00f2fe;
    --primary-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    --secondary-gradient: linear-gradient(135deg, #7928ca 0%, #ff0080 100%);
    --accent-glow: rgba(0, 242, 254, 0.25);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.08);
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Poppins', sans-serif;
    --transition-fast: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- Global Resets & Base Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

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

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #070a12;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #00f2fe, #4facfe);
    border-radius: 5px;
    border: 2px solid #070a12;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #7928ca, #ff0080);
}

/* --- Top & Side Scroll Progress Bars --- */
.scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: var(--primary-gradient);
    width: 0%;
    z-index: 10000;
    box-shadow: 0 0 10px var(--primary);
    transition: width 0.1s ease-out;
}

.side-scroll-indicator {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(21, 29, 48, 0.85);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    padding: 10px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    z-index: 999;
    letter-spacing: 1px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* --- Layout Containers & Typography --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

section {
    padding: 100px 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-title span {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 8px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-bounce);
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #070a12;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 30px rgba(0, 242, 254, 0.45);
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 2px solid var(--border-color);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(0, 242, 254, 0.15);
}

/* --- Header / Navigation --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    transition: var(--transition-fast);
    background: rgba(11, 15, 25, 0.75);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
}

.header.scrolled {
    padding: 14px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--primary);
}

.navbar {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-fast);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: var(--transition-fast);
    border-radius: 2px;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-main);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.hamburger {
    display: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
}

/* --- 1. Home Section --- */
.home {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 130px;
    background: radial-gradient(circle at 10% 20%, rgba(0, 242, 254, 0.05) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(121, 40, 202, 0.05) 0%, transparent 40%);
}

.home-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    align-items: center;
    gap: 40px;
}

.greeting {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(0, 242, 254, 0.1);
    border: 1px solid rgba(0, 242, 254, 0.2);
    border-radius: 30px;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.home-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 16px;
}

.home-title .highlight {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.running-text-wrapper {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 24px;
    min-height: 2.2rem;
}

.running-text {
    color: var(--text-main);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 2px;
}

.cursor {
    display: inline-block;
    width: 3px;
    background-color: var(--primary);
    animation: blink 0.7s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.home-description {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 36px;
    max-width: 540px;
}

.home-btn-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* Home Picture Card */
.home-img-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.img-glow-bg {
    position: absolute;
    width: 280px;
    height: 280px;
    background: var(--primary-gradient);
    filter: blur(80px);
    opacity: 0.35;
    border-radius: 50%;
    animation: pulseGlow 6s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
    0% { transform: scale(0.9); opacity: 0.25; }
    100% { transform: scale(1.15); opacity: 0.45; }
}

.img-card {
    position: relative;
    width: 320px;
    height: 360px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    animation: floatImage 4s ease-in-out infinite alternate;
}

@keyframes floatImage {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-16px); }
}

.avatar-illustration {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-illustration svg {
    width: 80%;
    height: 80%;
    filter: drop-shadow(0 10px 20px rgba(0, 242, 254, 0.3));
}

/* --- 2. Projects Section --- */
.projects {
    background: #080c14;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition-bounce);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: rgba(0, 242, 254, 0.4);
    box-shadow: 0 15px 35px rgba(0, 242, 254, 0.15);
}

.project-img-box {
    height: 200px;
    background: #0e1424;
    position: relative;
    overflow: hidden;
}

.project-preview {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    transition: var(--transition-fast);
}

.preview-1 { background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%); color: #fff; }
.preview-2 { background: linear-gradient(135deg, #f7971e 0%, #ffd200 100%); color: #fff; }
.preview-3 { background: linear-gradient(135deg, #8a2387 0%, #e94057 100%); color: #fff; }

.project-card:hover .project-preview {
    transform: scale(1.08);
}

.project-info {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-info h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.project-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
    flex-grow: 1;
}

.project-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.project-tags span {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 500;
}

.btn-visit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(0, 242, 254, 0.1);
    color: var(--primary);
    border: 1px solid rgba(0, 242, 254, 0.3);
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.btn-visit:hover {
    background: var(--primary);
    color: #070a12;
    box-shadow: 0 4px 15px var(--accent-glow);
}

/* --- 3. Skills Section --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 30px;
}

.skill-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    transition: var(--transition-bounce);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.skill-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.circle-box {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
}

.circle-svg {
    width: 120px;
    height: 120px;
    transform: rotate(-90deg);
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 8;
}

.circle-progress {
    fill: none;
    stroke: var(--stroke-color, var(--primary));
    stroke-width: 8;
    stroke-dasharray: 314.15; /* 2 * PI * 50 */
    stroke-dashoffset: 314.15;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.8s ease-in-out;
}

.percentage-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.skill-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.skill-label i {
    font-size: 1.25rem;
}

.skill-label h4 {
    font-size: 1rem;
    font-weight: 600;
}

/* --- 4. About Section --- */
.about {
    background: #080c14;
}

.about-container {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 50px;
    align-items: center;
}

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

.about-img-frame {
    position: relative;
    width: 320px;
    height: 380px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    transition: var(--transition-fast);
}

.about-img-frame:hover {
    border-color: var(--primary);
    transform: scale(1.02) rotate(1deg);
}

.light-sheen {
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transform: skewX(-20deg);
    transition: var(--transition-fast);
}

.about-img-frame:hover .light-sheen {
    animation: moveSheen 1.2s ease;
}

@keyframes moveSheen {
    100% { left: 180%; }
}

.about-illustration {
    font-size: 6rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.about-heading {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    line-height: 1.3;
    margin-bottom: 16px;
}

.about-bio {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 30px;
}

.education-header {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.education-timeline {
    position: relative;
    padding-left: 24px;
    border-left: 2px solid rgba(0, 242, 254, 0.3);
}

.edu-item {
    position: relative;
    margin-bottom: 24px;
}

.edu-item:last-child {
    margin-bottom: 0;
}

.edu-dot {
    position: absolute;
    left: -31px;
    top: 4px;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
}

.edu-degree {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.edu-college {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 2px 0 4px;
}

.edu-location {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- 5. Contact Section --- */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
}

.contact-form {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-group label i {
    color: var(--primary);
    margin-right: 6px;
}

.form-group input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(11, 15, 25, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition-fast);
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
}

.btn-submit {
    width: 100%;
    margin-top: 10px;
}

.form-alert {
    margin-top: 15px;
    font-size: 0.9rem;
    text-align: center;
    display: none;
}

.form-alert.success {
    display: block;
    color: #2ed573;
}

.social-links-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 40px;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.social-links-box h4 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin-bottom: 30px;
}

.social-icons {
    display: flex;
    gap: 20px;
}

.social-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-main);
    text-decoration: none;
    transition: var(--transition-bounce);
}

.social-icon.mail:hover {
    background: #ff4757;
    border-color: #ff4757;
    color: #fff;
    transform: translateY(-8px) scale(1.1);
    box-shadow: 0 10px 25px rgba(255, 71, 87, 0.4);
}

.social-icon.youtube:hover {
    background: #ff0000;
    border-color: #ff0000;
    color: #fff;
    transform: translateY(-8px) scale(1.1);
    box-shadow: 0 10px 25px rgba(255, 0, 0, 0.4);
}

.social-icon.github:hover {
    /* background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); */
    background-color: black;
    border-color: #efe9ea;
    color: #fff;
    transform: translateY(-8px) scale(1.1);
    box-shadow: 0 10px 25px rgba(234, 231, 232, 0.4);
}

/* --- Footer --- */
.footer {
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background: #070a12;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- Responsive Media Queries --- */
@media (max-width: 992px) {
    .home-container, .about-container, .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .home-content {
        text-align: center;
    }

    .home-description {
        margin: 0 auto 36px;
    }

    .home-btn-group {
        justify-content: center;
    }

    .home-img-wrapper {
        order: -1;
    }

    .about-img-col {
        order: -1;
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }

    .home-title {
        font-size: 2.5rem;
    }

    .running-text-wrapper {
        font-size: 1.3rem;
    }

    .navbar {
        position: fixed;
        top: 75px;
        right: -100%;
        width: 250px;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(20px);
        border: 1px solid var(--border-color);
        border-radius: 16px 0 0 16px;
        flex-direction: column;
        padding: 30px;
        transition: var(--transition-fast);
        box-shadow: -10px 20px 30px rgba(0, 0, 0, 0.5);
    }

    .navbar.open {
        right: 0;
    }

    .hamburger {
        display: block;
    }

    .side-scroll-indicator {
        display: none;
    }
}
