/* ========================================
   MODERN COMPONENT LIBRARY
   Reusable components for consistent styling
   ======================================== */

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background-color: var(--color-secondary);
    color: white;
    box-shadow: 0 4px 6px rgba(52, 152, 219, 0.2), 0 2px 4px rgba(52, 152, 219, 0.1);
}

.btn-primary:hover {
    background-color: var(--color-secondary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(52, 152, 219, 0.3), 0 4px 10px rgba(52, 152, 219, 0.15);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-secondary);
    border: 2px solid var(--color-secondary);
}

.btn-secondary:hover {
    background-color: var(--color-secondary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(52, 152, 219, 0.15);
}

.btn-accent {
    background-color: var(--color-accent);
    color: white;
    box-shadow: 0 4px 6px rgba(231, 76, 60, 0.2), 0 2px 4px rgba(231, 76, 60, 0.1);
}

.btn-accent:hover {
    background-color: var(--color-accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(231, 76, 60, 0.3), 0 4px 10px rgba(231, 76, 60, 0.15);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Button icon spacing */
.btn svg,
.btn i {
    width: 1.25em;
    height: 1.25em;
}

/* ========================================
   CARDS
   ======================================== */

.card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover .card-image {
    transform: scale(1.08);
}

.card-image-wrapper {
    overflow: hidden;
    position: relative;
}

.card-content {
    padding: var(--spacing-md);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--color-primary);
    transition: color 0.3s ease;
}

.card:hover .card-title {
    color: var(--color-secondary);
}

.card-description {
    color: var(--color-text-light);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

/* Card with overlay */
.card-overlay {
    position: relative;
}

.card-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(44, 62, 80, 0.9), rgba(44, 62, 80, 0.3));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-overlay:hover::after {
    opacity: 1;
}

/* ========================================
   BADGES & TAGS
   ======================================== */

.badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 6px;
    line-height: 1;
}

.badge-primary {
    background-color: var(--color-secondary);
    color: white;
}

.badge-secondary {
    background-color: var(--color-neutral-200);
    color: var(--color-primary);
}

.badge-accent {
    background-color: var(--color-accent);
    color: white;
}

.tag {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    font-size: 0.875rem;
    background-color: var(--color-neutral-100);
    color: var(--color-text);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.tag:hover {
    background-color: var(--color-secondary-light);
    color: white;
    transform: translateY(-2px);
}

.tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

/* ========================================
   CATEGORY BADGE (for project cards)
   ======================================== */

.category-badge {
    position: absolute;
    top: var(--spacing-sm);
    left: var(--spacing-sm);
    padding: 0.5rem 1rem;
    background-color: var(--color-secondary);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 6px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.category-badge.mgp {
    background-color: var(--color-secondary);
}

.category-badge.scouting {
    background-color: var(--color-accent);
}

.category-badge.analysis {
    background-color: #27ae60;
}

.category-badge.mapping {
    background-color: #9b59b6;
}

/* ========================================
   INPUTS & FORMS
   ======================================== */

.input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    border: 2px solid var(--color-neutral-300);
    border-radius: 6px;
    transition: all 0.3s ease;
    background-color: white;
}

.input:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.input::placeholder {
    color: var(--color-text-light);
}

/* Search input with icon */
.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-wrapper input {
    padding-left: 2.75rem;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-light);
    pointer-events: none;
}

/* ========================================
   FILTER PILLS
   ======================================== */

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.filter-pill {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    background-color: var(--color-neutral-100);
    color: var(--color-text);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.filter-pill:hover {
    background-color: var(--color-neutral-200);
    transform: translateY(-2px);
}

.filter-pill.active {
    background-color: var(--color-secondary);
    color: white;
    border-color: var(--color-secondary-dark);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.filter-pill.active:hover {
    background-color: var(--color-secondary-dark);
}

/* Filter count badge */
.filter-count {
    margin-left: 0.5rem;
    padding: 0.125rem 0.5rem;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 0.75rem;
}

.filter-pill.active .filter-count {
    background-color: rgba(255, 255, 255, 0.3);
}

/* ========================================
   LOADING STATES
   ======================================== */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-neutral-200) 25%,
        var(--color-neutral-100) 50%,
        var(--color-neutral-200) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 1.5rem;
    border-radius: 4px;
    width: 70%;
    margin-bottom: 1rem;
}

.skeleton-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
}

/* ========================================
   SPINNER
   ======================================== */

.spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--color-neutral-200);
    border-top-color: var(--color-secondary);
    border-radius: 50%;
    animation: spinner-rotate 0.6s linear infinite;
}

@keyframes spinner-rotate {
    to {
        transform: rotate(360deg);
    }
}

.spinner-sm {
    width: 1rem;
    height: 1rem;
    border-width: 2px;
}

.spinner-lg {
    width: 3rem;
    height: 3rem;
    border-width: 4px;
}

/* ========================================
   SECTION HEADERS
   ======================================== */

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    color: var(--color-text-light);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Accent underline */
.section-title-accent {
    position: relative;
    display: inline-block;
}

.section-title-accent::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, var(--color-secondary), var(--color-accent));
    border-radius: 2px;
}

/* ========================================
   CONTAINER UTILITIES
   ======================================== */

.container {
    width: 90%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.container-sm {
    max-width: 768px;
}

.container-lg {
    max-width: 1536px;
}

/* ========================================
   GRID UTILITIES
   ======================================== */

.grid {
    display: grid;
    gap: var(--spacing-md);
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* ========================================
   FADE ANIMATIONS
   ======================================== */

.fade-in {
    opacity: 0;
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.fade-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Staggered animation delays */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* ========================================
   GLASSMORPHISM
   ======================================== */

.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-dark {
    background: rgba(44, 62, 80, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========================================
   COMPACT PORTFOLIO NAVIGATION
   ======================================== */

.compact-portfolio-nav {
    background: white;
    padding: 0;
    border-bottom: 1px solid var(--color-neutral-200);
    margin-bottom: var(--spacing-lg);
}

.compact-portfolio-nav .container {
    max-width: 100%;
    width: 100%;
    padding: 0;
}

.compact-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0;
}

.compact-nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-neutral-50);
    border-radius: 0;
    text-decoration: none;
    color: var(--color-text);
    transition: all var(--transition-base) var(--ease-out);
    border-right: 1px solid var(--color-neutral-200);
}

.compact-nav-item:last-child {
    border-right: none;
}

.compact-nav-item:hover {
    background: var(--color-secondary-light);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

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

.compact-nav-item svg {
    width: 20px;
    height: 20px;
}

.compact-nav-text {
    display: flex;
    flex-direction: column;
}

.compact-nav-text strong {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    line-height: 1.2;
}

.compact-nav-text span {
    font-size: var(--font-size-xs);
    opacity: 0.8;
    line-height: 1.2;
}

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */

@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .hide-mobile {
        display: none;
    }

    .compact-nav-grid {
        grid-template-columns: 1fr;
    }

    .compact-nav-text span {
        display: none;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none;
    }
}
