:root {
    --bg-light: #f2f6fc;
    --bg-card: #ffffff;
    --primary-dark: #1f1a6b;
    --primary-medium: #c6c5d1;
    --text-primary: #363d47;
    --text-secondary: #6c757d;
    --accent-green: #7ed6a5;
    --border: rgba(0, 0, 0, 0.08);
    --brand-yellow: #7ed6a5;
}

/* Page Wrapper */
.platforms-page {
    background: var(--bg-light);
    min-height: 100vh;
    padding: 60px 20px 100px;
    font-family: "Inter", "Segoe UI", system-ui, sans-serif;
    color: var(--text-primary);
}

.platforms-inner {
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 900px) {
    .platforms-page {
        padding: 40px 16px 80px;
    }
}

/* Header Section */
.platforms-header {
    text-align: center;
    margin-bottom: 48px;
}

.platforms-header .subtitle {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--primary-medium);
    font-weight: 700;
    margin-bottom: 12px;
}

.platforms-header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--primary-dark);
    margin: 0 0 12px;
}

.platforms-header h1 span {
    color: var(--accent-green);
}

.platforms-header .description {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 48px;
    padding: 8px 0;
}

.filter-btn {
    padding: 8px 24px;
    border-radius: 999px;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.filter-btn:hover {
    border-color: var(--primary-medium);
    color: var(--primary-dark);
    background: rgba(46, 42, 143, 0.1);
}

.filter-btn.active {
    background: var(--primary-dark);
    color: white;
    border-color: var(--primary-dark);
}

/* Search Wrap */
.search-wrap {
    position: relative;
}

.search-wrap svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    width: 16px;
    height: 16px;
    pointer-events: none;
}

.search-input {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    padding: 10px 20px 10px 42px;
    color: var(--text-primary);
    font-size: 0.875rem;
    width: 240px;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-input:focus {
    border-color: var(--primary-medium);
    box-shadow: 0 0 0 3px rgba(31, 26, 107, 0.1);
}

/* Masonry Grid - 2 columns with staggered effect */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    align-items: start;
}

/* Staggered layout - even cards offset down */
.project-card:nth-child(even) {
    margin-top: 100px;
}

/* Extra staggered for larger screens */
@media (min-width: 1200px) {
    .project-card:nth-child(3n + 2) {
        margin-top: 80px;
    }
    .project-card:nth-child(3n + 3) {
        margin-top: 30px;
    }
}

/* For responsive */
@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .project-card:nth-child(even) {
        margin-top: 0;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-wrap {
        width: 100%;
    }

    .search-input {
        width: 100%;
    }
}

/* Card Styles */
.project-card {
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    display: block;
    background: var(--bg-card);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    transition:
        transform 0.35s ease,
        box-shadow 0.35s ease;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(31, 26, 107, 0.15);
}

/* Image Wrapper */
.card-img-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, #e0e7ff 0%, #f2f6fc 100%);
    aspect-ratio: 4 / 5;
    cursor: pointer;
}

.card-img-wrap img,
.card-img-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.project-card:hover .card-img-wrap img,
.project-card:hover .card-img-wrap video {
    transform: scale(1.06);
}

/* Dark gradient overlay - softer for light theme */
.card-img-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.1) 30%,
        rgba(0, 0, 0, 0.5) 60%,
        rgba(0, 0, 0, 0.8) 100%
    );
    pointer-events: none;
    z-index: 1;
}

/* Video specific overlay */
.video-auto-card .card-img-wrap::after {
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.05) 30%,
        rgba(0, 0, 0, 0.3) 60%,
        rgba(0, 0, 0, 0.7) 100%
    );
}

.video-auto-card:hover .card-img-wrap video {
    transform: scale(1.02);
}

/* Placeholder for missing images */
.card-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e0e7ff 0%, #f2f6fc 100%);
    color: rgba(31, 26, 107, 0.2);
    font-size: 3rem;
}

/* Card Body - Text Overlay */
.card-body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    z-index: 2;
    pointer-events: none; /* Allow clicks to pass through except on interactive elements */
}

/* Make interactive elements clickable */
.card-link {
    pointer-events: auto;
}

/* ID Badge */
.card-id {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    color: var(--primary-dark);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.05em;
    font-family: monospace;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

/* Category Tags */
.card-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.card-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 8px;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: none;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--primary-dark);
}

/* Title */
.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 10px;
    line-height: 1.3;
    text-shadow: 0 2px 8px rgba(186, 185, 185, 0.2);
}

/* Description */
.card-desc {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
    margin: 0 0 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Footer Meta */
.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(83, 193, 136, 0.2);
}

.card-date {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    pointer-events: none;
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--bg-card);
    text-decoration: none;
    transition: all 0.2s ease;
    background: var(--accent-green);
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
}

.card-link:hover {
    gap: 10px;
    text-decoration: none;
    color: white;
    background: var(--primary-medium);
    transform: translateY(-2px);
}

.card-link svg {
    width: 12px;
    height: 12px;
    stroke-width: 2.5;
}

/* Video Auto-play Card */
.video-auto-card {
    cursor: default;
}

/* Hidden state for filter */
.project-card.hidden {
    display: none !important;
}

/* No Results */
.no-results {
    display: none;
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
    font-size: 1rem;
    grid-column: 1 / -1;
}

.no-results.show {
    display: block;
}

.no-results svg {
    width: 60px;
    height: 60px;
    margin-bottom: 16px;
    opacity: 0.5;
    color: var(--text-secondary);
}

.no-results h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 100px 20px;
    background: var(--bg-card);
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.empty-state .empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Mobile optimization */
@media (max-width: 768px) {
    .project-card {
        min-height: 400px;
    }

    .card-title {
        font-size: 1.3rem;
    }

    .card-desc {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
    }

    .card-body {
        padding: 20px;
    }

    .video-auto-card video {
        object-fit: cover;
    }

    .card-link {
        padding: 4px 10px;
        font-size: 0.7rem;
    }
}

/* Reduce motion preference support */
@media (prefers-reduced-motion: reduce) {
    .project-card:hover .card-img-wrap video {
        transform: none;
    }

    .video-auto-card video {
        transition: none;
    }
}
