:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --surface: rgba(30, 41, 59, 0.7);
    --border: rgba(255, 255, 255, 0.1);
    --glass: rgba(255, 255, 255, 0.05);
    --error: #ef4444;
}

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Decorations */
.background-blob {
    position: fixed;
    top: -10%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    filter: blur(80px);
    z-index: -1;
}

.background-blob-2 {
    position: fixed;
    bottom: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    filter: blur(80px);
    z-index: -1;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

/* Header */
header {
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.25rem;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Search Section */
.search-section {
    width: 100%;
    position: relative;
}

.input-wrapper {
    display: flex;
    background: var(--surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 0.5rem;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.3);
}

input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    outline: none;
    font-family: inherit;
}

button#scanBtn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 2rem;
    border-radius: 100px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    overflow: hidden;
}

button#scanBtn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

button#scanBtn:active {
    transform: translateY(0);
}

.error-message {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 0.75rem;
    text-align: center;
    height: 1rem;
}

/* Results Section */
.results-section {
    width: 100%;
    background: var(--surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2rem;
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.actions {
    display: flex;
    gap: 0.75rem;
}

.btn-secondary {
    background: var(--glass);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sitemap-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.sitemap-list::-webkit-scrollbar {
    width: 6px;
}

.sitemap-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.sitemap-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--glass);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.sitemap-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border);
}

.sitemap-url {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9375rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 80%;
}

.sitemap-url:hover {
    color: var(--primary);
}

.status-tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border-radius: 4px;
    font-weight: 600;
}

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

.loading-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.pulse-loader {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
    animation: pulse 1.5s infinite linear;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 20px rgba(99, 102, 241, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

/* Spinner for Button */
.spinner {
    animation: rotate 2s linear infinite;
    width: 24px;
    height: 24px;
    margin-left: 10px;
    display: none;
}

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

.spinner .path {
    stroke: white;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes dash {
    0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

.loading #scanBtn span { display: none; }
.loading #scanBtn .spinner { display: block; }
.loading #scanBtn { pointer-events: none; opacity: 0.8; }

footer {
    margin-top: auto;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

@media (max-width: 640px) {
    h1 { font-size: 2rem; }
    .container { padding: 2rem 1rem; }
    .input-wrapper { border-radius: 20px; flex-direction: column; }
    button#scanBtn { border-radius: 12px; height: 50px; margin-top: 10px; }
    .results-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
}
