/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3a86ff;
    --dark-bg: #121212;
    --dark-surface: #1e1e1e;
    --dark-surface-light: #2d2d2d;
    --dark-surface-light-switch: #6a6a6a;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
}

body {
    background-color: var(--dark-bg);
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
}
.header-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Header Styles */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--dark-surface);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0; /* Changed from 1rem 2rem */
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-container a {
    display: flex;
    align-items: center;
}

.logo {
    height: 40px;
    width: auto;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Language Switch */
.switch-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.flag {
    width: 24px;
    height: 16px;
    object-fit: cover;
}

.switch {
    width: 50px;
    height: 24px;
    background-color: var(--dark-surface-light-switch);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.switch-handle {
    width: 20px;
    height: 20px;
    background-color: #00B5E2;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
}

.switch.en .switch-handle {
    left: calc(100% - 22px);
    background-color: #ff0000;
}

/* Search Bar */
.search-container {
    max-width: 1200px; /* Match header width */
    width: 100%;
    margin: 0 auto;
    padding-top: 100px;
    padding-bottom: 1rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

#searchInput {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #444;
    border-radius: 20px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--dark-surface-light);
    color: var(--text-primary);
}

#searchInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(58,134,255,0.3);
}

/* Main Content Styles */
.tools-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem 40px;
}


.category-filters {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto 2rem;
    padding-left: 1rem;
    padding-right: 1rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: var(--dark-surface-light);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
}

.filter-btn:hover:not(.active) {
    background: #444;
}

/* Tool Cards Styles */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.tool-card {
    background: var(--dark-surface);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    overflow: hidden;
    transition: transform 0.3s ease;
    border: 1px solid #333;
    cursor: pointer;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.tool-card-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tool-card-image.loaded {
    opacity: 1;
}

.tool-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background-color: var(--dark-surface-light);
    flex-shrink: 0;
}

.tool-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.tool-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1rem;
    margin-bottom: 0.5rem;
}

.tool-name {
    font-weight: bold;
    margin: 0;
    color: white;
    /* Thicker outline */
    text-shadow: 
        -1.5px -1.5px 0 #000,
        1.5px -1.5px 0 #000,
        -1.5px 1.5px 0 #000,
        1.5px 1.5px 0 #000,
        0 0 4px rgba(0,0,0,0.8); /* Additional blur for smoother edges */
    
    -webkit-text-stroke: 2px black;
    text-stroke: 2px black;
    paint-order: stroke fill; /* Ensures stroke renders behind fill */
}

.tool-description {
    padding: 0 1rem;
    margin: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.visit-button {
    display: block;
    width: calc(100% - 2rem);
    padding: 0.75rem;
    margin: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
    text-align: center;
    text-decoration: none;
}

.visit-button:hover {
    background: #2667cc;
}

/* Footer Styles */
.main-footer {
    text-align: center;
    padding: 1.5rem;
    background: var(--dark-surface);
    color: var(--text-secondary);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--dark-surface-light);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #333;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.social-btn svg {
    width: 20px;
    height: 20px;
}

.facebook-btn:hover {
    background: #1877f2;
    color: white;
    border-color: #1877f2;
}

.instagram-btn:hover {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: white;
    border-color: #dc2743;
}

.youtube-btn:hover {
    background: #ff0000;
    color: white;
    border-color: #ff0000;
}

.behance-btn:hover {
    background: #1769ff;
    color: white;
    border-color: #1769ff;
}

.github-btn:hover {
    background: #333;
    color: white;
    border-color: #333;
}

.x-btn:hover {
    background: #000;
    color: white;
    border-color: #000;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
}

.modal-content {
    position: relative;
    background: var(--dark-surface);
    width: 90%;
    max-width: 600px;
    margin: 50px auto;
    padding: 2rem;
    border-radius: 12px;
    animation: modalOpen 0.3s ease-out;
    border: 1px solid #333;
}

.modal-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.close-button {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.close-button:hover {
    color: var(--text-primary);
}

/* Tool Meta Information */
.tool-meta {
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.az-support {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.az-support.supported {
    background: rgba(0, 181, 226, 0.2);
    color: #00B5E2;
}

.az-support.not-supported {
    background: rgba(255, 0, 0, 0.1);
    color: #ff4444;
}

.monetization {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.monetization.freemium {
    background: rgba(58, 134, 255, 0.2);
    color: var(--primary-color);
}

.monetization.paid {
    background: rgba(255, 193, 7, 0.2);
    color: #FFC107;
}

.monetization.free {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

/* Tool Details in Modal */
.tool-details {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--dark-surface-light);
    border-radius: 8px;
}

.tool-details p {
    margin: 0.5rem 0;
}

/* Tool Card Image - Back to original format with lazy loading */
.tool-card {
    position: relative;
    overflow: hidden;
}

.tool-card-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tool-card-image.loaded {
    opacity: 1;
}

.tool-card-content {
    padding: 1rem;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--dark-surface);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0; /* Changed from 1rem 2rem */
}
    
    .search-container {
    max-width: 1200px; /* Match header width */
    width: 100%;
    margin: 0 auto;
    padding-top: 100px;
    padding-bottom: 1rem;
    padding-left: 1rem;
    padding-right: 1rem;
}
    
    .category-filters {
        padding: 0 1rem;
    }
    
    .footer-content {
        gap: 0.75rem;
    }
    
    .social-links {
        gap: 0.75rem;
    }
    
    .social-btn {
        width: 36px;
        height: 36px;
    }
    
    .social-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* Animations */
@keyframes modalOpen {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading Trigger for Lazy Loading */
.loading-trigger {
    width: 100%;
    height: 20px;
    grid-column: 1 / -1;
    opacity: 0;
    pointer-events: none;
}