/* --- Global Styles & Background --- */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #e0e0e0;
    line-height: 1.6;
}

a {
    color: #58a6ff;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #ffffff;
}

/* --- Main Container (Glassmorphism) --- */
.container {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- Header & Typography --- */
.logo {
    display: block;
    max-width: 300px;
    height: auto;
    margin: 0 auto 20px auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.subtitle {
    text-align: center;
    opacity: 0.9;
    margin-bottom: 40px;
    font-size: 1.1em;
}

/* --- Navigation Menu --- */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    list-style: none;
    padding: 0;
    margin-bottom: 40px;
}

.main-nav a {
    color: #e0e0e0;
    text-decoration: none;
    font-size: 1.1em;
    padding: 8px 15px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.main-nav a:hover, .main-nav a.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* --- Homepage Grid Styles --- */
.page-grid {
    display: grid;
    margin-bottom: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
    align-items: stretch;
}

/* --- NEW: Project Group Card (Table-Style) --- */
/* This is the main container for a group of related apps/versions. */

.project-group-card {
    /* Uses the same styling as your content sections for consistency */
    background: rgba(0, 0, 0, 0);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* This makes it span the full width of the grid */
    grid-column: 1 / -1; 
    display: flex;
    flex-direction: column;
    gap: 15px;
    
    /* --- ADDED FOR SPACING --- */
    margin-top: 20px;
    margin-bottom: 20px;
}

.project-group-card h3 {
    margin: 0;
    padding-bottom: 15px;
    font-size: 1.5em;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* This is the list that holds each app row */
.project-group-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 5px; /* Small gap between rows */
}

/* This is a single row in the list (one app version) */
.project-group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.project-group-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* The text description for the app version */
.item-description {
    flex-grow: 1; /* Allows the description to take up available space */
    padding-right: 20px;
    opacity: 0.9;
}

/* Container for the action links (Launch, Docs, etc.) */
.item-links {
    display: flex;
    gap: 15px;
    flex-shrink: 0; /* Prevents links from wrapping on small screens */
}

/* Styling for the individual links */
.item-links a {
    font-size: 0.9em;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e0e0e0;
    transition: all 0.2s ease;
}

.item-links a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

/* Special style for the primary action link */
.item-links a.launch {
    color: #1a1a2e;
    background-color: #58a6ff;
    border-color: #58a6ff;
}

.item-links a.launch:hover {
    background-color: #ffffff;
    border-color: #ffffff;
}

/* --- ALTERNATE APP CARD (for single apps with multiple links) --- */
.app-card {
    /* This card inherits styles from the base .card class */
    text-align: left;
    justify-content: space-between; /* Pushes link footer down */
}

.app-card-content {
    padding: 25px;
    flex-grow: 1;
}

.app-card-links {
    padding: 15px 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2); /* Slightly darker footer */
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.app-card-links a {
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s ease;
}

.app-card-links a.primary-link {
    background-color: #58a6ff;
    color: #1a1a2e; /* Dark text for contrast */
}

.app-card-links a.primary-link:hover {
    background-color: #ffffff;
    color: #1a1a2e;
}

.app-card-links a.secondary-link {
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.app-card-links a.secondary-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

/* --- NEW: Integrated Link Buttons for Page Cards --- */
.page-card-links {
    display: flex;
    justify-content: right; /* Center the buttons */
    gap: 10px; /* Space between buttons */
    margin-top: 15px; /* Space above the buttons */
    flex-wrap: wrap; /* Allow buttons to wrap on small screens */
}

.page-card-links a {
    font-size: 0.9em;
    font-weight: 500;
    padding: 6px 15px;
    border-radius: 20px; /* Pill shape */
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    text-decoration: none;
    transition: all 0.3s ease;
}

.page-card-links a:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
    transform: translateY(-2px);
}

.page-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    
    padding: 25px;
    text-decoration: none;
    color: #e0e0e0;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.page-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.page-card:hover::before {
    left: 100%;
}

.page-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #e0e0e0; /* Ensure text color doesn't change on hover */
}

.page-title {
    font-size: 1.3em;
    font-weight: 350;
    margin-bottom: 10px;
}

.page-description {
    opacity: 0.9;
        flex-grow: 1; /* This is the magic line */
    margin-bottom: 1rem;
}

/* --- Homepage Info Box & Links --- */
.add-pages {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    padding: 25px;
    margin-top: 30px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
}

.add-pages h3 {
    font-weight: 350;
    font-size: 1.5em;
}

.github-link {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    text-decoration: none;
    color: #e0e0e0;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.github-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    color: white;
}

/* --- Styles for Content Pages (About, Papers, Videos) --- */
.content-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    padding: 30px;
    margin-top: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Apply font-weight: 350 to all headings within .content-section */
.content-section h1,
.content-section h2,
.content-section h3 {
    font-weight: 350; /* Apply the desired font-weight */
    margin-top: 0; /* Ensure consistent top margin */
    padding-bottom: 10px; /* Consistent padding */
    border-bottom: 1px solid rgba(255, 255, 255, 0.2); /* Consistent border */
}

/* You can adjust font sizes individually if needed */
.content-section h1 {
    font-size: 2.2em; /* Example size for H1 */
}

.content-section h2 {
    font-size: 1.8em; /* Your existing size for H2 */
}

.content-section h3 {
    font-size: 1.5em; /* Example size for H3 */
}


.paper-entry {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.paper-entry:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.paper-entry h3 {
    color: #fff;
    font-size: 1.2em;
    margin-bottom: 5px;
}

/* --- Responsive Video Embedding --- */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    margin-bottom: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
