/* 🎨 FLASHY MODERN PALINDROME EXPLORER CSS */
/* Just replace your entire style.css with this! */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 25%, #0f3460 50%, #533483 75%, #7209b7 100%);
    color: #ffffff;
    margin: 0;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* 🌟 ANIMATED BACKGROUND BLOBS */
.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.2;
    mix-blend-mode: multiply;
    animation: blob 7s infinite;
}

.bg-blob-1 {
    top: 80px;
    left: 40px;
    width: 300px;
    height: 300px;
    background: #a855f7;
    animation: blob 7s infinite, float 6s ease-in-out infinite;
}

.bg-blob-2 {
    top: 160px;
    right: 40px;
    width: 300px;
    height: 300px;
    background: #eab308;
    animation: blob 7s infinite 2s, float 6s ease-in-out infinite 2s;
}

.bg-blob-3 {
    bottom: -32px;
    left: 80px;
    width: 300px;
    height: 300px;
    background: #ec4899;
    animation: blob 7s infinite 4s, float 6s ease-in-out infinite 4s;
}

/* 🎭 KEYFRAME ANIMATIONS */
@keyframes blob {
    0% { transform: translate(0px, 0px) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0px, 0px) scale(1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(1deg); }
    66% { transform: translateY(-10px) rotate(-1deg); }
}

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

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

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

/* 🏠 MAIN CONTAINER */
.container {
    position: relative;
    z-index: 10;
    max-width: 1000px;
    margin: 0 auto;
    padding: 32px 48px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

/* 🎯 HEADER STYLING */
h1 {
    font-size: 4rem;
    font-weight: 900;
    background: linear-gradient(45deg, #f472b6, #a855f7, #6366f1);
    background-size: 200% 200%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    margin-bottom: 16px;
    animation: gradient 3s ease infinite, pulse 2s ease-in-out infinite;
}

.subtitle {
    text-align: center;
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
    margin-bottom: 48px;
}

/* 🎪 INPUT STYLING */
.input-container {
    position: relative;
    margin-bottom: 48px;
}

input[type="text"] {
    width: 100%;
    padding: 24px 32px;
    font-size: 1.25rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    color: #ffffff;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

input[type="text"]:focus {
    border-color: #f472b6;
    box-shadow: 0 0 0 4px rgba(244, 114, 182, 0.2);
    transform: translateY(-2px);
}

/* 🔄 LOADING SPINNER */
.loading-spinner {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: 2px solid transparent;
    border-top: 2px solid #f472b6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

.loading-spinner.show {
    display: block;
}

/* 📊 RESULTS SECTIONS */
.results-section {
    margin: 48px 0;
    padding: 32px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    margin-bottom: 24px;
}

/* 🎯 PALINDROME RESULT */
.result-text {
    display: inline-block;
    padding: 16px 32px;
    border-radius: 16px;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    transition: all 0.5s ease;
    cursor: pointer;
}

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

.result-true {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.25);
}

.result-false {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.25);
}

/* 🎨 SUBSTRING GRID */
.substrings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin-top: 32px;
    animation: fadeIn 0.6s ease-out;
}

/* 🏷️ PALINDROME ITEMS */
.palindrome-item {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.2));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    color: #ffffff;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    cursor: pointer;
    word-break: break-all;
}

.palindrome-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0), rgba(236, 72, 153, 0));
    border-radius: 12px;
    transition: all 0.3s ease;
    z-index: -1;
}

.palindrome-item:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 32px rgba(168, 85, 247, 0.25);
    border-color: #a855f7;
}

.palindrome-item:hover::before {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(236, 72, 153, 0.1));
}

/* 🎭 STAGGERED ANIMATION */
.palindrome-item:nth-child(1) { animation: fadeIn 0.6s ease-out 0.1s both; }
.palindrome-item:nth-child(2) { animation: fadeIn 0.6s ease-out 0.2s both; }
.palindrome-item:nth-child(3) { animation: fadeIn 0.6s ease-out 0.3s both; }
.palindrome-item:nth-child(4) { animation: fadeIn 0.6s ease-out 0.4s both; }
.palindrome-item:nth-child(5) { animation: fadeIn 0.6s ease-out 0.5s both; }
.palindrome-item:nth-child(n+6) { animation: fadeIn 0.6s ease-out 0.6s both; }

/* 🌟 EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 64px 0;
    animation: pulse 2s ease-in-out infinite;
}

.empty-state .emoji {
    font-size: 4rem;
    margin-bottom: 16px;
    display: block;
}

.empty-state p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.6);
}

/* 🚫 NO RESULTS */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 24px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

/* 📱 RESPONSIVE DESIGN */
@media (max-width: 768px) {
    .container {
        padding: 24px;
        margin: 10px;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    input[type="text"] {
        padding: 20px;
        font-size: 1.1rem;
    }
    
    .substrings-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 12px;
    }
    
    .palindrome-item {
        padding: 12px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .result-text {
        font-size: 1.2rem;
        padding: 12px 24px;
    }
    
    .substrings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 🎪 UTILITY CLASSES */
.hidden {
    display: none !important;
}

.show {
    display: block !important;
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* 🌈 ADDITIONAL VISUAL ENHANCEMENTS */
.results-container {
    animation: fadeIn 0.6s ease-out;
}

/* ✨ GLOW EFFECTS */
.glow {
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

/* 🎨 GRADIENT TEXT */
.gradient-text {
    background: linear-gradient(45deg, #f472b6, #a855f7, #6366f1);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}