:root {
    --primary-color: #007bff;
    --secondary-color: #f8f9fa;
    --text-color: #333;
    --border-color: #dee2e6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: var(--secondary-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.main-header {
    text-align: center;
    /* REDUCED: Less vertical padding */
    padding: 0.75rem 1rem;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
}

/* NEW: Add these rules to control spacing inside the header */
.main-header h1 {
    margin-bottom: 0.25rem; /* Less space below the main title */
}
.main-header p {
    margin-top: 0; /* No space above the paragraph */
    margin-bottom: 0.5rem; /* Less space below the paragraph */
}


.support-links .btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 5px;
    /* REDUCED: Less vertical margin around the button */
    margin: 0.25rem 0.5rem;
    transition: background-color 0.3s;
}

.support-links .btn:hover {
    background-color: #0056b3;
}

.app-nav {
    /* We control all spacing from the h2 now, so we only need a bit of bottom padding */
    padding: 0 1rem 2rem 1rem;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
}

.app-nav h2 {
    text-align: center;
    /* REDUCED: Much less vertical space for a tighter look */
    margin-top: 1rem;
    margin-bottom: 1rem;
}

/* Grid container for the cards */
.app-nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0 auto;
    max-width: 1200px;
    display: grid;
    /* This creates a responsive grid that fits as many cards as possible */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

/* Individual card styling */
.app-card {
    /* Use the color variable from the JS */
    background-color: var(--card-color, #f8f9fa); 
    color: white;
    padding: 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: left;
}

/* Hover effect for the cards */
.app-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

/* Card title */
.app-card-title {
    margin: 0 0 10px 0;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Card description */
.app-card-description {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.9;
    line-height: 1.4;
}

.content-area {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Important for iframe */
    position: relative;
}

.welcome-message {
    font-size: 1.2rem;
    color: #6c757d;
}

#appFrame {
    border: none;
    width: 100%;
    height: 100%;
    display: none; /* Hidden by default */
}

.close-btn {
    position: fixed;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 28px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    z-index: 100;
    display: none; /* Hidden by default */
}

/* --- App Fullscreen Mode --- */

/* When the body has the 'app-is-open' class... */
body.app-is-open .main-header,
body.app-is-open .app-nav {
    display: none; /* Hide the header and nav */
}

body.app-is-open .content-area {
    position: fixed; /* Take it out of the normal flow */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99; /* Ensure it's on top */
}

body.app-is-open #appFrame {
    display: block; /* Make sure the iframe is visible */
}

body.app-is-open .close-btn {
    display: block; /* Show the close button */
}


/* --- CORRECTED SIGNUP FORM --- */
.pro-signup-form {
    max-width: 500px;
    margin: -1rem auto 2rem auto;
    text-align: center;
    padding: 1rem;
    background-color: #e9ecef;
    border-radius: 8px;
}

.pro-signup-form p {
    margin: 0 0 0.75rem 0;
    font-weight: 500;
    color: #333;
}

/* Mobile-First: Form group stacks vertically by default */
.form-group {
    display: flex;
    flex-direction: column; /* Stack vertically on small screens */
    gap: 10px;
}

/* Mobile-First: Input and button take full width */
.form-group input,
.form-group button {
    width: 100%;
    box-sizing: border-box; /* Ensures padding doesn't break the layout */
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group button {
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
    border: none; /* Your original code was missing this */
}

.form-group button:hover {
    background-color: #0056b3;
}

/* Media Query for larger screens (tablets and desktops) */
@media screen and (min-width: 600px) {
    .form-group {
        flex-direction: row; /* Switch to horizontal layout */
    }

    .form-group input {
        width: auto; /* Let the input grow */
        flex-grow: 1; /* Allow input to take available space */
    }

    .form-group button {
        width: auto; /* Let the button size itself based on content */
        padding: 0.75rem 1.5rem; /* Your original padding for desktop */
    }
}