/* CSS Variables */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --accent: #ec4899;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-white: #ffffff;
    --bg-light: #f9fafb;
    --bg-gray: #f3f4f6;
    --border: #e5e7eb;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.15);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-white);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Accessibility */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Header Navigation */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--bg-white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    transition: all 0.3s ease;
}

header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* AdSense Ads Styling */
.ad-container {
    margin: 2rem 0;
    text-align: center;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.ad-container .ad-label {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ad-header {
    margin: 1rem 0 2rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.03), rgba(139, 92, 246, 0.03));
    border-radius: 12px;
    overflow: hidden;
}

.ad-results {
    margin: 2rem 0;
    background: rgba(16, 185, 129, 0.03);
    border-radius: 12px;
    overflow: hidden;
}

.ad-content {
    margin: 3rem 0;
    background: rgba(236, 72, 153, 0.03);
    border-radius: 12px;
    overflow: hidden;
}

.ad-faq {
    margin: 2rem 0;
    background: rgba(245, 158, 11, 0.03);
    border-radius: 12px;
    overflow: hidden;
}

.ad-form {
    margin: 1.5rem 0;
    background: rgba(139, 92, 246, 0.03);
    border-radius: 12px;
    overflow: hidden;
}

/* Responsive Ad Units */
.responsive-ad {
    display: block !important;
    width: 100%;
    height: auto;
    min-height: 90px;
}

.ad-viewed {
    opacity: 1;
}

/* Main Content */
main {
    padding-top: 100px;
    min-height: 100vh;
}

.tool-header {
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-white) 100%);
    padding: 60px 2rem;
    text-align: center;
}

.tool-header h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tool-header p {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

.tool-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

.url-checker {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 3rem;
}

.mode-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 4px;
    background: var(--bg-light);
}

.mode-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.mode-btn.active {
    background: var(--primary);
    color: white;
}

.mode-btn:not(.active) {
    color: var(--text-light);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.url-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.url-input:focus {
    outline: none;
    border-color: var(--primary);
}

.bulk-input {
    min-height: 200px;
    resize: vertical;
}

.input-info {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

.check-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.check-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

.check-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.single-mode {
    display: none;
}

.single-mode.active,
.bulk-mode.active {
    display: block;
}

.bulk-mode {
    display: block;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Results Section */
.results-section {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 3rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.results-stats {
    display: flex;
    gap: 2rem;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.stat-number.success { color: var(--success); }
.stat-number.error { color: var(--error); }
.stat-number.redirects { color: var(--warning); }
.stat-number.total { color: var(--primary); }

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
}

.export-btn {
    background: var(--success);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.export-btn:hover {
    background: #059669;
    transform: translateY(-2px);
}

.result-item {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--border);
}

.result-item.success {
    border-left-color: var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.result-item.error {
    border-left-color: var(--error);
    background: rgba(239, 68, 68, 0.05);
}

.result-item.redirects {
    border-left-color: var(--warning);
    background: rgba(245, 158, 11, 0.05);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.result-url {
    font-weight: 600;
    color: var(--text-dark);
    word-break: break-all;
    flex: 1;
    margin-right: 1rem;
}

.result-badges {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.badge.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.result-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.detail-value {
    font-weight: 600;
    color: var(--text-dark);
    word-break: break-all;
}

.redirects-chain {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.redirects-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.redirect-step {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: rgba(245, 158, 11, 0.05);
    border-radius: 8px;
}

.redirect-arrow {
    margin: 0 1rem;
    color: var(--warning);
    font-weight: bold;
}

.redirect-from,
.redirect-to {
    font-family: monospace;
    font-size: 0.9rem;
    word-break: break-all;
}

.redirect-type {
    margin-left: auto;
    padding: 0.25rem 0.5rem;
    background: var(--warning);
    color: white;
    font-size: 0.75rem;
    border-radius: 12px;
    white-space: nowrap;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

/* SEO Content Sections */
.seo-content {
    background: var(--bg-light);
    padding: 80px 0;
}

.content-section {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 3rem;
}

.content-section h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    position: relative;
}

.content-section h2::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

.content-section h3 {
    color: var(--primary);
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.content-section h4 {
    color: var(--text-dark);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.content-section p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.content-section ul {
    list-style: none;
    padding-left: 0;
}

.content-section ul li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-light);
    line-height: 1.8;
}

.content-section ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
    font-size: 1.1rem;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.comparison-item {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 12px;
    border-left: 4px solid var(--primary);
}

.redirect-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.redirect-type {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.redirect-type:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.15);
}

.redirect-type h4 {
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.redirect-type p {
    font-size: 0.95rem;
    margin-bottom: 0;
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.step-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.step-content h4 {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.step-content p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

.issues-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.issue-item {
    background: rgba(239, 68, 68, 0.05);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--error);
}

.issue-item h4 {
    color: var(--error);
    margin-bottom: 0.75rem;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    text-align: center;
}

.cta-section h2 {
    color: white;
    margin-bottom: 1.5rem;
}

.cta-section h2::after {
    background: white;
}

.cta-section p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.cta-benefits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.benefit-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.benefit-item span:last-child {
    color: white;
    font-weight: 500;
}

.cta-button {
    display: inline-block;
    background: white;
    color: var(--primary);
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.3);
    background: var(--bg-light);
}

/* FAQ Section */
.faq-section {
    padding: 80px 2rem;
    background: var(--bg-light);
    position: relative;
}

.faq-container {
    max-width: 900px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

.faq-grid {
    display: grid;
    gap: 1rem;
    margin-top: 3rem;
}

.faq-item {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.faq-question {
    padding: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    transition: background 0.3s ease;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.faq-question:hover {
    background: var(--bg-light);
}

.faq-question.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
    color: var(--primary);
}

.faq-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-light);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.faq-icon::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.faq-question.active .faq-icon {
    background: var(--primary);
}

.faq-question.active .faq-icon::after {
    content: '−';
    color: white;
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 1.5rem;
}

.faq-answer.active {
    max-height: 500px;
    padding: 0 1.5rem 1.5rem;
}

.faq-answer p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.faq-answer ul {
    margin-top: 0.5rem;
    padding-left: 1.5rem;
    color: var(--text-light);
}

.faq-answer ul li {
    margin-bottom: 0.5rem;
    list-style-type: disc;
    padding-left: 0;
}

.faq-answer ul li::before {
    display: none;
}

/* Footer */
footer {
    background: var(--text-dark);
    color: white;
    padding: 60px 2rem 30px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h4 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: white;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.75rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--primary);
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
}

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

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

/* Mobile Ad Optimization */
@media (max-width: 768px) {
    .ad-container {
        margin: 1.5rem 0;
        padding: 0.75rem;
    }
    
    .ad-header,
    .ad-results,
    .ad-content,
    .ad-faq,
    .ad-form {
        margin: 1.5rem 0;
        border-radius: 8px;
    }
    
    .ad-container ins {
        display: block !important;
        width: 100% !important;
        height: auto !important;
    }
    
    .responsive-ad {
        min-height: 50px;
    }
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 2rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .nav-links.active {
        transform: translateX(0);
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    .tool-header {
        padding: 40px 1.5rem;
    }
    
    .tool-header p {
        font-size: 1rem;
    }
    
    .mode-selector {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .results-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .results-stats {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .result-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .result-badges {
        justify-content: flex-start;
    }
    
    .result-details {
        grid-template-columns: 1fr;
    }
    
    .redirect-step {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .redirect-arrow {
        margin: 0;
        transform: rotate(90deg);
    }
    
    .seo-content {
        padding: 40px 0;
    }
    
    .content-section {
        padding: 1.5rem;
    }
    
    .comparison-grid,
    .redirect-types-grid,
    .steps-container,
    .issues-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .step {
        flex-direction: column;
        text-align: center;
    }
    
    .cta-benefits {
        grid-template-columns: 1fr;
    }
    
    .benefit-item {
        justify-content: center;
        text-align: center;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .responsive-ad {
        min-height: 50px;
    }
    
    .tool-container {
        padding: 0 1rem 2rem;
    }
    
    .url-checker {
        padding: 1.5rem;
    }
    
    .content-section {
        padding: 1rem;
    }
    
    .ad-container {
        padding: 0.5rem;
        margin: 1rem 0;
    }
}