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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #f8fafc;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* REMOVED: align-items: center  ← acesta provoca shrink-wrap pe orizontală */
    color: #1e293b;
    line-height: 1.5;
    padding: 24px 16px 48px;
}

/* Header / Logo area */
.logo-area {
    margin-bottom: 10px;
    text-align: left;
    font-style: italic;
}

.logo {
    font-size: 1.6rem;
    color: grey;
}

.stats-container {
    margin-top: 8px;
    text-align: left;
}

.stats-line {
    font-size: 0.9rem;
    color: #64748b;
    font-style: normal;
}

.stats-line strong {
    color: #1e293b;
    font-weight: 600;
}

.search-container {
    width: 100%;
    max-width: 720px;
    margin: 0 auto; /* ← centrare stabilă, nu mai depinde de conținut */
}

/* Search form — clean and spacious */
.search-form {
    margin-bottom: 1px;
}

.search-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid grey;
    border-radius: 9px;
    padding: 4px 4px 4px 22px;
}

/* Remove border conflict for analizor */
.analizor-page .search-wrapper {
    border: none;
    background: transparent;
    padding: 0;
}

.search-wrapper input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.1rem;
    background: transparent;
    color: #0f172a;
}

/* --- Progress bar container (sub input) --- */
.progress-container {
    width: 100%;
    height: 4px;
    background-color: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.02);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(
        to right,
        #002b7f 0%, #002b7f 33.33%,
        #fcd116 33.33%, #fcd116 66.66%,
        #ce1126 66.66%, #ce1126 100%
    );
    transition: width 0.25s ease-out;
    border-radius: 4px;
}

/* Status / meta info */
.results-meta {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 20px;
    padding-left: 6px;
}

/* Results list — minimalist cards */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-bottom: 36px;
}

.result-item {
    background: transparent;
    padding: 6px 6px 10px 6px;
    border-bottom: 1px solid #eef2f6;
    /* ADĂUGAT: împiedică conținutul să forțeze lățimea containerului */
    min-width: 0;
    overflow-wrap: break-word;
}

.result-title {
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 4px;
    line-height: 1.35;
}

.result-title a {
    color: #1e40af;
    text-decoration: none;
    transition: color 0.15s;
    word-break: break-word;
}

.result-title a:hover {
    color: #3b82f6;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.result-title a:visited {
    color: #6b21a8;
}

.result-domain {
    display: inline-block;
    font-size: 0.8rem;
    color: #475569;
    margin-bottom: 6px;
    background: #f1f5f9;
    padding: 2px 10px;
    border-radius: 30px;
    letter-spacing: 0.01em;
}

.result-description {
    color: #334155;
    font-size: 0.95rem;
    line-height: 1.5;
    word-break: break-word;
}

/* Pagination — modern, progressive */
.pagination-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 6px;
    margin-top: 10px;
}

.page-btn, .page-ellipsis, .page-nav {
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    border-radius: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    text-decoration: none;
}

.page-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.page-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
    box-shadow: 0 6px 10px -4px rgba(59,130,246,0.3);
}

.page-nav {
    background: #f8fafc;
    font-weight: 500;
}

.page-nav.disabled {
    opacity: 0.4;
    pointer-events: none;
    background: #f1f5f9;
}

.page-ellipsis {
    border: none;
    background: transparent;
    box-shadow: none;
    cursor: default;
    font-weight: 600;
    color: #64748b;
}

/* Loading / error states */
.loading-indicator, .error-message, .no-results {
    text-align: center;
    padding: 48px 20px;
    color: grey;
    background: white;
    border: 1px solid grey;
    border-radius: 9px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.error-message {
    color: #b91c1c;
    background: #fef2f2;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

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

.footer-note {
    margin-top: 40px;
    font-size: 0.8rem;
    color: grey;
    text-align: center;
}

/* Navigation Bar */
.navbar {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 8px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 40px;
 }

.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: grey;
    font-size: 1.3rem;
    font-style: italic;
}

.nav-logo img {
    width: 24px;
    height: 24px;
    margin-right: 8px;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 8px;
}

.nav-item {
    display: block;
}

.nav-link {
    display: block;
    padding: 8px 16px;
    color: black;
    text-decoration: none;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.nav-link:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: black;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
}

/* Responsive Navigation */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        position: absolute;
        top: 56px; /* 8px padding + 40px min-height + 8px padding */
        left: 0;
        right: 0;
        background: white;
        border-bottom: 1px solid #e2e8f0;
        flex-direction: column;
        padding: 16px;
        gap: 4px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .nav-menu.active {
        max-height: 300px;
    }

    .nav-link {
        padding: 12px 16px;
    }
}

/* Add proper spacing after navbar */
.search-container {
    margin-top: 60px;
}

/* small screens */
@media (max-width: 480px) {
    body {
        padding: 16px 12px 48px;
    }
    
    .search-container {
        margin-top: 40px;
    }
    .logo { font-size: 2.2rem; }
    .search-wrapper { padding-left: 16px; }
    .search-wrapper button { padding: 10px 18px; font-size: 0.95rem; }
    .result-title { font-size: 1.15rem; }
}
