/* Apps Page Styles */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Inter, sans-serif;
}

html, body {
    height: 100%;
    margin: 0; /* Ensure no margin on html/body */
    padding: 0;
}

body {
    background-color: #f5f5f3;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    margin: 0; /* Explicitly set margin to 0 */
    padding: 0; /* Removed padding to fix white bar at top */
}

.page-header {
    text-align: center; /* Fixed header doesn't need margin-bottom */
}

.page-content {
    text-align: center;
    margin-bottom: 20px;
    padding-top: 20px;
    margin-top: 0;
}

main {
    padding-top: 0;
    width: 100%;
    max-width: 1200px;
    margin: 60px auto 0; /* Consistent with other index pages */
    padding-left: 20px;
    padding-right: 20px;
}

/* Adjust for mobile header height */
@media (max-width: 768px) {
    main {
        margin-top: 76px; /* Account for taller mobile header */
    }
}

.page-title {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 10px;
    margin-top: 0;
    color: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.title-divider {
    font-weight: 300;
    color: #999;
    font-size: 24px;
}

.title-subtitle {
    font-size: 24px;
    font-weight: 400;
    color: #666;
}

@media (width <= 600px) {
    .page-title {
        flex-direction: column;
        gap: 4px;
    }
    
    .title-divider {
        display: none;
    }
    
    .title-subtitle {
        font-size: 18px;
    }
}

.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    width: 100%;
    max-width: 1000px;
}

.project-card {
    background-color: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgb(0 0 0 / 10%);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgb(0 0 0 / 10%);
    display: flex;
    flex-direction: column;
    height: 380px;
    position: relative;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgb(0 0 0 / 15%);
}

.project-card-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.project-image {
    height: 180px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.jai-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s ease;
    will-change: transform;
    transform: translateZ(0);
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #222;
}

.project-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 40px;
    line-height: 1.5;
    flex-grow: 1;
}

.project-link {
    align-self: flex-start;
    padding: 8px 16px;
    background-color: #222;
    color: white;
    border-radius: 50px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.project-link:hover {
    background-color: #444;
}

.btn {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: transparent;
    color: #222;
    border: 1px solid #222;
    border-radius: 50px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: rgb(0 0 0 / 5%);
}

.back-button-container {
    text-align: center;
    margin-top: 10px;
    margin-bottom: 20px;
}

/* Theme toggle styles removed - apps.html uses header-embedded toggle from header.css */

/* If a fixed-position toggle is needed for specific pages, use a different class name */

@media (width >= 769px) and (width <= 1024px) {
    .jai-container {
        grid-template-columns: repeat(2, minmax(280px, 400px)) !important;
        justify-content: center;
        gap: 30px;
    }
    
    .jai-card {
        max-width: 400px;
    }
}

@media (width <= 768px) {
    .jai-container {
        grid-template-columns: 1fr;
        max-width: 400px;
    }
    
    .page-title {
        font-size: 26px;
    }
    
    .page-description {
        font-size: 14px;
    }
}

.jai-image {
    height: 160px;
    width: 100%;
    background-color: #f5f5f5;
    background-position: center;
    background-size: cover;
    position: relative;
    contain: layout style paint;
}

.jai-card {
    max-width: 100%;
    width: 100%;
    min-height: 360px;
    height: 100%;
}

/* Real mode image backgrounds - now handled by JavaScript dynamically */

/* Using data-app-id attributes instead of nth-child for maintainability */

/* Welcome banner styles */
.welcome-banner {
    background: linear-gradient(135deg, #4a9eff 0%, #7366ff 100%);
    color: white;
    padding: 30px;
    border-radius: 16px;
    margin: 20px auto 40px;
    max-width: 800px;
    text-align: center;
    box-shadow: 0 5px 20px rgb(0 0 0 / 15%);
    position: relative;
}

.welcome-banner h2 {
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 600;
}

.welcome-banner p {
    font-size: 16px;
    margin-bottom: 25px;
    opacity: 0.95;
}

.quick-start {
    margin-bottom: 20px;
}

.quick-start h3 {
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: 500;
}

.quick-start-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgb(255 255 255 / 20%);
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    text-decoration: none;
    margin: 0 10px 10px 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgb(255 255 255 / 30%);
}

.quick-start-link:hover {
    background: rgb(255 255 255 / 30%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgb(0 0 0 / 20%);
}

.quick-start-link .emoji {
    font-size: 20px;
}

.dismiss-banner {
    background: rgb(255 255 255 / 90%);
    color: #4a9eff;
    border: none;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dismiss-banner:hover {
    background: white;
    box-shadow: 0 3px 10px rgb(0 0 0 / 20%);
}

/* Category styles */
.app-categories {
    width: 100%;
}

.category-title {
    font-size: 22px;
    font-weight: 600;
    color: #222;
    margin: 40px 0 20px;
    text-align: left;
    padding-left: 10px;
    border-left: 4px solid #4a9eff;
}

/* App status badges */
.app-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.app-status {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.app-status.live {
    background-color: #34c759;
    color: white;
}

.app-status.beta {
    background-color: #ff9500;
    color: white;
}

.app-status.coming-soon {
    background-color: #e0e0e0;
    color: #666;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .welcome-banner {
        padding: 20px;
        margin: 15px 10px 30px;
    }
    
    .welcome-banner h2 {
        font-size: 24px;
    }
    
    .welcome-banner p {
        font-size: 14px;
    }
    
    .quick-start-link {
        display: block;
        margin: 10px auto;
        max-width: 280px;
    }
    
    .category-title {
        font-size: 20px;
        margin: 30px 0 15px;
    }
}