:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #3b82f6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-color: #1f2937;
    --light-color: #f8fafc;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Container & Grid */
.container {
    width: 100%;
    max-width: 1200px;
    margin-right: auto;
    margin-left: auto;
    padding-right: 1rem;
    padding-left: 1rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

.row > * {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

.g-4 {
    margin-top: -1.5rem;
}

.g-4 > * {
    margin-top: 1.5rem;
}

.col-6 { width: 50%; }
.col-md-3 { width: 100%; }
.col-md-6 { width: 100%; }
.col-md-8 { width: 100%; }
.col-lg-3 { width: 100%; }
.col-lg-10 { width: 100%; }

@media (min-width: 768px) {
    .col-md-3 { width: 25%; }
    .col-md-6 { width: 50%; }
    .col-md-8 { width: 66.666667%; }
}

@media (min-width: 992px) {
    .col-lg-3 { width: 25%; }
    .col-lg-10 { width: 83.333333%; }
}

.d-flex { display: flex; }
.justify-content-center { justify-content: center; }
.align-items-center { align-items: center; }
.gap-3 { gap: 1rem; }
.flex-grow-1 { flex-grow: 1; }
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-light { color: #f8fafc; }
.text-info { color: #38bdf8; }
.text-black { color: #000; }
.text-decoration-none { text-decoration: none; }
.py-3 { padding-top: 1rem; padding-bottom: 1rem; }
.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1.5rem; }
.me-1 { margin-right: 0.25rem; }
.me-2 { margin-right: 0.5rem; }
.me-3 { margin-right: 1rem; }
.ms-auto { margin-left: auto; }
.img-fluid { max-width: 100%; height: auto; display: block; }
.border-secondary { border: 0; border-top: 1px solid rgba(255, 255, 255, 0.15); margin: 1.5rem 0; }

/* SVG Icons */
.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}
.icon-fill {
    fill: currentColor;
    stroke: none;
}
.icon-spin {
    animation: spin 1s linear infinite;
}

/* Main Layout */
.main-content {
    background: white;
    box-shadow: var(--shadow-xl);
    border-radius: 20px;
    overflow: hidden;
    margin: 10px auto;
    max-width: 1200px;
}

/* Cookie Notice */
.cookie-notice {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1f2937;
    color: white;
    padding: 1rem;
    z-index: 1001;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.cookie-notice.show {
    transform: translateY(0);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.cookie-dismiss {
    background: #ffd700;
    color: #1f2937;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 700;
}

/* Navigation */
.navbar-custom {
    background: linear-gradient(135deg, var(--dark-color) 0%, #374151 100%);
    padding: 1rem 0;
    box-shadow: var(--shadow-lg);
}

.navbar-custom .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.navbar-brand:hover {
    color: var(--accent-color);
}

.navbar-toggler {
    display: none;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
}

.navbar-toggler-icon {
    display: block;
    width: 22px;
    height: 2px;
    background-color: white;
    position: relative;
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 2px;
    background-color: white;
    left: 0;
}

.navbar-toggler-icon::before { top: -6px; }
.navbar-toggler-icon::after { top: 6px; }

.navbar-collapse {
    display: flex;
    flex-basis: auto;
    flex-grow: 1;
    align-items: center;
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    margin-left: auto;
    align-items: center;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    font-size: 0.95rem;
    cursor: pointer;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateY(-1px);
}

.dropdown-toggle::after {
    content: '';
    display: inline-block;
    margin-left: 0.4em;
    vertical-align: 0.2em;
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    min-width: 15rem;
    background: white;
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: 12px;
    padding: 0.5rem;
    margin-top: 0.5rem;
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    padding: 0.65rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(4px);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><radialGradient id="a" cx="50%" cy="50%" r="50%"><stop offset="0%" stop-color="%23ffffff" stop-opacity="0.1"/><stop offset="100%" stop-color="%23ffffff" stop-opacity="0"/></radialGradient></defs><circle cx="200" cy="200" r="100" fill="url(%23a)"/><circle cx="800" cy="300" r="150" fill="url(%23a)"/><circle cx="300" cy="700" r="80" fill="url(%23a)"/></svg>');
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    opacity: 0.95;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.search-form-container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

#url {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    min-width: 0;
    font-family: inherit;
}

#url:focus {
    outline: none;
    border-color: white;
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.3);
    background: white;
}

#btn-submit {
    padding: 1rem 2rem;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    font-family: inherit;
}

#btn-submit:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

#btn-submit:disabled {
    background: #6b7280;
    cursor: not-allowed;
    transform: none;
}

/* Results Section */
.results-section {
    padding: 2rem 0;
    min-height: 200px;
}

#loader {
    text-align: center;
    padding: 2rem;
    display: none;
}

#animator {
    display: inline-block;
    animation: pulse 1.5s ease-in-out infinite alternate;
}

@keyframes pulse {
    from { opacity: 1; }
    to { opacity: 0.4; }
}

.progress-container {
    margin: 2rem 0;
    display: none;
}

.progress {
    height: 25px;
    border-radius: 12px;
    overflow: hidden;
    background-color: #e9ecef;
    display: flex;
}

.progress-bar {
    background: linear-gradient(45deg, var(--success-color), var(--primary-color));
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Live Processing */
.live-processing {
    display: none;
    margin-top: 2rem;
    background: var(--light-color);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.processing-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.processing-header h4 {
    display: flex;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 600;
}

.processing-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.current-processing {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--warning-color);
    animation: processingPulse 2s ease-in-out infinite;
}

.current-processing h6 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

@keyframes processingPulse {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); 
        border-left-color: var(--warning-color);
    }
    50% { 
        box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); 
        border-left-color: var(--success-color);
    }
}

.processing-site {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.processing-site .spinner, .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--warning-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.recently-processed {
    max-height: 300px;
    overflow-y: auto;
}

.recently-processed h6 {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
}

.processed-item {
    background: white;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    animation: slideInRight 0.4s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.processed-item.success {
    border-left-color: var(--success-color);
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.05) 0%, white 100%);
}

.processed-item.error {
    border-left-color: var(--danger-color);
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.05) 0%, white 100%);
}

.processed-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.processed-url {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    word-break: break-all;
    font-size: 0.875rem;
}

.processed-status {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-success {
    background: var(--success-color);
    color: white;
}

.status-error {
    background: var(--danger-color);
    color: white;
}

.status-timestamp {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}

.backlink-results {
    display: none;
    margin-top: 2rem;
}

.backlink-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.backlink-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.backlink-url {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    word-break: break-all;
}

.backlink-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* YouTube Article Section */
.youtube-article {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    margin: 2rem 0;
    line-height: 1.8;
}

.youtube-article h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.youtube-article h3 {
    color: var(--secondary-color);
    margin: 1.5rem 0 1rem 0;
}

.youtube-article p {
    margin-bottom: 1.2rem;
    color: var(--text-secondary);
}

.youtube-article ul {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

.youtube-article li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* Feature Images */
.feature-image {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin: 1rem 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    aspect-ratio: 16 / 9;
    background-color: #f1f5f9;
}

.feature-image:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-xl);
}

.feature-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Content Sections */
.content-section {
    padding: 3rem 0;
}

.section-title {
    font-size: 2.25rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2.5rem;
    color: var(--text-primary);
}

/* Stats Section */
.stats-section {
    background: linear-gradient(135deg, var(--light-color) 0%, #ffffff 100%);
    padding: 3rem 0;
    margin: 2rem 0;
}

.stat-card {
    text-align: center;
    padding: 2rem 1rem;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 0.5rem;
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

/* Social Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    padding: 0.45rem 1rem;
    font-size: 0.875rem;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
    font-family: inherit;
}

.btn-sm {
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
}

.btn-primary {
    background-color: #1877f2;
    border-color: #1877f2;
    color: #fff;
}
.btn-primary:hover {
    background-color: #166fe5;
    color: #fff;
}

.btn-info {
    background-color: #0284c7;
    border-color: #0284c7;
    color: #fff;
}
.btn-info:hover {
    background-color: #0369a1;
    color: #fff;
}

.btn-success {
    background-color: #25d366;
    border-color: #25d366;
    color: #fff;
}
.btn-success:hover {
    background-color: #20bd5a;
    color: #fff;
}

/* Accordion/FAQ */
.faq-section {
    background: var(--light-color);
    padding: 4rem 0;
}

.accordion {
    max-width: 900px;
    margin: 0 auto;
}

.accordion-item {
    border: none;
    margin-bottom: 1rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: white;
}

.accordion-header {
    border: none;
    margin: 0;
}

.accordion-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border: none;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s ease;
    font-family: inherit;
}

.accordion-button:not(.collapsed) {
    background: var(--primary-color);
    color: white;
}

.accordion-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.3);
}

.accordion-button::after {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
    margin-left: auto;
    flex-shrink: 0;
}

.accordion-button:not(.collapsed)::after {
    transform: rotate(-135deg);
}

.accordion-collapse {
    display: none;
}

.accordion-collapse.show {
    display: block;
}

.accordion-body {
    padding: 1.5rem;
    background: white;
    line-height: 1.8;
    color: var(--text-secondary);
}

/* Footer */
.site-footer {
    background: linear-gradient(135deg, var(--dark-color) 0%, #374151 100%);
    color: rgba(255, 255, 255, 0.9);
    padding: 3rem 0 1.5rem;
}

.footer-title {
    font-weight: 700;
    color: white;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.footer-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    display: block;
    padding: 0.25rem 0;
    transition: all 0.3s ease;
}

.footer-link:hover {
    color: var(--accent-color);
    transform: translateX(4px);
}

/* Utilities & Gradients */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Content Visibility for Rendering Performance */
.youtube-article, .stats-section, .faq-section, .site-footer {
    content-visibility: auto;
    contain-intrinsic-size: auto none auto 400px;
}

/* Responsive Media Queries */
@media (max-width: 991px) {
    .navbar-toggler {
        display: block;
    }
    .navbar-collapse {
        display: none;
        width: 100%;
        margin-top: 1rem;
    }
    .navbar-collapse.show {
        display: block;
    }
    .navbar-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        margin-left: 0;
        width: 100%;
    }
    .dropdown-menu {
        position: static;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.1);
        margin-top: 0.25rem;
        padding: 0.25rem;
    }
    .dropdown-item {
        color: rgba(255, 255, 255, 0.9);
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    .hero-subtitle {
        font-size: 1.1rem;
    }
    .search-form {
        flex-direction: column;
    }
    .main-content {
        margin: 8px;
        border-radius: 12px;
    }
    .hero-section {
        padding: 2.5rem 0;
    }
    .search-form-container {
        padding: 1.25rem;
    }
    #url, #btn-submit {
        width: 100%;
        justify-content: center;
    }
    .section-title {
        font-size: 1.75rem;
    }
    .backlink-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .processing-stats {
        flex-direction: column;
        gap: 1rem;
    }
    .processing-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .youtube-article {
        padding: 1.5rem;
    }
}