/* ===================================
   CSS Variables & Reset
   =================================== */
:root {
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --secondary: #3b82f6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --bg-light: #f8fafc;
    --border: #e2e8f0;
    --white: #ffffff;
}

* {
    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-dark);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===================================
   Header
   =================================== */
.scanner-header {
    background: transparent;
    padding: 60px 0 40px;
    text-align: center;
    color: var(--white);
}

.scanner-header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

.tagline {
    font-size: 1.2rem;
    opacity: 0.95;
    font-weight: 300;
}

/* ===================================
   Main Content
   =================================== */
.scanner-main {
    padding: 20px 0 60px;
}

.scanner-card {
    background: var(--white);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    margin-bottom: 40px;
}

/* ===================================
   Scanner Form
   =================================== */
.scanner-form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-dark);
    font-size: 1rem;
}

.input-wrapper {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.url-input {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-light);
}

.url-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.scan-button {
    padding: 16px 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    min-width: 150px;
}

.scan-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.scan-button:active:not(:disabled) {
    transform: translateY(0);
}

.scan-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-loader {
    display: inline-block;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===================================
   Error Message
   =================================== */
.error-message {
    padding: 16px 20px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    color: var(--danger);
    margin-top: 20px;
    font-weight: 500;
}

/* ===================================
   Results Section
   =================================== */
.results-section {
    margin-top: 40px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-category {
    margin-bottom: 40px;
}

.result-category:last-child {
    margin-bottom: 0;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.category-icon {
    font-size: 1.8rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.result-item {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border-color: var(--primary);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.item-info {
    flex: 1;
}

.item-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.item-slug {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--text-light);
    background: var(--bg-light);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

.item-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.badge-theme {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

.badge-plugin {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    color: #5b21b6;
}

.item-note {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.4;
}

.item-confidence {
    font-size: 0.85rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.confidence-bar {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success) 0%, var(--primary) 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    font-size: 1.1rem;
}

/* ===================================
   Features Section
   =================================== */
.features-section {
    background: var(--white);
    border-radius: 16px;
    padding: 50px 40px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.features-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
    color: var(--text-dark);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 30px;
}

.feature-card {
    text-align: center;
    padding: 20px;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.feature-card p {
    color: var(--text-light);
    line-height: 1.6;
}

/* ===================================
   How It Works Section
   =================================== */
.how-it-works {
    background: var(--white);
    border-radius: 16px;
    padding: 50px 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.how-it-works h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
    color: var(--text-dark);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.step {
    text-align: center;
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 auto 20px;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.step h4 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.step p {
    color: var(--text-light);
    line-height: 1.6;
}

/* Accordion FAQ */
.accordion {
    background: white;
    border-radius: 12px;
    padding: 40px;
    margin-top: 40px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.accordion h2 {
    text-align: center;
    color: #000;
    font-size: 2rem;
    margin-bottom: 15px;
}

.faq-intro {
    text-align: center;
    color: #555;
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.accordion-item {
    border-bottom: 1px solid #e9ecef;
}

.accordion-header {
    width: 100%;
    background: none;
    border: none;
    padding: 20px 0;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.3s ease;
}

.accordion-header:hover {
    color: #667eea;
}

.accordion-header .icon {
    font-size: 1.5rem;
    color: #667eea;
    transition: transform 0.3s ease;
}

.accordion-item.active .icon {
    transform: rotate(45deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-item.active .accordion-content {
    max-height: 1000px;
}

.accordion-content p {
    padding-bottom: 20px;
    color: #555;
    line-height: 1.8;
}

.accordion-content ul {
    padding-bottom: 20px;
    padding-left: 20px;
    color: #555;
    line-height: 1.8;
}

.accordion-content li {
    margin-bottom: 8px;
}

/* Info Sections */
.intro-section, .info-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-top: 40px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.intro-section h2, .info-section h2 {
    color: #000;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.intro-section p, .info-section p {
    color: #555;
    font-size: 1.1rem;
    line-height: 1.8;
}

/* ===================================
   Footer
   =================================== */
.scanner-footer {
    text-align: center;
    padding: 30px 0;
    color: var(--white);
    opacity: 0.9;
}


/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 768px) {
    .scanner-header h1 {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .scanner-card {
        padding: 25px;
    }
    
    .input-wrapper {
        flex-direction: column;
    }
    
    .scan-button {
        width: 100%;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .features-section,
    .how-it-works {
        padding: 30px 20px;
    }
    
    .features-grid,
    .steps-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .scanner-header h1 {
        font-size: 1.75rem;
    }
    
    .category-title {
        font-size: 1.2rem;
    }
    
    .features-section h2,
    .how-it-works h2 {
        font-size: 1.5rem;
    }
}
