:root {
    --bg-color: #0f172a;
    --panel-bg: rgba(30, 41, 59, 0.7);
    --panel-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: #3b82f6;
    
    --glow-primary: rgba(99, 102, 241, 0.5);
    --glow-secondary: rgba(236, 72, 153, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

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

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

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--glow-primary);
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: var(--glow-secondary);
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

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

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}

.logo .highlight {
    background: linear-gradient(135deg, #a855f7, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Search Section */
.search-section {
    max-width: 700px;
    margin: 0 auto 3rem auto;
}

.search-form {
    display: flex;
    gap: 1rem;
    background: var(--panel-bg);
    padding: 0.5rem;
    border-radius: 100px;
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.search-form:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
}

.input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
}

.icon-link {
    color: var(--text-secondary);
    margin-right: 1rem;
}

#url-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.1rem;
    outline: none;
}

#url-input::placeholder {
    color: var(--text-secondary);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 100px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--glow-primary);
}

.hidden {
    display: none !important;
}

/* Loading & Error */
.loading {
    text-align: center;
    margin-top: 2rem;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 1rem auto;
    animation: spin 1s linear infinite;
}

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

.error-message {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #fca5a5;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Results Section */
.results-section {
    animation: fadeIn 0.5s ease-out forwards;
}

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

/* Score Card */
.score-card {
    text-align: center;
    padding: 2.5rem;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.score-circle-container {
    position: relative;
    width: 150px;
    height: 150px;
}

.score-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(var(--primary-color) 0%, rgba(255,255,255,0.1) 0%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 1s ease-out;
}

.score-circle::before {
    content: "";
    position: absolute;
    width: 130px;
    height: 130px;
    background: var(--bg-color);
    border-radius: 50%;
}

#total-score {
    position: relative;
    font-size: 3rem;
    font-weight: 700;
    color: white;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.metric-card {
    padding: 1.5rem;
    transition: transform 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-5px);
}

.metric-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.2rem;
}

.metric-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-right: 1rem;
    color: var(--primary-color);
}

.metric-header h3 {
    font-size: 1.1rem;
    font-weight: 500;
    flex: 1;
}

.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success { background: rgba(16, 185, 129, 0.2); color: var(--success-color); }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: var(--warning-color); }
.badge-error { background: rgba(239, 68, 68, 0.2); color: var(--error-color); }
.badge-info { background: rgba(59, 130, 246, 0.2); color: var(--info-color); }

.metric-value {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.metric-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Stats Row */
.stats-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-box {
    background: rgba(0,0,0,0.2);
    padding: 0.8rem;
    border-radius: 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.error-text {
    color: var(--error-color) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .search-form {
        flex-direction: column;
        border-radius: 16px;
        padding: 1rem;
    }
    
    .input-wrapper {
        padding: 0.5rem;
    }
    
    .btn-primary {
        width: 100%;
        justify-content: center;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}
