:root {
    --light-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --dark-bg: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    --light-color: #1a1a2e;
    --dark-color: #ffffff;
    --button-bg: #667eea;
    --button-hover: #764ba2;
    --progress-msg-color: #4ade80;
    --random-msg-color-day: #1e3a8a;
    --random-msg-color-night: #86efac;
    --card-light: rgba(255, 255, 255, 0.95);
    --card-dark: rgba(15, 23, 42, 0.95);
    --shadow-light: 0 20px 60px rgba(0, 0, 0, 0.15);
    --shadow-dark: 0 20px 60px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: "Poppins", sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 1.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow-x: hidden;
    color: var(--light-color);
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
    animation: float 15s ease-in-out infinite;
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
    animation: gridMove 20s linear infinite;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

body.dark-mode {
    background: #0a0a1f;
    color: var(--dark-color);
}

body.dark-mode::before {
    background: 
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 40%);
}

body.dark-mode::after {
    background-image: 
        linear-gradient(rgba(102, 126, 234, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(102, 126, 234, 0.03) 1px, transparent 1px);
}

.particle {
    position: fixed;
    width: 4px;
    height: 4px;
    background: rgba(139, 92, 246, 0.6);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: particleFloat 3s ease-in-out infinite;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(20px);
        opacity: 0;
    }
}

body > h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
    animation: fadeInDown 0.8s ease-out;
    filter: drop-shadow(0 2px 8px rgba(30, 27, 75, 0.3));
}

body.dark-mode > h1 {
    background: linear-gradient(135deg, #a78bfa 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInDown 0.8s ease-out, glow 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(167, 139, 250, 0.4));
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes glow {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(129, 140, 248, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 40px rgba(192, 132, 252, 0.6));
    }
}

#progress-img {
    display: block;
    margin: 2.5rem auto;
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: 2rem;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    animation: fadeInUp 0.8s ease-out 0.2s both;
    background: rgba(255, 255, 255, 0.15);
    padding: 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

body.dark-mode #progress-img {
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 100px rgba(129, 140, 248, 0.1);
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.1);
}

#progress-img:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 40px 100px rgba(91, 33, 182, 0.3);
}

body.dark-mode #progress-img:hover {
    box-shadow: 0 40px 100px rgba(129, 140, 248, 0.3);
}

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

#animation-container {
    width: 300px;
    height: 300px;
    margin: 2.5rem auto;
    background: transparent;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 1s ease-out 0.4s both;
    filter: drop-shadow(0 0 30px rgba(139, 92, 246, 0.3));
}

#animation-container:hover {
    filter: drop-shadow(0 0 50px rgba(139, 92, 246, 0.5));
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.dateBox {
    display: flex;
    gap: 1rem;
    margin: 3rem auto;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 650px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.fromDate,
.toDate {
    padding: 1rem 1.5rem;
    border-radius: 1.25rem;
    border: 2px solid rgba(91, 33, 182, 0.4);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    font-family: "Poppins", sans-serif;
    font-size: 1rem;
    color: var(--light-color);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    outline: none;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

body.dark-mode .fromDate,
body.dark-mode .toDate {
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.4);
    color: var(--dark-color);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.fromDate:hover,
.toDate:hover,
.fromDate:focus,
.toDate:focus {
    border-color: rgba(91, 33, 182, 0.8);
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(91, 33, 182, 0.3);
}

body.dark-mode .fromDate:hover,
body.dark-mode .toDate:hover,
body.dark-mode .fromDate:focus,
body.dark-mode .toDate:focus {
    border-color: rgba(139, 92, 246, 0.8);
    background: rgba(139, 92, 246, 0.15);
    box-shadow: 0 15px 40px rgba(139, 92, 246, 0.3);
}

.submit {
    padding: 1rem 2.5rem;
    border-radius: 1.25rem;
    border: none;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    color: white;
    font-family: "Poppins", sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
}

.submit::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
}

.submit:hover::before {
    left: 100%;
}

.submit:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 20px 50px rgba(139, 92, 246, 0.6);
}

.submit:active {
    transform: translateY(-2px) scale(1.02);
}

#theme-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(91, 33, 182, 0.4);
    font-size: 1.3rem;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 100;
    color: var(--light-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

body.dark-mode #theme-toggle {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.5);
    color: var(--dark-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#theme-toggle:hover {
    transform: rotate(180deg) scale(1.15);
    box-shadow: 0 15px 40px rgba(91, 33, 182, 0.4);
    background: rgba(255, 255, 255, 0.35);
}

body.dark-mode #theme-toggle:hover {
    box-shadow: 0 15px 40px rgba(139, 92, 246, 0.5);
    background: rgba(139, 92, 246, 0.25);
}

#theme-toggle i {
    transition: all 0.3s ease;
}

#random-msg-container {
    margin: 3rem auto;
    max-width: 750px;
    text-align: center;
    padding: 0 1.5rem;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

#random-msg {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-weight: 600;
    line-height: 1.7;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.25) !important;
    backdrop-filter: blur(20px);
    border-radius: 1.5rem;
    border: 2px solid rgba(91, 33, 182, 0.4);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    background-clip: border-box !important;
    -webkit-background-clip: border-box !important;
    -webkit-text-fill-color: #5b21b6 !important;
    color: #5b21b6 !important;
    transition: all 0.3s ease;
}

#random-msg:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 60px rgba(91, 33, 182, 0.3);
}

body.dark-mode #random-msg {
    background: rgba(139, 92, 246, 0.15) !important;
    border-color: rgba(139, 92, 246, 0.4);
    -webkit-text-fill-color: #c4b5fd !important;
    color: #c4b5fd !important;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
}

body.dark-mode #random-msg:hover {
    box-shadow: 0 20px 60px rgba(139, 92, 246, 0.3);
}

body #random-msg {
    -webkit-text-fill-color: #5b21b6 !important;
    color: #5b21b6 !important;
}

body.dark-mode #random-msg {
    -webkit-text-fill-color: #c4b5fd !important;
    color: #c4b5fd !important;
}

#contribution-container {
    position: fixed;
    right: 2rem;
    bottom: 2rem;
    text-align: center;
    z-index: 100;
    animation: fadeIn 1s ease-out 1s both;
}

#contribution-container p {
    font-size: 0.95rem;
    margin: 0 0 0.5rem 0;
    color: var(--light-color);
    font-weight: 600;
    animation: slideUpDown 2.5s ease-in-out infinite;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

body.dark-mode #contribution-container p {
    color: var(--dark-color);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

#arrow-down {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid currentColor;
    margin: 0.5rem auto;
    animation: slideUpDown 2.5s ease-in-out infinite;
    color: #5b21b6;
}

body.dark-mode #arrow-down {
    color: #a78bfa;
}

.github-icon {
    width: 55px;
    height: 55px;
    animation: pulse 2.5s infinite;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.4));
}

.github-icon:hover {
    transform: scale(1.2) rotate(10deg);
    filter: drop-shadow(0 12px 30px rgba(139, 92, 246, 0.6));
}

.github-icon.invert {
    filter: invert(1) drop-shadow(0 8px 20px rgba(0, 0, 0, 0.5));
}

.github-icon.invert:hover {
    filter: invert(1) brightness(1.3) drop-shadow(0 12px 30px rgba(167, 139, 250, 0.7));
}

@keyframes slideUpDown {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-12px);
    }
}

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

footer {
    margin: 5rem 0 0 0;
    padding: 2.5rem 1.5rem;
    background: rgba(10, 10, 31, 0.9);
    backdrop-filter: blur(20px);
    text-align: center;
    color: #fff;
    width: 100%;
    position: relative;
    z-index: 1;
    border-top: 2px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
}

footer p {
    margin: 0.75rem 0;
    font-size: 1rem;
    opacity: 0.9;
}

.footer-link {
    color: #a78bfa;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    font-weight: 600;
}

.footer-link::after {
    content: "";
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #8b5cf6, #ec4899);
    transition: width 0.3s ease;
}

.footer-link:hover {
    color: #c4b5fd;
    text-shadow: 0 0 20px rgba(167, 139, 250, 0.5);
}

.footer-link:hover::after {
    width: 100%;
}

@media (max-width: 768px) {
    body {
        padding: 2rem 1rem;
    }

    body > h1 {
        font-size: 2.5rem;
        margin-bottom: 2rem;
    }

    #progress-img {
        max-width: 450px;
        margin: 2rem auto;
        padding: 1rem;
    }

    #animation-container {
        width: 250px;
        height: 250px;
        margin: 2rem auto;
    }

    #theme-toggle {
        top: 1.5rem;
        right: 1.5rem;
        width: 3.5rem;
        height: 3.5rem;
        font-size: 1.1rem;
    }

    .dateBox {
        gap: 0.75rem;
        margin: 2.5rem auto;
    }

    .fromDate,
    .toDate,
    .submit {
        padding: 0.85rem 1.2rem;
        font-size: 0.95rem;
    }

    #random-msg-container {
        margin: 2.5rem auto;
    }

    #random-msg {
        font-size: 1.1rem;
        padding: 1.5rem;
    }

    #contribution-container {
        right: 1.5rem;
        bottom: 1.5rem;
    }

    .github-icon {
        width: 50px;
        height: 50px;
    }

    footer {
        margin-top: 4rem;
        padding: 2rem 1rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 1.5rem 0.75rem;
    }

    body > h1 {
        font-size: 2rem;
    }

    #progress-img {
        max-width: 340px;
        border-radius: 1.25rem;
        padding: 0.75rem;
    }

    #animation-container {
        width: 200px;
        height: 200px;
    }

    #theme-toggle {
        width: 3rem;
        height: 3rem;
        font-size: 1rem;
        top: 1rem;
        right: 1rem;
    }

    .dateBox {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
        max-width: 340px;
    }

    .fromDate,
    .toDate,
    .submit {
        width: 100%;
        padding: 0.9rem;
    }

    #random-msg {
        font-size: 1rem;
        padding: 1.25rem;
    }

    #contribution-container {
        right: 1rem;
        bottom: 1rem;
    }

    #contribution-container p {
        font-size: 0.85rem;
    }

    .github-icon {
        width: 45px;
        height: 45px;
    }

    footer {
        margin-top: 3rem;
    }

    footer p {
        font-size: 0.9rem;
    }
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}