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

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

body {
    font-family: 'Nunito', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow-x: hidden;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* Animated background */
#app {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

#star-pattern {
    background-image: url('Images/OrangeStar.jpg');
    background-size: 70%;
    background-repeat: repeat;
    width: 100%;
    height: 100%;
    position: absolute;
    z-index: 1;
    opacity: 0.3;
    animation: twinkle 12s ease-in-out infinite alternate;
    animation: pan 60s linear infinite;
}

@keyframes twinkle {
    0% {
        opacity: 0.2;
    }

    100% {
        opacity: 0.4;
    }
}

.container {
    background: linear-gradient(to bottom right, #ff6b6b, #666);
    border-radius: 28px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    max-width: 600px;
    /* Increased from 480px */
    width: 95%;
    padding: 40px 35px;
    margin: 50px auto;
    text-align: center;
    animation: fadeInUp 0.6s ease forwards;
    transform: translateY(20px);
    opacity: 0;
}

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

/* Chrome extension specific styles */
@media (max-width: 420px) {
    .container {
        max-width: 100%;
        padding: 15px;
        min-height: 450px;
    }

    h1 {
        font-size: 2rem;
        margin-bottom: 15px;
    }

    input {
        max-width: 100%;
    }

    #results {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .result-item {
        padding: 15px;
    }

    .result-item img {
        max-width: 80px;
    }
}

.search-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
}

/* Title styling */
h1 {
    font-family: 'Coiny', cursive;
    font-size: clamp(2.5rem, 8vw, 4rem);
    background: linear-gradient(45deg,
            #ff6b6b,
            #4ecdc4,
            #45b7d1,
            #96ceb4,
            #ffd93d,
            #ff9ff3,
            #54a0ff);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 6s ease-in-out infinite;
    margin-bottom: 25px;
    text-align: center;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.1));
}

@keyframes gradient-shift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Input styling */
input {
    width: 100%;
    max-width: 400px;
    padding: 15px 20px;
    margin: 10px 0;
    border: 2px solid transparent;
    border-radius: 50px;
    font-size: 16px;
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(white, white) padding-box,
        linear-gradient(45deg, #ff6b6b, #4ecdc4) border-box;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

input:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

input::placeholder {
    color: #999;
    font-style: italic;
}

/* Button styling */
button {
    padding: 15px 30px;
    margin: 10px;
    border: none;
    border-radius: 50px;
    font-family: 'Coiny', cursive;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#searchButton {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    color: white;
    font-weight: 600;
    min-width: 150px;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

#searchButton:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.6);
}

#searchButton:active {
    transform: translateY(-1px);
}

.refresh {
    background: linear-gradient(45deg, #45b7d1, #96ceb4);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(69, 183, 209, 0.4);
}

.refresh:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(69, 183, 209, 0.6);
}

/* Random anime button */
.rnd {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-image: url("/Images/Dragonball.jpg");
    background-size: cover;
    background-position: center;
    color: white;
    font-family: 'Coiny', cursive;
    font-size: 12px;
    font-weight: 600;
    border: 3px solid rgba(255, 165, 0, 0.6);
    box-shadow:
        0 8px 20px rgba(255, 165, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: dragonball-glow 4s ease-in-out infinite;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.rnd:hover {
    transform: scale(1.1);
    animation-play-state: paused;
    box-shadow:
        0 12px 30px rgba(255, 165, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Animations */
@keyframes pan {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 100% 100%;
    }
}

@keyframes dragonball-glow {

    0%,
    100% {
        transform: scale(1);
        box-shadow:
            0 8px 20px rgba(255, 165, 0, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
        border-color: rgba(255, 165, 0, 0.6);
    }

    50% {
        transform: scale(1.05);
        box-shadow:
            0 15px 35px rgba(255, 165, 0, 0.8),
            inset 0 1px 0 rgba(255, 255, 255, 0.5);
        border-color: rgba(255, 165, 0, 0.9);
    }
}

/* Results section */
#results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    width: 100%;
    margin-top: 30px;
    padding: 0 10px;
}

.result-item {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.result-item::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.5s ease;
}

.result-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.5);
}

.result-item:hover::before {
    left: 100%;
}

.result-item img {
    width: 100%;
    max-width: 120px;
    height: auto;
    border-radius: 15px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.result-item:hover img {
    transform: scale(1.05);
}

.result-item h3 {
    font-family: 'Coiny', cursive;
    font-size: 1.1em;
    margin-bottom: 10px;
    color: #333;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.result-item p {
    font-family: 'Nunito', sans-serif;
    font-size: 0.9em;
    margin-bottom: 15px;
    color: #666;
    line-height: 1.4;
}

.result-item a {
    display: inline-block;
    text-decoration: none;
    color: white;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    padding: 8px 16px;
    border-radius: 20px;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 0.85em;
    transition: all 0.3s ease;
}

.result-item a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        width: 98%;
        padding: 20px;
        margin: 10px auto;
    }

    h1 {
        font-size: 2.5rem;
    }

    #results {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .rnd {
        width: 60px;
        height: 60px;
        font-size: 10px;
        bottom: 15px;
        left: 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    input {
        padding: 12px 16px;
    }

    button {
        padding: 12px 24px;
        font-size: 14px;
    }

    #results {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 12px;
    }
}