* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
/* Light Theme */
:root {
    --primary-blue: #1e40af;
    --primary-blue-dark: #1e3a8a;
    --secondary-blue: #3b82f6;
    --accent-blue: #60a5fa;
    --light-blue: #dbeafe;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --success: #10b981;
    --warning: #f59e0b;
    --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);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--gray-50) 0%, #f8fafc 100%);
    min-height: 100vh;
    color: var(--gray-800);
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

body[data-theme="dark"] {
    --primary-blue: #4299e1;
    --primary-blue-dark: #2c5282;
    --secondary-blue: #2b6cb0;
    --accent-blue: #63b3ed;
    --light-blue: #2a69ac;
    --white: #1a202c;
    --gray-50: #1a202c;
    --gray-100: #2d3748;
    --gray-200: #4a5568;
    --gray-300: #718096;
    --gray-400: #a0aec0;
    --gray-500: #cbd5e0;
    --gray-600: #e2e8f0;
    --gray-700: #edf2f7;
    --gray-800: #f7fafc;
    --gray-900: #ffffff;
    --success: #48bb78;
    --warning: #ecc94b;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    color: var(--gray-900);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 1s ease-out;
    position: relative;
}

.header::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary-blue), var(--accent-blue));
    border-radius: 2px;
}

.header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    position: relative;
}

.header p {
    font-size: 1.25rem;
    color: var(--gray-600);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

.footer {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    right: auto;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(229, 231, 235, 0.5);
    border-radius: 12px;
    padding: 0.6rem 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(12px);
    z-index: 100;
    animation: slideInUp 0.5s ease-out 0.5s both;
    transition: all 0.3s ease;
    max-width: 300px;
}

.footer-text {
    text-align: left;
    color: var(--gray-600);
    font-size: 0.8rem;
    margin: 0;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.footer-heart {
    width: 14px;
    height: 14px;
    color: #ef4444;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.footer-link {
    color: var(--secondary-blue);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    font-size: 0.8rem;
}

.footer-link:hover {
    color: var(--primary-blue);
    transform: translateX(2px);
}

/* Light theme specific */
body[data-theme="light"] .footer {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(229, 231, 235, 0.6);
}

body[data-theme="light"] .footer-text {
    color: var(--gray-600);
}

body[data-theme="light"] .footer-heart {
    color: #f72222;
}

.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    z-index: 1000;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.small-btn {
    padding: 0.75rem 1.5rem !important;
    font-size: 0.9rem !important;
    width: auto !important;
}

/* Dark theme */
body[data-theme="dark"] .theme-toggle {
    background: var(--gray-700);
    border-color: var(--gray-600);
}

body[data-theme="dark"] .theme-toggle:hover {
    background: var(--gray-600);
}

.search-container {
    position: relative;
    max-width: 700px;
    margin: 0 auto 3rem;
    animation: fadeInUp 1s ease-out 0.3s both;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    border: 2px solid transparent;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.search-input-wrapper:focus-within {
    border-color: var(--secondary-blue);
    box-shadow: 0 0 0 4px rgb(59 130 246 / 0.1), var(--shadow-2xl);
    transform: translateY(-4px);
}

#searchInput {
    flex: 1;
    padding: 1.5rem 1rem 1.5rem 5rem;
    border: none;
    border-radius: 20px;
    font-size: 1.1rem;
    outline: none;
    background: transparent;
    color: var(--gray-800);
}

#searchInput::placeholder {
    color: var(--gray-400);
}

.search-icon {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-500);
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 10;
}

.search-input-wrapper:focus-within .search-icon {
    color: var(--secondary-blue);
    transform: translateY(-50%) scale(1.1);
}

.search-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--secondary-blue);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-btn:hover {
    background: var(--primary-blue-dark);
    transform: translateY(-50%) translateX(2px);
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
    animation: fadeInUp 1s ease-out 0.6s both;
}

.stat-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--gray-200);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--secondary-blue), var(--accent-blue));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-2xl);
}

.stat-icon {
    font-size: 2rem;
    color: var(--secondary-blue);
    margin-bottom: 1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--gray-600);
    font-size: 0.95rem;
    font-weight: 500;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
    justify-content: center;
    animation: fadeInUp 1s ease-out 0.8s both;
    transition: opacity 0.3s ease;
}

.filter-tags.hidden {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    margin-bottom: 0;
}

.tag {
    padding: 0.75rem 1.5rem;
    background: var(--light-blue);
    color: var(--primary-blue);
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.tag:hover::before {
    left: 100%;
}

.tag:hover, .tag.active {
    background: var(--secondary-blue);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.results-container {
    animation: fadeIn 1s ease-out;
}

.api-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.api-card {
    background: var(--white);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    animation: slideInUp 0.7s ease-out forwards;
    position: relative;
    overflow: hidden;
}

.api-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary-blue), var(--accent-blue));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.api-card:hover::before {
    transform: scaleX(1);
}

.api-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-2xl);
    border-color: var(--secondary-blue);
}

.api-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.api-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--secondary-blue), var(--accent-blue));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
}

.api-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 0.25rem;
    flex: 1;
}

.api-description {
    color: var(--gray-600);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.api-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--secondary-blue);
    text-decoration: none;
    font-weight: 600;
    padding: 1rem 1.5rem;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(59, 130, 246, 0.2);
    width: 100%;
    justify-content: center;
}

.api-link:hover {
    background: var(--secondary-blue);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.highlight {
    background: linear-gradient(120deg, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0.2) 100%);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
    color: var(--primary-blue);
}

.no-results {
    text-align: center;
    padding: 6rem 2rem;
    color: var(--gray-500);
    animation: fadeIn 1s ease-out;
}

.no-results i {
    font-size: 5rem;
    margin-bottom: 2rem;
    opacity: 0.3;
    display: block;
}

.no-results h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--gray-700);
}

.no-results button.api-link {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
}

.categories-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--white);
    border-radius: 20px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-2xl);
    transform: scale(0.8);
    animation: modalPop 0.3s ease forwards;
}

@keyframes modalPop {
    to {
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-500);
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.close-modal:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.category-item {
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    text-align: center;
}

.category-item:hover {
    background: var(--light-blue);
    border-color: var(--secondary-blue);
    transform: translateY(-2px);
}

.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: var(--secondary-blue);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-xl);
    transition: all 0.3s ease;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: var(--shadow-2xl);
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@media (max-width: 768px) {
    .container { padding: 1rem; }
    .header h1 { font-size: 2.5rem; }
    .stats { grid-template-columns: 1fr; }
    .api-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .fab { bottom: 1rem; right: 1rem; width: 55px; height: 55px; }
    .theme-toggle { width: 45px; height: 45px; }
}
/* dark footer */
body[data-theme="dark"] .footer {
    background: rgba(31, 41, 55, 0.85);
    border-color: rgba(75, 85, 99, 0.5);
}

body[data-theme="dark"] .footer-text {
    color: var(--gray-400);
}

body[data-theme="dark"] .footer-heart {
    color: #f72222;
}

body[data-theme="dark"] .footer-link {
    color: var(--accent-blue);
}

body[data-theme="dark"] .footer-link:hover {
    color: var(--secondary-blue);
}

/* Hover effects */
.footer:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.95);
}

body[data-theme="dark"] .footer:hover {
    background: rgba(31, 41, 55, 0.95);
}

.footer:hover .footer-heart {
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 768px) {
    .footer {
        bottom: 0.5rem;
        left: 0.5rem;
        padding: 0.5rem 0.8rem;
        max-width: 250px;
    }
    
    .footer-text {
        font-size: 0.75rem;
    }
    
    .footer-heart {
        font-size: 0.8rem;
        width: 10px;
    }
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--gray-700);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--gray-500);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

