/* Overhauled Help Modal Styles */

/* Modal Card Structure */
#helpModal .modal-card {
    width: 95%;
    max-width: 800px; /* Wider for 2-column grid */
    max-height: 85dvh; /* Taller but with room for margins - dvh handles mobile better */
    height: auto; /* Allow auto height for small content, but max-height constrains */
    display: flex;
    flex-direction: column;
    padding: 0; /* Remove default padding to control header/footer/body separately */
    overflow: hidden; /* Ensure rounded corners clip content */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); /* Stronger shadow for depth */
    background: #1e293b; /* Solid background for better readability over content */
}

/* Header */
.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.6); /* Slightly darker header */
    flex-shrink: 0; /* Prevent header from shrinking */
}

.modal-header h3 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.25rem;
}

/* Body (Scrollable) */
.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1 1 auto; /* Takes up remaining space, shrinks if needed */
    min-height: 0; /* Important for flex child scrolling */
}

/* Custom Scrollbar */
.modal-body::-webkit-scrollbar {
    width: 8px;
}
.modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
.modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
.modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Footer */
.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0; /* Prevent footer from shrinking */
}

/* Section Styling */
.help-section {
    margin-bottom: 2rem;
}

.help-section h4 {
    color: var(--primary-neon);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.help-section p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* Function Grid */
.function-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

/* Function Card */
.function-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 1rem;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.function-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.func-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.func-name {
    font-family: var(--font-code);
    color: var(--secondary-neon); /* Cyan */
    font-weight: 600;
    font-size: 0.95rem;
}

.func-type {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-weight: 500;
}

.func-desc {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Tip Box */
.tip-box {
    background: rgba(139, 92, 246, 0.1); /* Purple tint */
    border-left: 3px solid var(--accent-purple);
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.9rem;
    color: var(--text-main);
}

.tip-box code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-code);
    color: var(--secondary-neon);
}
