/* Base styles and animations */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

/* Theme transition */
* {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Primary Colors */
.color-primary {
    background-color: #a084dc; /* Soft lavender */
}
.color-primary-light {
    background-color: #d5b4e2; /* Light lavender */
}

/* Secondary Colors */
.color-secondary {
    background-color: #7a5ea8; /* Darker lavender */
}
.color-secondary-dark {
    background-color: #5c4b99; /* Deep purple-lavender */
}

/* Background Colors */
body {
    background: linear-gradient(135deg, #f5f3ff 0%, #e9d5ff 100%);
    background-attachment: fixed; /* Prevents gradient from scrolling */
    background-size: 400% 400%; /* Larger size for smoother animation */
    animation: gradientMove 15s ease infinite;
    color: #4a4a4a; /* Dark gray for contrast */
    font-family: "Poppins", sans-serif;
    margin: 0;
    padding: 0.5rem;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    overflow-y: auto; /* Allow vertical scroll if needed */
    cursor: none;
}

body.loaded {
    opacity: 1;
}

/* Add gradient animation */
@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Cursor Styles */
.cursor {
    width: 20px;
    height: 20px;
    border: 2px solid #a084dc;
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.2s ease, opacity 0.2s ease;
    transform-origin: center;
    mix-blend-mode: difference;
}

.cursor-dot {
    width: 4px;
    height: 4px;
    background: #a084dc;
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.1s ease, opacity 0.2s ease;
}

/* Optimize for touch devices */
@media (hover: none) and (pointer: coarse) {
    .cursor, .cursor-dot {
        width: 40px; /* Larger for touch */
        height: 40px;
        opacity: 0.5;
        border-width: 3px;
    }
    
    .cursor-dot {
        width: 8px;
        height: 8px;
    }
}

/* Update cursor styles to hide on mobile */
@media (hover: none) and (pointer: coarse) {
    .cursor, .cursor-dot {
        display: none;
    }
    
    body {
        cursor: auto; /* Restore default cursor on mobile */
    }
}

/* Handle device orientation */
@media (orientation: landscape) {
    .cursor, .cursor-dot {
        display: block !important;
    }
}

/* Container */
.container {
    max-width: 450px;
    width: 100%;
    padding: 0.5rem;
    text-align: center;
    position: relative;
    z-index: 2;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* Profile Section */
.profile {
    margin-bottom: 0.5rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.photo {
    width: clamp(100px, 20vw, 140px);
    height: clamp(100px, 20vw, 140px);
    margin: 0 auto 0.6rem;
    position: relative;
    transition: transform 0.5s ease;
    flex-shrink: 0;
}

.photo:hover {
    transform: perspective(1000px) rotateX(10deg) rotateY(10deg);
    box-shadow: 
        -20px 20px 30px rgba(160, 132, 220, 0.2),
        inset 0 0 20px rgba(160, 132, 220, 0.2);
}

.img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-image: url('https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQMlkNC26-11WUJGyoNIYRthbgg5CfZSnThDw&s');
    background-size: cover;
    background-position: center;
    border: 4px solid #a084dc;
    box-shadow: 0 5px 15px rgba(160, 132, 220, 0.4);
}

.profile_name {
    font-size: clamp(1.2rem, 3.5vw, 1.6rem);
    font-weight: 700;
    color: #4a148c;
    margin-bottom: 0.2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    display: block;
    text-align: center;
    line-height: 1.2;
}

.profile_box {
    font-size: clamp(0.85rem, 2.2vw, 1rem);
    color: #6b46c1;
    min-height: 1.1em;
    display: block;
    font-family: monospace;
    padding: 0.1em 0;
    margin: 0.15rem 0 0.25rem 0;
    white-space: nowrap;
    text-align: center;
    line-height: 1.2;
}

/* Remove any extra spacing from br tag */
.profile br {
    display: none;
}

/* Links Section */
.links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
    justify-content: center;
}

.links a {
    text-decoration: none;
    width: 100%;
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.links a:nth-child(1) { animation-delay: 0.1s; }
.links a:nth-child(2) { animation-delay: 0.2s; }
.links a:nth-child(3) { animation-delay: 0.3s; }
.links a:nth-child(4) { animation-delay: 0.4s; }
.links a:nth-child(5) { animation-delay: 0.5s; }
.links a:nth-child(6) { animation-delay: 0.6s; }

/* Button Styles */
.custom-btn {
    width: 100%;
    max-width: 100%;
    padding: 0.75rem 1.2rem;
    border: none;
    background: rgba(160, 132, 220, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 4px 15px rgba(160, 132, 220, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    color: white;
    font-size: clamp(0.9rem, 2vw, 1rem);
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: all 0.3s ease;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-btn:hover {
    transform: translateY(-3px) rotateX(5deg) rotateY(5deg);
    background: rgba(106, 70, 193, 0.9);
    box-shadow: 
        0 6px 20px rgba(160, 132, 220, 0.4),
        inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.custom-btn:active {
    transform: translateY(1px);
}

.custom-btn span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.custom-btn i {
    font-size: 1.1rem;
}

/* Add light reflection effect */
.custom-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: 0.5s;
}

.custom-btn:hover::before {
    left: 100%;
}

/* Ripple Effect */
.custom-btn {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    mix-blend-mode: overlay;
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Scroll Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Color Theme Transitions */
:root {
    --transition-speed: 0.5s;
}

* {
    transition: background-color var(--transition-speed) ease,
                color var(--transition-speed) ease,
                border-color var(--transition-speed) ease,
                box-shadow var(--transition-speed) ease;
}

/* Particle Interaction Highlight */
.particle-highlight {
    position: fixed;
    pointer-events: none;
    background: radial-gradient(circle, rgba(160,132,220,0.2) 0%, rgba(160,132,220,0) 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

/* Particles Background */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    opacity: 0.4;
}

/* Background Shapes */
.bg-shapes {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    overflow: hidden;
}

.shape {
    position: absolute;
    filter: blur(5px);
    opacity: 0.2;
    animation: shapeFloat 20s ease-in-out infinite;
}

.shape:nth-child(1) {
    top: 20%;
    left: 10%;
    width: 100px;
    height: 100px;
    background: #a084dc;
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
}

.shape:nth-child(2) {
    top: 60%;
    right: 15%;
    width: 150px;
    height: 150px;
    background: #d8b4fe;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation-delay: -5s;
}

@keyframes shapeFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(10px, -10px) rotate(5deg); }
    50% { transform: translate(0, 15px) rotate(-5deg); }
    75% { transform: translate(-10px, -5px) rotate(3deg); }
}

/* Responsive Layout - Mobile First Approach */

/* Extra Small Devices (phones, 320px and up) */
@media (min-width: 320px) {
    .container {
        padding: 0.5rem;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        min-height: 100vh;
        max-width: 350px;
    }
    
    .custom-btn {
        padding: 0.7rem 1rem;
        margin: 0.2rem 0;
        font-size: clamp(0.85rem, 2vw, 0.95rem);
        min-height: 46px;
    }
    
    .links {
        gap: 0.35rem;
        width: 100%;
        max-width: 320px;
    }
    
    .photo {
        width: clamp(90px, 18vw, 120px);
        height: clamp(90px, 18vw, 120px);
        margin-bottom: 0.5rem;
    }
    
    .profile {
        margin-bottom: 0.4rem;
    }
}

/* Small Devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    .container {
        padding: 1.25rem;
        padding-top: 1.75rem;
        max-width: 400px;
    }
    
    .custom-btn {
        padding: 0.9rem 1.25rem;
        font-size: 1rem;
        min-height: 52px;
    }
    
    .links {
        gap: 0.6rem;
        max-width: 380px;
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) {
    body {
        padding: 1.5rem 1rem;
        background-size: 400% 400%;
    }
    
    .container {
        padding: 1.5rem;
        padding-top: 2rem;
        max-width: 450px;
    }
    
    .custom-btn {
        padding: 0.9rem 1.5rem;
        font-size: 1.05rem;
        max-width: 400px;
        min-height: 54px;
    }
    
    .links {
        gap: 0.6rem;
        max-width: 400px;
    }
    
    #particles-js {
        opacity: 0.5;
    }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .container {
        padding: 2rem;
        padding-top: 2.5rem;
        max-width: 450px;
    }
    
    .custom-btn {
        padding: 0.95rem 1.75rem;
        font-size: 1.05rem;
        min-height: 56px;
    }
    
    .profile {
        margin-bottom: 1.25rem;
    }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        padding: 2.5rem;
        padding-top: 3rem;
        max-width: 450px;
    }
    
    .custom-btn {
        padding: 1rem 2rem;
        font-size: 1.05rem;
        min-height: 56px;
    }
    
    .profile {
        margin-bottom: 1.5rem;
    }
}

/* Legacy mobile support */
@media (max-width: 768px) {
    body {
        padding: 0.3rem 0;
        background-size: 200% 200%;
    }
    
    #particles-js {
        opacity: 0.3;
    }

    .container {
        margin: 0.3rem;
        padding: 0.6rem;
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-radius: 20px;
        min-height: calc(100vh - 0.6rem);
        max-width: 380px;
        justify-content: center;
    }
    
    .custom-btn {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
        min-height: 48px;
    }
    
    .custom-btn span {
        font-size: 0.9rem;
        gap: 10px;
    }
    
    .custom-btn i {
        font-size: 1rem;
    }

    @keyframes gradientMove {
        0% { background-position: 0% 50%; }
        50% { background-position: 100% 50%; }
        100% { background-position: 0% 50%; }
    }

    .particles-js-canvas-el {
        height: 100% !important;
        width: 100% !important;
    }
    
    .profile {
        margin-bottom: 0.5rem;
    }
    
    .links {
        gap: 0.35rem;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    body {
        padding: 0.2rem 0;
        background-size: 300% 300%;
    }
    
    .container {
        margin: 0.2rem;
        border-radius: 15px;
        padding: 0.6rem;
        min-height: calc(100vh - 0.4rem);
        justify-content: center;
    }

    #particles-js {
        opacity: 0.25;
    }
    
    .custom-btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
        min-height: 44px;
        border-radius: 10px;
    }
    
    .custom-btn span {
        gap: 8px;
        font-size: 0.8rem;
    }
    
    .custom-btn i {
        font-size: 0.95rem;
    }
    
    .links {
        gap: 0.3rem;
    }
    
    .profile {
        margin-bottom: 0.4rem;
    }
    
    .photo {
        width: clamp(80px, 16vw, 110px);
        height: clamp(80px, 16vw, 110px);
        margin-bottom: 0.4rem;
    }
    
    .profile_name {
        font-size: clamp(1.1rem, 3vw, 1.4rem);
        margin-bottom: 0.1rem;
    }
    
    .profile_box {
        font-size: clamp(0.8rem, 2vw, 0.9rem);
        margin: 0.1rem 0 0.15rem 0;
    }
}

/* Desktop and larger screens optimization */
@media (min-width: 768px) {
    .container {
        padding: 1.5rem;
        max-width: 450px;
    }
  
    .photo {
        width: clamp(140px, 18vw, 170px);
        height: clamp(140px, 18vw, 170px);
    }
  
    .custom-btn:hover {
        transform: translateY(-3px) rotateX(5deg) rotateY(5deg);
        background: rgba(106, 70, 193, 0.9);
        box-shadow: 
            0 6px 20px rgba(160, 132, 220, 0.4),
            inset 0 0 0 1px rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.3);
    }
    
    .photo:hover {
        transform: perspective(1000px) rotateX(10deg) rotateY(10deg);
        box-shadow: 
            -20px 20px 30px rgba(160, 132, 220, 0.2),
            inset 0 0 20px rgba(160, 132, 220, 0.2);
    }
}

/* Landscape orientation optimizations */
@media (orientation: landscape) and (max-height: 500px) {
    body {
        padding: 0.3rem;
    }

    .container {
        max-height: 95vh;
        overflow-y: auto;
        padding: 0.8rem;
        min-height: auto;
        justify-content: center;
    }

    .photo {
        width: clamp(70px, 10vw, 100px);
        height: clamp(70px, 10vw, 100px);
        margin-bottom: 0.5rem;
    }
    
    .profile {
        margin-bottom: 0.6rem;
    }
    
    .custom-btn {
        padding: 0.5rem 0.8rem;
        min-height: 40px;
        font-size: 0.85rem;
    }
    
    .links {
        gap: 0.3rem;
    }
    
    .profile_name {
        font-size: clamp(1rem, 2.5vw, 1.3rem);
        margin-bottom: 0.1rem;
    }
    
    .profile_box {
        font-size: clamp(0.75rem, 1.8vw, 0.85rem);
        margin: 0.1rem 0 0.4rem 0;
    }
}

/* Portrait orientation for mobile */
@media (orientation: portrait) and (max-width: 768px) {
    .container {
        justify-content: center;
        min-height: 100vh;
    }
    
    .profile {
        margin-bottom: 0.5rem;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .custom-btn {
        border-width: 0.5px;
    }
    
    .img {
        border-width: 2px;
    }
}

/* Loading Animation */
body:not(.loaded) {
    opacity: 0;
}
body.loaded {
    opacity: 1;
    transition: opacity 0.5s ease-in;
}

/* Add new animations */
@keyframes photoEnter {
    from {
        transform: scale(0) rotate(-180deg);
    }
    to {
        transform: scale(1) rotate(0);
    }
}

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

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

.photo-animate {
    animation: photoEnter 1.5s ease forwards;
}

.button-animate {
    animation: buttonSlide 0.5s ease forwards;
    opacity: 0;
}

/* Social Icons */
.social-icons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1rem 0;
}

.social-icon {
    animation: float 3s ease-in-out infinite;
}

.social-icon:nth-child(2) { animation-delay: 0.2s; }
.social-icon:nth-child(3) { animation-delay: 0.4s; }

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

/* Shooting Star Animation */
.shooting-star {
    position: fixed;
    height: 2px;
    background: linear-gradient(90deg, #a084dc, transparent);
    animation: shooting 3s linear infinite;
    opacity: 0;
}

@keyframes shooting {
    0% {
        transform: translateX(-100%) translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateX(200%) translateY(-100px);
        opacity: 0;
    }
}

/* Add hardware acceleration for better mobile performance */
.custom-btn,
.photo,
.profile_name,
.profile_box,
#particles-js {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000;
    will-change: transform;
}

/* Modern CSS Features for Better Responsiveness */

/* Container Queries (if supported) */
@container (max-width: 400px) {
    .custom-btn {
        font-size: 0.9rem;
        padding: 0.7rem 1rem;
    }
}

/* Improved touch targets for accessibility */
@media (hover: none) and (pointer: coarse) {
    .custom-btn {
        min-height: 48px; /* WCAG recommended minimum */
        padding: 1rem;
        margin: 0.4rem 0;
    }
    
    .custom-btn span {
        gap: 12px;
    }
    
    /* Larger tap areas */
    .custom-btn::before {
        content: '';
        position: absolute;
        top: -5px;
        left: -5px;
        right: -5px;
        bottom: -5px;
        z-index: -1;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    #particles-js {
        display: none;
    }
    
    .bg-shapes {
        display: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .custom-btn {
        border: 2px solid #000;
        background: rgba(160, 132, 220, 1);
    }
    
    .custom-btn:hover {
        background: rgba(106, 70, 193, 1);
        border-color: #fff;
    }
}

/* Print styles */
@media print {
    body {
        background: white !important;
    }
    
    #particles-js,
    .bg-shapes,
    .cursor,
    .cursor-dot {
        display: none !important;
    }
    
    .container {
        box-shadow: none !important;
        background: transparent !important;
    }
    
    .custom-btn {
        background: white !important;
        border: 1px solid #000 !important;
        color: #000 !important;
        box-shadow: none !important;
    }
}
