@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #2e7d32;
    --primary-light: #4caf50;
    --text-main: #333;
    --text-muted: #666;
    --bg-gradient-start: #e8f5e9;
    --bg-gradient-end: #c8e6c9;
    --glass-bg: #ffffff;
    --glass-border: rgba(255, 255, 255, 0.4);
    --translucent-bg: rgba(255, 255, 255, 0.5);
    --solid-overlay: rgba(255, 255, 255, 0.95);
    --tag-bg: #ffffff;
    --name-color: #fff;
    --name-shadow: rgba(0, 0, 0, 0.5);
    --timeline-line: rgba(76, 175, 80, 0.3);
}

body.dark-mode {
    --primary-color: #66bb6a;
    --primary-light: #81c784;
    --text-main: #e0e0e0;
    --text-muted: #aaaaaa;
    --bg-gradient-start: #121212;
    --bg-gradient-end: #1e1e1e;
    --glass-bg: #2d2d2d;
    --glass-border: rgba(255, 255, 255, 0.1);
    --translucent-bg: rgba(45, 45, 45, 0.7);
    --solid-overlay: rgba(45, 45, 45, 0.95);
    --tag-bg: #2d2d2d;
    --name-color: #e0e0e0;
    --name-shadow: rgba(0, 0, 0, 0.8);
    --timeline-line: rgba(129, 199, 132, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 10px 20px;
    overflow-x: hidden;
    position: relative;
    color: var(--text-main);
    transition: background 0.5s ease;
}

/* Background border */
.bg-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 1;
    z-index: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

/* Night video hidden by default (day mode) */
.night-video-hidden {
    opacity: 0 !important;
    pointer-events: none;
}

/* Day video hidden in dark mode */
body.dark-mode #bg-video {
    opacity: 0;
}

/* Night video visible in dark mode */
body.dark-mode #night-video {
    opacity: 1 !important;
}

/* Petals / Rain Animation Container */
#petals-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
    border-radius: 24px;
}

/* Raindrop Style (Night Mode) */
.raindrop {
    position: absolute;
    top: -30px;
    width: 2px;
    border-radius: 0 0 3px 3px;
    background: linear-gradient(to bottom, transparent, rgba(130, 200, 255, 0.85));
    animation: rain-fall linear forwards;
    opacity: 0.8;
}

@keyframes rain-fall {
    0% {
        top: -5%;
        opacity: 0;
    }

    5% {
        opacity: 0.8;
    }

    95% {
        opacity: 0.6;
    }

    100% {
        top: 110%;
        opacity: 0;
    }
}

.petal {
    position: absolute;
    top: -100px;
    will-change: transform, top;
    animation: fall linear forwards;
    filter: drop-shadow(0px 4px 6px rgba(0, 0, 0, 0.1));
}

@keyframes fall {
    0% {
        top: -10%;
        transform: translateX(0) rotate(0deg);
    }

    100% {
        top: 110%;
        transform: translateX(100px) rotate(360deg);
    }
}

/* CV Layout */
.cv-wrapper {
    position: relative;
    z-index: 5;
    max-width: 950px;
    width: 100%;
    animation: fadeIn 1s ease-out;
    overflow: hidden;
    border-radius: 24px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.glass-panel {
    background: var(--glass-bg);
    position: relative;
    border-radius: 24px;
    padding: 50px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: background 0.5s ease;
}

.cv-header {
    position: relative;
    z-index: 5;
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 30px;
    margin-bottom: 40px;
}

.cv-body {
    position: relative;
    z-index: 5;
}

.header-top {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.logo-area {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-border {
    position: absolute;
    width: 180%;
    height: 180%;
    top: 50%;
    left: 45%;
    transform: translate(-50%, -50%);
    object-fit: contain;
    z-index: 3;
    pointer-events: none;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.ug-logo {
    top: -10px;
    left: 10px;
    width: 90%;
    height: 90%;
    object-fit: cover;
    border-radius: 50%;
    z-index: 2;
    position: relative;
}

.title-area {
    text-align: center;
}

.name-plate-wrapper {
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 50px 50px 50px 300px;
    /* Left padding 110px clears the roses on the left */
    margin-bottom: 10px;
    max-width: 200%;
    overflow: hidden;
    /* Hides cropped portions of the plate image */
    border-radius: 0px;
}

.name-plate-img {
    position: absolute;
    top: 50%;
    left: 45%;
    transform: translate(-50%, -50%);
    width: 70%;
    /* Crops out blank left/right edges */
    height: 200%;
    /* Zooms in vertically to crop out empty top/bottom space */
    z-index: 1;
    object-fit: fill;
    pointer-events: none;
}

.name-plate-wrapper h1 {
    position: relative;
    z-index: 2;
    font-size: 2.8rem;
    color: var(--name-color);
    margin: 0;
    left: -100px;
    font-weight: 700;
    text-shadow: 2px 2px 4px var(--name-shadow);
    transition: color 0.5s ease, text-shadow 0.5s ease;
    white-space: nowrap;
}

/* Styling for individual letters of the typed name */
.char-glow {
    display: inline-block;
    opacity: 0;
    transform: scale(0.5) translateY(5px);
    animation: 
        char-appear 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
        neon-color-shift 6s linear infinite;
    animation-delay: var(--appear-delay), calc(var(--char-index) * -0.4s);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), text-shadow 0.25s ease, filter 0.25s ease;
    cursor: default;
    white-space: pre; /* Preserves spaces */
}

/* Hover effect on individual characters */
.char-glow:hover {
    transform: translateY(-12px) scale(1.3) rotate(4deg);
    text-shadow: 0 0 10px currentColor, 0 0 25px currentColor, 0 0 50px currentColor;
    z-index: 10;
    filter: brightness(1.3);
}

/* Bouncy appear animation */
@keyframes char-appear {
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Moving neon color cycle */
@keyframes neon-color-shift {
    0%, 100% {
        color: #ff3366; /* Neon Rose */
        text-shadow: 0 0 5px rgba(255, 51, 102, 0.4);
    }
    16.6% {
        color: #ff9933; /* Neon Orange */
        text-shadow: 0 0 5px rgba(255, 153, 51, 0.4);
    }
    33.3% {
        color: #ffff33; /* Neon Yellow */
        text-shadow: 0 0 5px rgba(255, 255, 51, 0.4);
    }
    50% {
        color: #33ff66; /* Neon Green */
        text-shadow: 0 0 5px rgba(51, 255, 102, 0.4);
    }
    66.6% {
        color: #33ccff; /* Neon Cyan */
        text-shadow: 0 0 5px rgba(51, 204, 255, 0.4);
    }
    83.3% {
        color: #9933ff; /* Neon Purple */
        text-shadow: 0 0 5px rgba(153, 51, 255, 0.4);
    }
}

/* Blinking cursor style */
.name-typing-cursor {
    display: inline-block;
    color: var(--primary-light);
    font-weight: 300;
    margin-left: 2px;
    font-size: 2.8rem;
    animation: cursor-blink 0.8s infinite alternate;
    transition: opacity 0.5s ease;
    vertical-align: middle;
}

@keyframes cursor-blink {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.name-typing-cursor.fade-out {
    opacity: 0;
}

.contact {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    color: #ffffff;
    font-size: 1.15rem;
    overflow: visible;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease, transform 0.3s ease;
}

.contact-link:hover {
    color: #000000;
    transform: translateY(-2px);
}

.icon-colorful {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-link:hover .icon-colorful {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.location-icon {
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
}

.whatsapp-icon {
    background: linear-gradient(135deg, #25D366, #128C7E);
}

.email-icon {
    background: linear-gradient(135deg, #4285F4, #34A853, #FBBC05, #EA4335);
}

.cv-section {
    margin-bottom: 40px;
}

.cv-section h2 {
    font-size: 1.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 25px;
    position: relative;
    display: inline-block;
    animation: text-color-glow-cycle 5s linear infinite;
}

.cv-section h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 50px;
    height: 4px;
    background: linear-gradient(90deg, #ff0000, #ff8000, #e6e600, #00b300, #00cccc, #0000ff, #8000ff, #ff0080, #ff0000);
    background-size: 200% auto;
    border-radius: 2px;
    animation: underline-glow 5s linear infinite;
}

@keyframes text-color-glow-cycle {
    0% {
        color: #ff0000;
        text-shadow: 0 0 8px rgba(255, 0, 0, 0.6);
    }

    14% {
        color: #ff8000;
        text-shadow: 0 0 8px rgba(255, 128, 0, 0.6);
    }

    28% {
        color: #e6e600;
        text-shadow: 0 0 8px rgba(230, 230, 0, 0.6);
    }

    42% {
        color: #00b300;
        text-shadow: 0 0 8px rgba(0, 179, 0, 0.6);
    }

    57% {
        color: #00cccc;
        text-shadow: 0 0 8px rgba(0, 204, 204, 0.6);
    }

    71% {
        color: #0000ff;
        text-shadow: 0 0 8px rgba(0, 0, 255, 0.6);
    }

    85% {
        color: #8000ff;
        text-shadow: 0 0 8px rgba(128, 0, 255, 0.6);
    }

    100% {
        color: #ff0000;
        text-shadow: 0 0 8px rgba(255, 0, 0, 0.6);
    }
}

@keyframes underline-glow {
    0% {
        background-position: 0% center;
        width: 50px;
    }

    50% {
        width: 100%;
    }

    100% {
        background-position: 200% center;
        width: 50px;
    }
}

/* Personal Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.info-item {
    background: var(--translucent-bg);
    padding: 15px;
    border-radius: 12px;
    transition: background 0.5s ease;
}

.info-item .label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.info-item .value {
    font-size: 1.1rem;
    color: var(--text-main);
    font-weight: 500;
}

.objective-text {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-main);
    background: var(--translucent-bg);
    padding: 15px;
    border-radius: 12px;
    transition: background 0.5s ease, color 0.5s ease;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 2px;
    background: var(--timeline-line);
    transition: background 0.5s ease;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
}

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

.timeline-dot {
    position: absolute;
    left: -35px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.2);
}

.timeline-content {
    background: var(--translucent-bg);
    padding: 20px;
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.5s ease;
}

.timeline-content:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.timeline-content h3 {
    color: var(--text-main);
    margin-bottom: 5px;
}

.timeline-content .date {
    display: inline-block;
    padding: 4px 10px;
    background: var(--primary-light);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

/* Tags */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    position: relative;
    background: var(--tag-bg);
    color: var(--text-main);
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 700;
    border: none;
    overflow: hidden;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, background 0.5s ease, color 0.5s ease;
}

.tag::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: conic-gradient(from 0deg, #ff0000, #ff8000, #ffff00, #00ff00, #00ffff, #0000ff, #8000ff, #ff0080, #ff0000);
    animation: spin-border 3s linear infinite;
    z-index: -2;
}

.tag::after {
    content: '';
    position: absolute;
    inset: 3px;
    background: var(--tag-bg);
    border-radius: 22px;
    z-index: -1;
    transition: background 0.5s ease;
}

.tag:hover {
    transform: scale(1.05);
}

.typing-text {
    position: relative;
    display: inline-block;
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.05rem;
    transition: color 0.5s ease;
}

.typing-text::after {
    content: '';
    position: absolute;
    top: -2px;
    right: 0;
    bottom: -2px;
    left: 0;
    background: var(--tag-bg);
    border-left: 2px solid var(--typing-cursor);
    animation: typing-reveal 4s steps(20, end) infinite;
    transition: background 0.5s ease, border-color 0.5s ease;
}

@keyframes typing-reveal {

    0%,
    20% {
        left: 0;
    }

    40%,
    80% {
        left: 100%;
    }

    100% {
        left: 0;
    }
}

@media (max-width: 600px) {
    body {
        padding: 15px 10px;
    }

    .glass-panel {
        padding: 20px 15px;
    }

    .cv-header {
        padding-bottom: 15px;
        margin-bottom: 20px;
    }

    .logo-area {
        width: 120px;
        height: 120px;
    }

    .title-area h1,
    .name-plate-wrapper h1 {
        font-size: 1.6rem;
    }

    .name-plate-wrapper {
        padding: 6px 20px 6px 55px !important;
    }

    .header-top {
        flex-direction: column;
        gap: 10px;
    }

    .contact {
        gap: 10px;
        font-size: 1rem;
    }

    .cv-section {
        margin-bottom: 20px;
    }

    .cv-section h2 {
        font-size: 1.4rem;
        margin-bottom: 15px;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .info-item {
        padding: 10px;
    }

    .objective-text {
        padding: 12px;
        font-size: 0.95rem;
    }

    .timeline-item {
        margin-bottom: 15px;
    }

    .timeline-content {
        padding: 12px;
    }
}

/* Shared Animated Hover Box */
.hover-animate-box {
    position: relative;
    z-index: 1;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-animate-box::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: conic-gradient(from 0deg, #ff0000, #ff8000, #ffff00, #00ff00, #00ffff, #0000ff, #8000ff, #ff0080, #ff0000);
    animation: spin-border 3s linear infinite;
    z-index: -2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hover-animate-box::after {
    content: '';
    position: absolute;
    inset: 3px;
    background: var(--solid-overlay);
    border-radius: 9px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.5s ease;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--glass-bg);
    border: 2px solid var(--primary-light);
    color: var(--text-main);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

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

.hover-animate-box:hover::before,
.hover-animate-box:hover::after {
    opacity: 1;
}

@keyframes spin-border {
    100% {
        transform: rotate(360deg);
    }
}