/* CSS Variables for Navigation */
:root {
    --primary-color: #ff6b35;
    --secondary-color: #ff4500;
    --accent-color: #dc143c;
}

/* Navigation Styles - Add these to ensure navbar works */
.top-nav {
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 70px;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.nav-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}

.logo-container img {
    height: 40px;
    width: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

.nav-menu {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s ease;
    padding: 5px 0;
}

.nav-link:hover,
.nav-link.active {
    opacity: 0.8;
    border-bottom: 2px solid white;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.sidebar {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1001;
    overflow-y: auto;
}

.sidebar.open {
    right: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    color: #333;
    font-weight: bold;
}

.sidebar-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.sidebar-content {
    padding: 20px;
}

.sidebar-section {
    margin-bottom: 30px;
}

.sidebar-title {
    font-size: 0.9rem;
    font-weight: bold;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
}

.sidebar-link {
    display: block;
    padding: 10px 0;
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.sidebar-link:hover,
.sidebar-link.active {
    color: var(--primary-color);
}

/* Add padding for fixed navbar */
body {
    padding-top: 70px;
}

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

    .nav-toggle {
        display: block;
    }
}

/* Selection Grid Styles */
.selection-grid {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
    border-bottom: 1px solid #ddd;
}

.tab-link {
    text-decoration: none;
    color: inherit;
    flex: 1;
}

.tab-item {
    padding: 12px 16px;
    text-align: center;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
    font-weight: 500;
    color: #666;
}

.tab-item:hover {
    background-color: #f5f5f5;
    color: #333;
}

.tab-link.active .tab-item {
    border-bottom: 3px solid #4A90E2;
    color: #4A90E2;
    font-weight: 600;
}

/* Standard Grid Styles */
.content-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.tile {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
}

.tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}


.tile-video {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.tile-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.tile-github {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #24292e, #0366d6);
    color: white;
    font-size: 48px;
}

.tile-github i {
    color: white;
}

.tile-playground {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-size: 48px;
}

.tile-playground i {
    color: white;
}

.video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tile:hover .video-overlay {
    opacity: 1;
}

.video-overlay i {
    font-size: 48px;
    color: white;
}

.tile-content {
    padding: 15px;
}

.tile-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.tile-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.4;
}

.tile-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
}

.tile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tile-tag {
    background: #f0f0f0;
    color: #666;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
}

.loading-grid {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading-grid i {
    font-size: 48px;
    margin-bottom: 20px;
}

.error-grid {
    text-align: center;
    padding: 40px;
    color: #999;
}

.error-grid i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #ff6b6b;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    overflow-y: auto;
}

.modal-content {
    position: relative;
    background-color: white;
    margin: 50px auto;
    padding: 20px;
    border-radius: 10px;
    max-width: 800px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.modal-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.modal-close:hover {
    background-color: #f0f0f0;
}

.modal-body {
    display: flex;
    gap: 20px;
}

.modal-info {
    flex: 1;
    padding: 15px;
}

.modal-media {
    min-height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-media video,
.modal-media img {
    max-height: 500px;
    width: 100%;
    object-fit: contain;
}

.modal-actions {
    margin-top: 20px;
    text-align: center;
}

.modal-link-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.3s ease;
}

.modal-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.modal-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.tile-tag {
    background: #f0f0f0;
    color: #666;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .content-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 16px;
    }

    .tile-featured {
        grid-column: span 1;
        grid-row: span 1;
    }

    .modal-body {
        flex-direction: column;
    }

    .modal-content {
        margin: 20px auto;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 12px;
    }

    .tile-video {
        height: 180px;
    }

    .tile-image {
        height: 180px;
    }
}
