/* Base styles */
:root {
    --primary: #2563eb;
    --secondary: #1e40af;
    --background: #f8fafc;
    --text: #1e293b;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    /* Dark mode variables */
    --dark-background: #1a202c;
    --dark-text: #e2e8f0;
    --dark-card: #2d3748;
    --dark-border: #4a5568;
}

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

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

/* Dark mode styles */
body.dark-mode {
    --background: var(--dark-background);
    --text: var(--dark-text);
}

body.dark-mode .navbar,
body.dark-mode .stats-container,
body.dark-mode .tools-category,
body.dark-mode .footer,
body.dark-mode .tool-card,
body.dark-mode .search-form,
body.dark-mode .dropdown-menu,
body.dark-mode .notification {
    background: var(--dark-card);
    color: var(--dark-text);
}

body.dark-mode .navbar {
    background: var(--dark-card);
    color: var(--dark-text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

body.dark-mode .tool-card {
    border-color: var(--dark-border);
}

body.dark-mode .tool-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(255,255,255,0.1);
}

body.dark-mode .dropdown-menu a:hover {
    background: var(--dark-background);
}

body.dark-mode .hero {
    background: linear-gradient(to bottom, var(--dark-card), var(--dark-background));
}

body.dark-mode .stat-label,
body.dark-mode .featured-on span,
body.dark-mode .hero p {
    color: #a0aec0;
}

body.dark-mode .footer-bottom,
body.dark-mode .featured-on {
    border-top-color: var(--dark-border);
}

body.dark-mode .social-links a {
    background: var(--dark-background);
}

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

/* Navigation */
.navbar {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 1.25rem;
}

.logo img {
    height: 32px;
    margin-right: 0.75rem;
}

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

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

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

.dropdown {
    position: relative;
}

.language-dropdown .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.flag-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
}

.search-toggle,
.menu-toggle {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

body.dark-mode .menu-toggle {
    color: var(--dark-text);
}

.search-toggle:hover,
.menu-toggle:hover {
    color: var(--primary);
}

.menu-toggle {
    display: none;
}

/* Search Form */
.search-form {
    position: absolute;
    top: 100%;
    right: 0;
    display: flex;
    align-items: center;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    padding: 0.5rem;
    z-index: 1000;
    transition: all 0.3s ease;
}

.search-input {
    border: 1px solid #e2e8f0;
    border-radius: 0.25rem;
    padding: 0.5rem;
    font-size: 1rem;
    width: 200px;
    outline: none;
    transition: all 0.3s ease;
}

body.dark-mode .search-input {
    border-color: var(--dark-border);
    background: var(--dark-background);
    color: var(--dark-text);
}

.search-input:focus {
    border-color: var(--primary);
}

.search-submit {
    background: var(--primary);
    border: none;
    color: #fff;
    padding: 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    margin-left: 0.5rem;
    transition: background 0.3s ease;
}

.search-submit:hover {
    background: var(--secondary);
}

/* Dropdown Menu */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    list-style: none;
    padding: 0.5rem 0;
    min-width: 150px;
    z-index: 1000;
    transition: all 0.3s ease;
}

.dropdown-menu li {
    margin: 0;
    padding: 0.25rem 1rem;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    color: var(--text);
    text-decoration: none;
    font-weight: 400;
    width: 100%;
}

.dropdown-menu a:hover {
    background: var(--background);
    color: var(--primary);
}

.dropdown:hover .dropdown-menu {
    display: block;
}

/* Hero Section */
.hero {
    padding: 8rem 0 4rem;
    text-align: center;
    background: linear-gradient(to bottom, #fff, var(--background));
    transition: all 0.3s ease;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.1rem;
    color: #64748b;
    max-width: 800px;
    margin: 0 auto 3rem;
}

.stats-container {
    background: #fff;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.stats-heading {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-item {
    text-align: center;
}

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

.stat-label {
    font-size: 0.875rem;
    color: #64748b;
}

.featured-on {
    border-top: 1px solid #e2e8f0;
    padding-top: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.featured-on span {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1rem;
    display: block;
}

.featured-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
}

.featured-logos img {
    height: 24px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

body.dark-mode .featured-logos img {
    filter: brightness(0) invert(1);
}

.featured-logos img:hover {
    opacity: 1;
}

/* Tools Section */
.tools-section {
    padding: 4rem 0;
}

.tools-category {
    background: #ffffff;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.tools-category h2 {
    color: var(--text);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: left;
    padding-left: 0.5rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2rem;
}

.tool-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    min-width: 0;
}

.tool-card:hover {
    border-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tool-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tool-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tool-card h3 {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tool-card.hidden {
    display: none;
}

/* Footer */
.footer {
    background: #ffffff;
    padding: 4rem 0 2rem;
    border-top: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
}

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

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

.footer-section p {
    color: var(--text);
}

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

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

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

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

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

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

.social-links a:hover {
    background: var(--primary);
    color: #ffffff;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.footer-bottom p {
    color: var(--text);
}

/* Theme Toggle Button in Footer */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--background);
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

body.dark-mode .theme-toggle {
    background: var(--dark-card);
    color: var(--dark-text);
}

.theme-toggle:hover {
    background: var(--primary);
    color: #ffffff;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        padding: 1rem;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        flex-direction: column;
        align-items: center;
        transition: all 0.3s ease;
    }

    body.dark-mode .nav-links {
        background: var(--dark-card);
        color: var(--dark-text);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        margin: 1rem 0;
    }

    .nav-links a {
        color: var(--text);
        width: 100%;
        text-align: center;
    }

    body.dark-mode .nav-links a {
        color: var(--dark-text);
    }

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

    .dropdown-menu {
        position: static;
        box-shadow: none;
        padding: 0.5rem 0 0 1rem;
        display: none;
    }

    .dropdown.active .dropdown-menu {
        display: block;
    }

    .dropdown:hover .dropdown-menu {
        display: none;
    }

    .search-form {
        position: static;
        width: 100%;
        margin-top: 1rem;
    }

    .search-input {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .featured-logos {
        flex-wrap: wrap;
    }

    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
        padding: 0 0.5rem;
    }

    .tool-card {
        padding: 0.75rem;
        width: 100%;
        box-sizing: border-box;
    }

    .tool-icon {
        width: 28px;
        height: 28px;
    }

    .tool-card h3 {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 0 0.25rem;
    }

    .tool-card {
        padding: 0.5rem;
    }

    .tool-icon {
        width: 24px;
        height: 24px;
    }

    .tool-card h3 {
        font-size: 0.8rem;
    }

    .theme-toggle {
        bottom: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }
}

/* Notifications */
.notification-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
}

.notification {
    background: #ffffff;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideIn 0.3s ease;
    transition: all 0.3s ease;
}

.notification.success {
    border-left: 4px solid var(--success);
}

.notification.error {
    border-left: 4px solid var(--error);
}

.notification.warning {
    border-left: 4px solid var(--warning);
}

.notification.info {
    border-left: 4px solid var(--info);
}

.notification i {
    font-size: 1.25rem;
}

.notification.success i {
    color: var(--success);
}

.notification.error i {
    color: var(--error);
}

.notification.warning i {
    color: var(--warning);
}

.notification.info i {
    color: var(--info);
}

.notification.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}
