/* style.css */
:root {
    --bg-base: #f4f7fb;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
    --accent-color: #6366f1;
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.8);
    --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
    --shadow-focus: 0 0 0 4px rgba(99, 102, 241, 0.15), 0 15px 35px -5px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* Background Effects */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
}

.orb-1 {
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(99,102,241,0.3) 0%, rgba(99,102,241,0) 70%);
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(168,85,247,0.2) 0%, rgba(168,85,247,0) 70%);
    bottom: -20%;
    right: -10%;
    animation-delay: -5s;
}

.orb-3 {
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(56,189,248,0.25) 0%, rgba(56,189,248,0) 70%);
    top: 40%;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 50px) scale(1.1); }
}

/* Main Container & Hero */
.app-container {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

.hero-section {
    text-align: center;
    margin-bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.badge {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-color);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(99, 102, 241, 0.2);
    text-transform: uppercase;
}

.logo-title {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 500px;
    line-height: 1.6;
    font-weight: 400;
}

/* Search Interface */
.search-container {
    width: 100%;
    max-width: 650px;
    margin: 0 auto 2rem auto;
}

.search-box {
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 50px;
    padding: 0.5rem 0.5rem 0.5rem 1.5rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.search-box:focus-within {
    box-shadow: var(--shadow-focus);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

.input-wrapper {
    display: flex;
    align-items: center;
    flex-grow: 1;
    gap: 12px;
}

.icon-link {
    width: 20px;
    height: 20px;
    color: #94a3b8;
}

#url-input {
    border: none;
    background: transparent;
    font-size: 1.1rem;
    color: var(--text-primary);
    width: 100%;
    font-family: inherit;
    outline: none;
}

#url-input::placeholder {
    color: #cbd5e1;
    font-weight: 300;
}

#analyze-btn {
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 40px;
    padding: 0.8rem 1.8rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

#analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

#analyze-btn:active {
    transform: translateY(0);
}

.icon-arrow {
    width: 18px;
    height: 18px;
}

/* Utilities & Loading Spinner */
.hidden {
    display: none !important;
}

#loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 3rem;
}

.ai-core {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
}

.ring.outer {
    width: 100%;
    height: 100%;
    border-top-color: #6366f1;
    border-bottom-color: #a855f7;
    animation: spin 2s linear infinite;
}

.ring.inner {
    width: 60%;
    height: 60%;
    border-left-color: #38bdf8;
    border-right-color: #6366f1;
    animation: spin 1.5s linear infinite reverse;
}

.core-dot {
    width: 16px;
    height: 16px;
    background: var(--accent-gradient);
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.8);
    animation: pulse 1.5s ease-in-out infinite alternate;
}

.loading-text {
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.5px;
    animation: breathe 2s ease-in-out infinite;
}

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

@keyframes pulse {
    0% { transform: scale(0.8); opacity: 0.7; }
    100% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 25px rgba(99, 102, 241, 1); }
}

@keyframes breathe {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Results Dashboard (Glassmorphism) */
#results-dashboard {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.fade-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Main Stat Card */
.main-stat-card {
    text-align: center;
    padding: 3rem 2rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 1rem;
}

.header-icon-wrapper {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-color);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-icon-wrapper svg {
    width: 20px;
    height: 20px;
}

.card-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 2rem;
    letter-spacing: -2px;
}

/* Progress Bar */
.progress-track {
    width: 100%;
    height: 16px;
    background: rgba(226, 232, 240, 0.6);
    border-radius: 50px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-gradient);
    border-radius: 50px;
    transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}

.progress-glow {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    animation: shimmer 2s infinite linear;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.small-card {
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-top h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.mini-icon {
    width: 20px;
    height: 20px;
    color: #cbd5e1;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Summary Card */
.summary-card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

#analysis-summary {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 1rem;
    font-weight: 400;
}

/* Responsive Design (Mobile Optimization) */
@media (max-width: 768px) {
    .app-container {
        padding: 1.5rem;
    }

    .logo-title {
        font-size: 2.8rem;
    }

    .subtitle {
        font-size: 0.95rem;
        padding: 0 1rem;
    }

    .search-box {
        padding: 0.4rem 0.4rem 0.4rem 1rem;
    }

    #url-input {
        font-size: 1rem;
    }

    #analyze-btn {
        padding: 0.7rem 1.2rem;
    }
    
    #analyze-btn span {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 4rem;
    }

    .glass-card {
        padding: 1.5rem;
    }
}

/* script.js */