/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Noto Sans JP', sans-serif;
    line-height: 1.6;
    color: #4a4a4a;
    background-color: #f7fdf5;
    overflow-x: hidden;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Card Base Style */
.card {
    background: #f7fdf5;
    border: 1px solid #e8f5e8;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 3px 12px rgba(34, 197, 94, 0.1);
    margin-bottom: 1.5rem;
}

/* Header Styles */
.main-header {
    background: #f7fdf5;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15);
    margin-bottom: 30px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #e8f5e8;
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.nav-brand .brand-link {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e67e22;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.nav-brand .brand-link img {
    height: 40px;
    width: auto;
    object-fit: contain;
    max-width: 200px;
}

/* Alternative logo display using background-image if img tag fails */
.nav-brand .brand-link.logo-bg {
    width: 120px;
    height: 40px;
    background-image: url('/minzero.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: inline-block;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #6b4423;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    transition: all 0.3s;
}

.nav-link:hover,
.nav-link.active {
    background: #dcfce7;
    color: #16a34a;
    transform: translateY(-1px);
}

.logout-button {
    background: none;
    border: none;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
}

/* Hero Section */
.hero-section {
    background: #16a34a;
    color: white;
    margin-bottom: 40px;
    padding: 50px 0;
    text-align: center;
    border-radius: 0 0 2rem 2rem;
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.3);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
    line-height: 1.2;
}

.hero-description {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 0;
}

/* Section Styles */
.content-section {
    margin-bottom: 3rem;
}

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

.section-title {
    margin: 0;
    font-size: 1.5rem;
    color: #8b4513;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.section-badge {
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    margin-right: 0.75rem;
    font-weight: 600;
}

.section-badge--red {
    background: #ef4444;
}

.section-badge--orange {
    background: #f59e0b;
}

.section-badge--green {
    background: #16a34a;
}

.section-title-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.section-link {
    color: #16a34a;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.3s;
}

.section-link:hover {
    color: #22c55e;
    transform: translateX(3px);
}

/* Articles Styles */
.articles-horizontal-scroll {
    overflow-x: auto;
    padding-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.articles-horizontal-scroll::-webkit-scrollbar {
    display: none;
}

.articles-container {
    display: flex;
    gap: 1.5rem;
    width: max-content;
    padding: 0 20px;
}

.article-card {
    width: 320px;
    flex-shrink: 0;
    background: #f7fdf5;
    border-radius: 1rem;
    box-shadow: 0 3px 12px rgba(34, 197, 94, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid #e8f5e8;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.2);
    border-color: #bbf7d0;
}

.article-badge {
    position: absolute;
    top: 0;
    left: 0;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 0 0 0.5rem 0;
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 10;
}

.article-badge--featured {
    background: #dc2626;
}

.article-image {
    height: 180px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 0.9rem;
    position: relative;
}

.article-category {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: #dcfce7;
    color: #16a34a;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.7rem;
    font-weight: 600;
}

.article-content {
    padding: 1.25rem;
}

.article-title {
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
    line-height: 1.4;
    font-weight: 600;
}

.article-link {
    text-decoration: none;
    color: #8b4513;
    transition: color 0.3s;
}

.article-link:hover {
    color: #16a34a;
}

.article-excerpt {
    color: #6b7280;
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: 0.9rem;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.article-meta-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.article-date {
    color: #9ca3af;
    font-size: 0.8rem;
}

.article-priority {
    background: #fef3c7;
    color: #d97706;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
}

.article-read-more {
    color: #16a34a;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s;
}

.article-read-more:hover {
    color: #22c55e;
    transform: translateX(3px);
}

.article-read-more--recommended {
    color: #f39c12;
    font-weight: 600;
}

/* Facility Search Styles */
.facility-search-section {
    margin-bottom: 3rem;
}

.search-form-container {
    background: #fff5ee;
    border: 2px solid #ffe4d1;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(255, 165, 79, 0.1);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-field {
    display: flex;
    flex-direction: column;
}

.form-label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

.form-input,
.form-select {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    transition: border-color 0.3s;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Facility Results */
.facility-results {
    margin-bottom: 2rem;
}

.results-title {
    margin-bottom: 1rem;
    color: #1f2937;
    font-size: 1.2rem;
}

.facility-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.facility-card {
    background: #f7fdf5;
    border-radius: 1rem;
    box-shadow: 0 3px 12px rgba(34, 197, 94, 0.1);
    border-left: 4px solid #16a34a;
    transition: all 0.3s ease;
    overflow: hidden;
    border: 1px solid #e8f5e8;
}

.facility-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.2);
    border-left-color: #22c55e;
}

.facility-content {
    padding: 1.25rem;
}

.facility-name {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: #1f2937;
    font-weight: 600;
}

.facility-link {
    text-decoration: none;
    color: inherit;
}

.facility-link:hover {
    color: #16a34a;
}

.facility-company {
    color: #6b7280;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.facility-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.facility-info-item strong {
    color: #374151;
}

.facility-price {
    background: #fff5ee;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    color: #e67e22;
    font-weight: 700;
    font-size: 1rem;
}

.facility-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem 2rem;
    color: #6b7280;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.no-results-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results-title {
    margin-bottom: 1rem;
    color: #374151;
}

.no-results-description {
    margin-bottom: 2rem;
}

.results-actions {
    text-align: center;
    margin-top: 2rem;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 1.5rem;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.btn-primary {
    background: #16a34a;
    color: white;
}

.btn-primary:hover {
    background: #15803d;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid #16a34a;
    color: #16a34a;
}

.btn-outline:hover {
    background: #16a34a;
    color: white;
    border-color: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

/* Footer Styles */
.main-footer {
    background: #8b4513;
    color: #fef7f0;
    margin-top: 50px;
    box-shadow: 0 -4px 15px rgba(139, 69, 19, 0.15);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    padding: 2rem 0;
}

.footer-brand {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-description {
    opacity: 0.9;
    line-height: 1.6;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: white;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #d1d5db;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #4b5563;
    padding: 1rem 0;
    text-align: center;
}

.copyright {
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Contents Index Grid - 3 columns on PC, 1 on mobile */
.contents-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.contents-grid .article-card {
    width: 320px;
    max-width: 320px;
    justify-self: center;
}


/* Contents Index Page Layout */
.contents-index-page {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.page-header h1 {
    margin: 0;
    font-size: 2rem;
    color: #8b4513;
    font-weight: 700;
}

.sort-section {
    margin-bottom: 1rem;
}

.categories-section {
    margin-bottom: 1rem;
}

.contents-main {
    flex: 1;
    min-height: 400px;
}

.contents-footer {
    margin-top: 1rem;
}

/* Sort Filter Styles */
.sort-filter {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.sort-btn {
    font-size: 0.9rem;
}

/* Categories Filter Styles */
.categories-filter {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.category-btn {
    font-size: 0.9rem;
}

/* No Results Styles */
.no-results-card {
    text-align: center;
    padding: 3rem;
    background: #f7fdf5;
    border: 1px solid #e8f5e8;
    border-radius: 1rem;
    box-shadow: 0 3px 12px rgba(34, 197, 94, 0.1);
}

.no-results-message {
    color: #15803d;
    font-size: 1.1rem;
    margin: 0;
}

/* Pagination Styles */
.pagination-wrapper {
    margin: 2rem 0;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination .page-link {
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    color: #374151;
    text-decoration: none;
    transition: all 0.3s;
    min-width: 40px;
    text-align: center;
    display: inline-block;
}

.pagination .page-link:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #374151;
}

.pagination .page-link.active {
    background: #16a34a;
    border-color: #16a34a;
    color: white;
}

.pagination .page-link.disabled {
    color: #9ca3af;
    cursor: not-allowed;
    background: #f9fafb;
}

.pagination .page-link.disabled:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #9ca3af;
}

/* Utilities */
.mobile-break {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .nav-menu {
        gap: 0.75rem;
        flex-wrap: wrap;
    }
    
    .nav-link {
        padding: 0.25rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .mobile-break {
        display: inline;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .facility-grid {
        grid-template-columns: 1fr;
    }
    
    .facility-info {
        grid-template-columns: 1fr;
    }
    
    .facility-actions {
        flex-direction: column;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Contents grid - single column on mobile */
    .contents-grid,
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .contents-grid .article-card {
        width: calc(100vw - 3rem);
        max-width: 320px;
        justify-self: center;
    }
    
    .article-card {
        width: calc(80vw - 1rem);
        max-width: 280px;
        min-width: 250px;
    }
    
    /* Pagination responsive styles */
    .pagination {
        gap: 0.25rem;
    }
    
    .pagination .page-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.9rem;
        min-width: 36px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .hero-section {
        padding: 30px 0;
    }
    
    .hero-title {
        font-size: 1.3rem;
    }
    
    .article-card {
        width: calc(85vw - 0.5rem);
        max-width: 260px;
        min-width: 220px;
    }
    
    .articles-container {
        gap: 1rem;
        padding: 0 15px;
    }
    
    /* Extra small pagination styles */
    .pagination .page-link {
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
        min-width: 32px;
    }
    
    /* Contents index page responsive */
    .page-header h1 {
        font-size: 1.4rem;
    }
    
    .contents-index-page {
        gap: 1.5rem;
    }
    
}