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

:root {
    --primary-blue: #2563eb;
    --primary-blue-dark: #1d4ed8;
    --secondary-blue: #3b82f6;
    --accent-blue: #60a5fa;
    --light-blue: #dbeafe;
    --very-light-blue: #eff6ff;
    
    --background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f0f9ff 100%);
    --surface: rgba(255, 255, 255, 0.8);
    --surface-elevated: rgba(255, 255, 255, 0.95);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: rgba(148, 163, 184, 0.2);
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-elevated: rgba(0, 0, 0, 0.15);
    
    --status-online: #10b981;
    --status-offline: #ef4444;
    --status-maintenance: #f59e0b;
    
    --category-automation: #8b5cf6;
    --category-script: #3b82f6;
    --category-bookmarklet: #10b981;
    --category-site: #ef4444;
}

[data-theme="dark"] {
    --background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    --surface: rgba(30, 41, 59, 0.8);
    --surface-elevated: rgba(30, 41, 59, 0.95);
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: rgba(148, 163, 184, 0.2);
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-elevated: rgba(0, 0, 0, 0.4);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: all 0.3s ease;
}

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

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--surface-elevated);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: white;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.nav-desktop {
    display: flex;
    gap: 2rem;
}

.nav-desktop a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
}

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

.nav-desktop a::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-blue);
    transition: width 0.2s ease;
}

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

.search-container {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    z-index: 1;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-toggle {
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 0.5rem;
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: var(--light-blue);
    color: var(--primary-blue);
    transform: scale(1.05);
}

.contact-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.contact-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-elevated);
}

.mobile-menu-btn {
    display: none;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 0.5rem;
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    align-items: center;
    justify-content: center;
}

.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface-elevated);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    backdrop-filter: blur(10px);
}

.mobile-search {
    position: relative;
    margin-bottom: 1rem;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.mobile-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    transition: color 0.2s ease;
}

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

.mobile-contact {
    width: 100%;
}

.main {
    margin-top: 4rem;
    min-height: calc(100vh - 4rem);
}

.hero-section {
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

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

.hero-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-search {
    position: relative;
    max-width: 500px;
    margin: 0 auto 2rem;
    display: flex;
    background: var(--surface-elevated);
    border-radius: 0.75rem;
    padding: 0.25rem;
    box-shadow: 0 4px 20px var(--shadow);
}

.hero-search .search-icon {
    left: 1.25rem;
}

.hero-search-input {
    flex: 1;
    padding: 1rem 1rem 1rem 3rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
}

.hero-search-input:focus {
    outline: none;
}

.hero-search-btn {
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hero-search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-elevated);
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-elevated);
}

.btn-secondary {
    padding: 0.875rem 2rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--surface);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--light-blue);
    border-color: var(--primary-blue);
    transform: translateY(-1px);
}

.code-preview {
    background: var(--surface-elevated);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 10px 40px var(--shadow-elevated);
    max-width: 600px;
    margin: 0 auto;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.code-header {
    background: rgba(30, 41, 59, 0.9);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.code-dots {
    display: flex;
    gap: 0.5rem;
}

.dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
}

.dot.red { background: #ef4444; }
.dot.yellow { background: #f59e0b; }
.dot.green { background: #10b981; }

.code-title {
    color: #cbd5e1;
    font-size: 0.875rem;
    font-weight: 500;
}

.code-content {
    background: #1e293b;
    padding: 1.5rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #e2e8f0;
}

.code-line {
    margin-bottom: 0.25rem;
}

.code-line.indent {
    padding-left: 2rem;
}

.keyword { color: #c084fc; }
.function { color: #60a5fa; }
.variable { color: #34d399; }
.string { color: #fbbf24; }
.comment { color: #94a3b8; }

.stats-section {
    padding: 4rem 0;
    background: var(--surface);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat-item {
    padding: 2rem;
    background: var(--surface-elevated);
    border-radius: 1rem;
    box-shadow: 0 4px 20px var(--shadow);
    transition: transform 0.2s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 4rem;
    height: 4rem;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 1.5rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.catalog-page {
    padding: 2rem 0;
}

.catalog-header {
    text-align: center;
    margin-bottom: 3rem;
}

.catalog-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.catalog-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.filters-section {
    background: var(--surface-elevated);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px var(--shadow);
}

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

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 2rem;
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.filter-btn:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    transform: translateY(-1px);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    border-color: var(--primary-blue);
    color: white;
}

.filter-btn::after {
    content: attr(data-count);
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    background: var(--accent-blue);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 1rem;
    min-width: 1.25rem;
    text-align: center;
    display: none;
}

.filter-btn[data-count]:not([data-count=""]):not([data-count="0"])::after {
    display: block;
}

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

.results-count {
    color: var(--text-secondary);
    font-weight: 500;
}

.clear-filters {
    padding: 0.5rem 1rem;
    border: 1px solid var(--status-offline);
    border-radius: 0.5rem;
    background: transparent;
    color: var(--status-offline);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-filters:hover {
    background: var(--status-offline);
    color: white;
}

.scripts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.script-card {
    background: var(--surface-elevated);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 20px var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.script-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px var(--shadow-elevated);
}

.script-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-blue), var(--secondary-blue));
}

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

.card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

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

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

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

.badge.category-automation {
    background: rgba(139, 92, 246, 0.1);
    color: var(--category-automation);
}

.badge.category-script {
    background: rgba(59, 130, 246, 0.1);
    color: var(--category-script);
}

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

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

.badge.type {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.card-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.card-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-usage {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.no-results {
    text-align: center;
    padding: 4rem 2rem;
}

.no-results-icon {
    width: 5rem;
    height: 5rem;
    background: var(--light-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    color: var(--primary-blue);
    font-size: 2rem;
}

.no-results h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.no-results p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 1rem;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--surface-elevated);
    border-radius: 1rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px var(--shadow-elevated);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 2rem 2rem 0;
}

.modal-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.modal-close {
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 0.5rem;
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-close:hover {
    background: var(--light-blue);
    color: var(--primary-blue);
}

.modal-content {
    padding: 1rem 2rem 2rem;
}

.modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.modal-section {
    margin-bottom: 2rem;
}

.modal-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.modal-section p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.modal-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
}

.detail-item i {
    width: 1.25rem;
    color: var(--primary-blue);
}

.detail-item strong {
    color: var(--text-primary);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.progress-bar {
    height: 0.5rem;
    background: var(--border);
    border-radius: 0.25rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue), var(--secondary-blue));
    border-radius: 0.25rem;
    transition: width 0.8s ease;
    width: 0;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 0 2rem 2rem;
}

.modal-footer .btn-primary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-brand .logo {
    margin-bottom: 1rem;
}

.footer-description {
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 400px;
}

.footer-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

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

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

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 2rem;
    text-align: center;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-description {
        font-size: 1.125rem;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        max-width: 300px;
    }
    
    .nav-desktop {
        display: none;
    }
    
    .desktop-only {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .search-container {
        display: none;
    }
    
    .mobile-menu.active {
        display: block;
    }
    
    .scripts-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .results-header {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .modal {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
    
    .modal-content,
    .modal-header,
    .modal-footer {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn-primary,
    .modal-footer .btn-secondary {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .catalog-title {
        font-size: 2rem;
    }
    
    .filters-section {
        padding: 1.5rem;
    }
    
    .script-card {
        padding: 1.25rem;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
}

.desktop-only {
    display: block;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none;
    }
}

.script-card:nth-child(1) { animation-delay: 0.1s; }
.script-card:nth-child(2) { animation-delay: 0.2s; }
.script-card:nth-child(3) { animation-delay: 0.3s; }
.script-card:nth-child(4) { animation-delay: 0.4s; }
.script-card:nth-child(5) { animation-delay: 0.5s; }
.script-card:nth-child(6) { animation-delay: 0.6s; }
.script-card:nth-child(7) { animation-delay: 0.7s; }
.script-card:nth-child(8) { animation-delay: 0.8s; }
.script-card:nth-child(9) { animation-delay: 0.9s; }