/* Base Styles */
html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    background-color: #f8fafc;
    color: #1a2b3c;
    line-height: 1.5;
}

/* Navigation */
nav {
    transition: transform 0.3s ease;
    background: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

nav.scroll-down {
    transform: translateY(-100%);
}

nav.scroll-up {
    transform: translateY(0);
}

/* Hero Section */
.hero-badge {
    background-color: #fdf2f8;
    color: #ea4c89;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    display: inline-block;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: #1f2937;
}

.hero-description {
    font-size: 1.25rem;
    color: #6b7280;
    max-width: 36rem;
    margin: 0 auto 2rem;
}

/* Users Container */
.users-container {
    width: 100%;
    overflow-x: hidden;
    padding: 20px 0;
    position: relative;
    margin: 2rem 0;
}

#usersWrapper {
    display: flex;
    gap: 24px;
    animation: scrollLeft 30s linear infinite;
    will-change: transform;
}

@keyframes scrollLeft {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

#usersWrapper:hover {
    animation-play-state: paused;
}

/* User Card */
.user-card {
    flex: 0 0 auto;
    width: 200px;
    height: 300px;
    aspect-ratio: 1;
    border-radius: 16px;
    padding: 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.user-card:hover {
    transform: translateY(-4px);
}

.user-card img.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
}

.user-card .content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    color: white;
    z-index: 1;
}

.user-card .skills {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.user-card .skill-tag {
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    border-radius: 999px;
    font-size: 14px;
    color: white;
}

/* Project Card */
.project-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.project-card .header-image,
.project-card .header-gradient {
    width: 100%;
    height: 200px;
}

.project-card .header-image {
    object-fit: cover;
}

.project-card .header-gradient {
    background: linear-gradient(135deg, #ff7e5f, #feb47b);
}

.project-card .content {
    padding: 20px;
    position: relative;
}

.project-card .author-image {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid white;
    position: absolute;
    top: -24px;
    left: 20px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.project-card .title {
    color: #1a2b3c;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    margin-top: 1.5rem;
}

.project-card .description {
    color: #4a5567;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-card .stats {
    display: flex;
    gap: 1.5rem;
    color: #64748b;
    font-size: 0.875rem;
}

.project-card .stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.project-card .stat-item:hover {
    color: #ea4c89;
}

.project-card .stat-item svg {
    width: 1.25rem;
    height: 1.25rem;
}

.project-card .stat-item.active {
    color: #ea4c89;
}

/* Buttons */
.btn {
    transition: all 0.3s ease;
    cursor: pointer;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
}

.btn-primary {
    background-color: #ea4c89;
    color: white;
}

.btn-primary:hover {
    background-color: #dd3870;
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid currentColor;
}

.btn-secondary:hover {
    background-color: rgba(234, 76, 137, 0.1);
}

/* Search Input */
.search-input {
    width: 100%;
    max-width: 320px;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    border: 2px solid transparent;
    background-color: #f3f4f6;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #ea4c89;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(234, 76, 137, 0.1);
}

/* Loading States */
.loading-spinner {
    display: none;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

.loading-spinner.visible {
    display: block;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Grid Layout */
.grid {
    display: grid;
    gap: 24px;
    padding: 24px 0;
}

@media (min-width: 640px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .user-card {
        width: 240px;
    }

    .project-card .title {
        font-size: 1.25rem;
    }

    .project-card .header-image,
    .project-card .header-gradient {
        height: 160px;
    }

    .search-input {
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .hero-title {
        font-size: 2rem;
    }

    .user-card {
        width: 220px;
    }

    .project-card .stats {
        flex-wrap: wrap;
    }

    .project-card .header-image,
    .project-card .header-gradient {
        height: 140px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .project-card {
        background: #1f2937;
    }

    .project-card .title {
        color: #f3f4f6;
    }

    .project-card .description {
        color: #d1d5db;
    }

    .project-card .stats {
        color: #9ca3af;
    }

    .project-card .header-gradient {
        background: linear-gradient(135deg, #b91c1c, #7c2d12);
    }
}

/* Utilities */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shadow-hover {
    transition: box-shadow 0.3s ease;
}

.shadow-hover:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.aspect-square {
    aspect-ratio: 1/1;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .user-card,
    .project-card,
    .btn,
    .search-input {
        transition: none;
    }

    #usersWrapper {
        animation: none;
    }

    .loading-spinner {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .user-card,
    .project-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .header-gradient {
        background: none;
        border: 1px solid #ccc;
    }
}