/* === Modern Design CSS === */
:root {
    --primary-color: #007bff; /* Main color (blue) */
    --secondary-color: #6c757d; /* Secondary color (gray) */
    --light-gray: #f8f9fa; /* Light gray (backgrounds) */
    --dark-gray: #343a40; /* Dark gray (text) */
    --border-color: #dee2e6; /* Border color */
    --background-color: #ffffff; /* Base background color */
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.08); /* Card shadow */
    --button-hover-bg: #0056b3; /* Button hover background */
    --button-secondary-bg: #6c757d; /* Secondary button background */
    --button-secondary-hover-bg: #5a6268; /* Secondary button hover background */
    --font-family-base: 'Noto Sans JP', sans-serif; /* Base font */
    --warning-bg: #fffbec; /* Warning background color */
    --warning-border: #ffeeba;
    --warning-text: #856404;
    --warning-accent: #ffc107;
}

/* Box Sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-base);
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px;
    background-color: var(--light-gray);
    color: var(--dark-gray);
    line-height: 1.7;
}

h1 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 10px;
    font-weight: 700;
}
.subtitle {
    text-align: center;
    color: var(--secondary-color);
    font-size: 1em;
    margin-bottom: 30px;
    font-weight: 400;
}
h2 {
   color: var(--primary-color);
   margin-top: -2px; /* Spacing adjustment with element above */
   margin-bottom: 20px;
   padding-bottom: 10px;
   border-bottom: 2px solid var(--primary-color);
   font-weight: 700;
}
h3 {
     color: var(--dark-gray);
     margin-top: 30px;
     margin-bottom: 15px;
     font-weight: 700;
     padding-left: 10px;
     border-left: 4px solid var(--primary-color);
}

.container {
    background-color: var(--background-color);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 30px;
    margin-bottom: 30px; /* Bottom margin between containers */
}

/* Upload Area */
.upload-section {
    text-align: center;
    margin-bottom: 20px;
    padding: 40px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    background-color: #fdfdff; /* Slightly lighter background */
    transition: border-color 0.3s ease, background-color 0.3s ease;
}
.upload-section p {
    color: var(--secondary-color);
    margin-bottom: 20px;
}
.upload-section:hover {
    border-color: var(--primary-color);
    background-color: #f0f8ff; /* Background color change on hover */
}

#fileInput {
    display: none;
}

/* Common Button Styles */
.button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    margin: 10px 5px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.1s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-decoration: none; /* Remove underline for anchor tags */
    display: inline-block; /* Ensure padding works for anchor tags */
    text-align: center; /* Center button text */
}
.button:hover {
    background-color: var(--button-hover-bg);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
    color: white; /* Maintain text color on hover */
    text-decoration: none; /* No underline on hover */
}
.button:active {
    transform: translateY(0px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
/* Secondary Button Style */
.button-secondary {
    background-color: var(--button-secondary-bg);
    font-size: 14px; /* Slightly smaller */
    padding: 10px 20px;
}
.button-secondary:hover {
    background-color: var(--button-secondary-hover-bg);
}

/* Important Links Area */
.important-links {
    text-align: center;
    margin-top: 20px; /* Space from preview area */
    padding-top: 20px; /* Border substitute for separation */
    border-top: 1px solid var(--border-color); /* Separator line */
}

/* Filter Buttons */
.filters {
    display: grid; /* Grid layout */
    grid-template-columns: repeat(3, 1fr); /* Default 3 columns */
    gap: 12px;
    margin: 30px 0;
}
.filter-button {
    padding: 10px 18px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    background-color: var(--background-color);
    color: var(--secondary-color);
    font-weight: 700;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    text-align: center; /* Center button text */
    width: 100%; /* Full width as grid item */
    font-size: 15px; /* Font size fine-tuning */
}
.filter-button:hover {
    background-color: #e9ecef;
    border-color: var(--secondary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.filter-button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.3);
}

/* Image Display Area */
.images-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Responsive grid */
    gap: 25px;
    margin-top: 30px;
}
.image-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden; /* Prevent image overflow */
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: var(--background-color);
}
.image-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
.image-card img {
    width: 100%;
    height: auto; /* Maintain aspect ratio */
    display: block;
    border-bottom: 1px solid var(--border-color);
}
.image-title {
    padding: 12px 15px;
    text-align: center;
    background-color: #f8f9fa; /* Title background */
    font-size: 15px;
    font-weight: 700;
    color: var(--dark-gray);
}

/* Information Section Common Styles */
.info-section, .additional-content, .technical-info, .disclaimer, .references {
    font-size: 15px;
    line-height: 1.8;
}
.info-section ul, .additional-content ul, .technical-info ul, .references ul {
    padding-left: 25px;
    margin-top: 10px;
}
  .info-section li, .additional-content li, .technical-info li, .references li {
      margin-bottom: 8px;
 }
.info-section strong, .additional-content strong, .technical-info strong {
    color: var(--primary-color);
    font-weight: 700;
}

/* Technical Background & Disclaimer */
.technical-info, .disclaimer {
    background-color: var(--warning-bg);
    border: 1px solid var(--warning-border);
    border-left: 5px solid var(--warning-accent); /* Left accent line */
    padding: 25px;
    border-radius: 8px;
    font-size: 14px;
}
  .technical-info h3, .disclaimer h3 {
      color: var(--warning-text);
      margin-top: 0;
      border-left: none; /* Remove left line */
      padding-left: 0;
 }
  .technical-info strong, .disclaimer strong {
      color: var(--warning-text);
      font-weight: 700;
 }
  .technical-info li ul { margin-top: 5px; margin-bottom: 10px; }
  .technical-info li ul li { font-size: 0.95em; }

/* Link Styles */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease, text-decoration 0.3s ease;
}
a:hover {
    color: var(--button-hover-bg);
    text-decoration: underline;
}
/* Override default link styles within buttons */
.button a, .button a:hover {
    color: white;
    text-decoration: none;
}
.button-secondary a, .button-secondary a:hover {
    color: white;
    text-decoration: none;
}

/* Initial Message */
.no-image {
    text-align: center;
    padding: 50px 20px;
    color: var(--secondary-color);
    grid-column: 1 / -1; /* Span full grid */
    font-size: 16px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

/* Footer Styles */
footer.site-footer {
    text-align: center;
    margin-top: 50px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--secondary-color);
}
.copyright {
    margin-bottom: 15px;
    font-size: 0.9em;
}
.footer-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-nav li {
    display: inline-block;
    margin: 0 10px;
}
.footer-nav a {
    font-size: 0.95em;
    color: var(--secondary-color);
    text-decoration: none;
}
.footer-nav a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 20px 15px;
    }
    h1 {
        font-size: 1.7em;
    }
    .subtitle {
        font-size: 0.9em;
        margin-bottom: 25px;
    }
    .container {
        padding: 20px;
        margin-bottom: 25px;
    }
    .images-container {
        grid-template-columns: 1fr; /* Single column */
        gap: 20px;
    }
    .filters {
        grid-template-columns: repeat(2, 1fr); /* 2 columns below 768px */
        gap: 8px;
    }
    .filter-button {
        padding: 8px 12px;
        font-size: 14px;
    }
    .button {
        padding: 10px 20px;
        font-size: 15px;
    }
    /* Mobile important links adjustment */
    .important-links .button {
        display: block; /* Stack vertically */
        width: 100%;    /* Full width */
        margin: 8px 0;  /* Vertical margin only */
    }
    .technical-info, .disclaimer {
        padding: 20px;
    }
    .footer-nav li {
         margin: 0 7px;
    }
}
@media (max-width: 480px) {
    /* Smaller screen footer menu adjustment */
    .footer-nav li {
         display: block; /* Stack vertically */
         margin: 8px 0; /* Vertical margin */
    }
    .filters {
        grid-template-columns: 1fr; /* Single column below 480px */
    }
    .filter-button {
        font-size: 13px; /* Further adjustment for smaller screens */
        padding: 8px 10px;
    }
}
