:root {
    --bg-color: #0f111a;
    --surface-color: #1a1d2d;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --primary-gradient: linear-gradient(135deg, #3b82f6, #8b5cf6);
    --primary-color: #6d28d9;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --border-color: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    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;
}

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

.blob-1 {
    top: -10%;
    left: -10%;
    width: 40vw;
    height: 40vw;
    background: rgba(59, 130, 246, 0.4);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 30vw;
    height: 30vw;
    background: rgba(139, 92, 246, 0.4);
    animation-delay: -5s;
}

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

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Hero */
.hero {
    text-align: center;
    margin-top: 5vh;
    margin-bottom: 3rem;
}

.logo-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.logo-title span {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

/* Search Section */
.search-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 4rem;
}

.search-form {
    width: 100%;
    max-width: 700px;
}

.input-container {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 0.5rem 0.5rem 0.5rem 1.5rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.input-container:focus-within {
    border-color: #8b5cf6;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.icon-link {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

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

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

#analyze-btn {
    background: var(--primary-gradient);
    border: none;
    border-radius: 40px;
    color: white;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.8rem 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.4);
}

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

.loading-state {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.error-message {
    margin-top: 1.5rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    color: #fca5a5;
    padding: 1rem 2rem;
    border-radius: 12px;
    text-align: center;
}

/* Dashboard */
.dashboard {
    background: rgba(26, 29, 45, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    margin-top: 2rem;
    animation: fadeIn 0.5s ease;
}

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

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
}

#res-url {
    color: #8b5cf6;
    word-break: break-all;
}

.global-score-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.circular-chart {
    display: block;
    margin: 0 auto;
    max-width: 100px;
    max-height: 100px;
}

.circle-bg {
    fill: none;
    stroke: rgba(255,255,255,0.1);
    stroke-width: 3.8;
}

.circle {
    fill: none;
    stroke-width: 3.8;
    stroke-linecap: round;
    transition: stroke-dasharray 1.5s ease-out;
}

.percentage {
    fill: #fff;
    font-family: inherit;
    font-size: 8px;
    font-weight: bold;
    text-anchor: middle;
}

/* Griglia Risultati */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
}

.card-header {
    padding: 1.2rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.5rem;
}

.res-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.res-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.status-icon {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.status-good { color: var(--success); }
.status-warning { color: var(--warning); }
.status-error { color: var(--error); }

.detail-p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    margin-top: 4rem;
}

/* Responsività */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    .input-container {
        flex-direction: column;
        border-radius: 15px;
        padding: 1rem;
        gap: 1rem;
    }
    #url-input {
        width: 100%;
        text-align: center;
    }
    #analyze-btn {
        width: 100%;
        justify-content: center;
    }
}
