:root {
    --bg-color: #F4F4F5;
    --text-color: #000000;
    --accent-blue: #2563EB;
    --accent-purple: #7C3AED;
    --accent-pink: #EC4899;
    --font-main: 'Outfit', sans-serif;
    
    /* Status Colors */
    --status-excellent: #10B981;
    --status-good: #3B82F6;
    --status-fair: #F59E0B;
    --status-poor: #EF4444;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    min-height: 100vh;
    width: 100vw;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    background-image: radial-gradient(#D4D4D8 1px, transparent 1px);
    background-size: 24px 24px;
}

/* --- Creative Background Elements --- */
.creative-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    perspective: 1000px;
}

.geo-shape {
    position: absolute;
    opacity: 0.9;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 6s ease-in-out infinite;
}

.cube-3d {
    top: 15%;
    left: 10%;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent-blue), #60A5FA);
    transform: rotate3d(1, 1, 1, 45deg);
    box-shadow: 10px 10px 20px rgba(37, 99, 235, 0.2);
    border-radius: 12px;
}

.circle-gradient {
    bottom: 20%;
    right: 15%;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle at 30% 30%, var(--accent-pink), transparent);
    background-color: rgba(236, 72, 153, 0.1);
    border: 2px solid rgba(236, 72, 153, 0.3);
    border-radius: 50%;
    animation-delay: 1s;
}

.pill-accent {
    top: 40%;
    right: 10%;
    width: 60px;
    height: 20px;
    background-color: var(--accent-purple);
    border-radius: 50px;
    transform: rotate(-15deg);
    animation-duration: 8s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
    50% { transform: translateY(-20px) rotate(var(--r, 0deg)); }
}

/* --- Layout --- */
header {
    position: relative;
    z-index: 10;
    padding: 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    color: black;
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.logo a:hover {
    transform: scale(1.1) rotate(-10deg);
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    color: black;
    font-size: 1.2rem;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.social-links a:hover {
    opacity: 1;
    transform: translateY(-3px);
    color: var(--accent-blue);
}

main {
    position: relative;
    z-index: 5;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 2rem;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.hero-text {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    text-align: center;
    line-height: 1.1;
    color: black;
    text-transform: uppercase;
    letter-spacing: -0.03em;
    display: flex;
    justify-content: center;
    gap: 0.3em;
}

/* Glass Card Global Styles */
.glass-card {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

/* --- Input Area --- */
.test-container {
    padding: 2.5rem;
    width: 100%;
    text-align: center;
    margin-bottom: 3rem;
    transition: all 0.4s ease;
}

.description {
    font-size: 1.1rem;
    color: #4b5563;
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    gap: 1rem;
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1.2rem;
    color: #9CA3AF;
    font-size: 1.2rem;
}

#url-input {
    flex-grow: 1;
    padding: 1rem 1rem 1rem 3rem;
    border-radius: 12px;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.7);
    font-family: var(--font-main);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

#url-input:focus {
    border-color: var(--accent-blue);
    background: white;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.cta-button {
    background-color: black;
    color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    letter-spacing: 0.05em;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    background-color: var(--accent-blue);
}

.cta-button:disabled {
    background-color: #9CA3AF;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* --- Loading Spinner --- */
.loading-container {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--accent-blue);
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(37, 99, 235, 0.2);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- Dashboard Results --- */
.dashboard-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 5rem;
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.dashboard-container.hidden, .loading-container.hidden {
    display: none;
}

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

/* Top APDEX Section */
.dashboard-top {
    display: flex;
    align-items: center;
    padding: 2.5rem;
    gap: 3rem;
}

.apdex-meter {
    flex-shrink: 0;
    width: 160px;
    height: 160px;
}

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

.circle-bg {
    fill: none;
    stroke: #E5E7EB;
    stroke-width: 2.5;
}

.circle {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    transition: stroke-dasharray 1.5s ease-out, stroke 0.5s;
    stroke: var(--status-good); /* Default */
}

.percentage {
    fill: #000;
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 8px; /* Adjusted context of SVG viewbox */
    text-anchor: middle;
}

.label-text {
    fill: #6B7280;
    font-family: var(--font-main);
    font-size: 3.5px;
    font-weight: 500;
    text-anchor: middle;
}

.apdex-info {
    flex-grow: 1;
}

#apdex-rating {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.apdex-info p {
    color: #4B5563;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    max-width: 90%;
}

.apdex-legend {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    font-weight: 500;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.dot.excellent { background: var(--status-excellent); }
.dot.good { background: var(--status-good); }
.dot.fair { background: var(--status-fair); }
.dot.poor { background: var(--status-poor); }

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

.metric-card {
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
    transition: transform 0.3s ease;
}

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

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--accent-blue);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    flex-shrink: 0;
}

.metric-details h3 {
    font-size: 0.9rem;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: black;
    margin-bottom: 0.2rem;
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
}

.metric-desc {
    font-size: 0.8rem;
    color: #9CA3AF;
}

/* Text coloring based on status class additions */
.text-excellent { color: var(--status-excellent); }
.text-good { color: var(--status-good); }
.text-fair { color: var(--status-fair); }
.text-poor { color: var(--status-poor); }

/* Recommendations */
.recommendations {
    padding: 2.5rem;
}

.recommendations h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.opportunities-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.opportunity-item {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.4);
    border-left: 4px solid var(--accent-pink);
    border-radius: 0 8px 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.opp-title {
    font-weight: 500;
    color: #1F2937;
}

.opp-savings {
    font-weight: 700;
    color: var(--status-fair);
    background: rgba(255, 255, 255, 0.8);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* --- Standard Elements --- */

/* Floating Arrow */
.floating-arrow-left {
    position: fixed;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glass-arrow {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    font-size: 1.5rem;
    text-decoration: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-arrow:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.7);
    color: var(--accent-blue);
}

/* Footer (Tekiyo Style) */
.site-footer {
    position: relative;
    z-index: 10;
    width: 100%;
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(0, 0, 0, 0.5);
    background: transparent;
    margin-top: auto;
}

.site-footer a {
    color: rgba(0, 0, 0, 0.5);
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer a:hover {
    color: black;
}

.footer-left,
.footer-right {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.footer-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.dot {
    font-weight: bold;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-top {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .apdex-legend {
        justify-content: center;
    }

    .input-group {
        flex-direction: column;
        width: 100%;
    }
    
    .cta-button {
        width: 100%;
    }

    .site-footer {
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem;
        text-align: center;
    }

    .footer-center {
        position: static;
        transform: none;
    }

    .floating-arrow-left {
        left: 1rem;
    }
    
    .glass-arrow {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
}
