/* 
   Simple and Clean Design System
   Color Palette: White, Light Gray, Soft Blue
*/

:root {
    --bg-color: #f8fafb;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    --primary-color: #01894d;
    /* Brand Green */
    --primary-hover: #00703e;
    --brand-green: #01894d;
    --brand-orange: #f39800;
    --accent-color: #f0fdf4;
    /* Light Green */
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s ease;
    --radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    /* Removed flex centering to fix excessive top whitespace */
}

/* Header Design (brand Style) */
.main-header {
    background-color: var(--brand-green);
    border-bottom: 2px solid var(--brand-orange);
    padding: 15px 0;
    color: #ffffff;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
}

.main-header-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.title-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.brand-logo {
    font-weight: 800;
    font-size: 1.3rem;
    color: #ffffff;
    margin-bottom: 0;
}

.subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    margin-left: 10px;
}

.container {
    max-width: 1000px;
    width: 100%;
    padding: 1rem 24px;
    /* Reduced from 2rem */
    text-align: center;
    margin: 70px auto 0;
    /* Fixed top margin for header clearance, auto horizontal */
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 3rem;
    text-align: left;
}

.category-section {
    margin-bottom: 2rem;
    text-align: left;
}

.category-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-green);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent-color);
}

.category-title svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}


.app-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    color: inherit;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.app-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    background-color: var(--accent-color);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.card-link-wrapper {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    flex-grow: 1;
    gap: 12px;
}

.icon-box-small {
    width: 40px;
    height: 40px;
    background-color: var(--accent-color);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.app-card:hover .icon-box-small {
    background-color: var(--brand-orange);
    transform: scale(1.05);
}

.app-card:hover .icon-box-small span {
    filter: brightness(0) invert(1);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.help-toggle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background-color: #fff;
    color: var(--text-muted);
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
    flex-shrink: 0;
    margin-left: 10px;
}

.help-toggle:hover {
    background-color: var(--brand-green);
    color: #fff;
    border-color: var(--brand-green);
}

/* Header Link */
.header-nav {
    display: flex;
    align-items: center;
}

.header-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    transition: var(--transition);
}

.header-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    background: #fff;
    width: 90%;
    max-width: 500px;
    padding: 30px;
    border-radius: 16px;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1010;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--brand-green);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--brand-orange);
}

.modal-body {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-main);
}

/* Info Section (Site Description) */
.info-section {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0;
    margin-bottom: 32px;
    /* Space before app grid */
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    text-align: left;
    /* Reset center alignment from container */
}

.info-header {
    width: 100%;
    padding: 15px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background-color: #f8fafb;
    border: none;
    /* Reset button style */
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
    outline: none;
}

.info-header:hover {
    background-color: #f1f3f5;
}

.info-header h2 {
    font-size: 1.1rem;
    color: var(--brand-green);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.toggle-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s;
    fill: #666;
}

.info-content {
    padding: 24px;
    border-top: 1px solid var(--border-color);
    display: block;
}

.info-content p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.info-content p:last-child {
    margin-bottom: 0;
}

.disclaimer {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
}

/* Collapsed state */
.info-section.collapsed .info-content {
    display: none;
}

.info-section.collapsed .toggle-icon {
    transform: rotate(-180deg);
}

.info-section.collapsed .info-header {
    border-bottom-color: transparent;
}

/* Utility to hide description source elements */
[hidden] {
    display: none !important;
}

@media (max-width: 640px) {
    h1 {
        font-size: 1.5rem;
        /* Adjusted for mobile */
    }

    .container {
        padding: 1rem;
    }

    .app-grid {
        grid-template-columns: 1fr;
    }

    .main-header-inner {
        padding: 0 15px;
    }
}