/* ========================================
   Engineering Website - Main Stylesheet
   ======================================== */

/* CSS Variables */
:root {
    --primary-blue: #1e5f8a;
    --primary-blue-dark: #154463;
    --primary-blue-light: #2d7eb4;
    --secondary-gray: #4a5568;
    --secondary-gray-light: #718096;
    --accent-orange: #e67e22;
    --accent-orange-dark: #d35400;
    --accent-orange-light: #f39c12;
    --bg-light: #f7fafc;
    --bg-white: #ffffff;
    --text-dark: #1a202c;
    --text-medium: #2d3748;
    --text-light: #718096;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', Meiryo, sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-medium);
    background-color: var(--bg-light);
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-blue-light);
}

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

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: var(--bg-white);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bg-white);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-menu a {
    color: rgba(255,255,255,0.9);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: rgba(255,255,255,0.2);
    color: var(--bg-white);
}

/* Mobile Menu */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--bg-white);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: var(--bg-white);
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: var(--accent-orange);
    color: var(--bg-white);
}

.btn-primary:hover {
    background: var(--accent-orange-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: rgba(255,255,255,0.2);
    color: var(--bg-white);
    border: 2px solid rgba(255,255,255,0.5);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.3);
}

.btn-blue {
    background: var(--primary-blue);
    color: var(--bg-white);
}

.btn-blue:hover {
    background: var(--primary-blue-dark);
}

/* Section Styles */
.section {
    padding: 4rem 0;
}

.section-alt {
    background: var(--bg-white);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Card Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-blue-light);
}

.card-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-light) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.card h3 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.card p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.card-link {
    color: var(--primary-blue);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Tool Cards */
.tool-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-orange);
}

.tool-card-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-orange-light) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.tool-card h3 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.tool-card p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    justify-content: center;
}

.category-tab {
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-md);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    color: var(--text-medium);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.category-tab:hover,
.category-tab.active {
    background: var(--primary-blue);
    color: var(--bg-white);
    border-color: var(--primary-blue);
}

/* Tool Page Styles */
.tool-container {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.tool-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.tool-header h1 {
    color: var(--text-dark);
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.tool-header p {
    color: var(--text-light);
}

.tool-form {
    display: grid;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: var(--text-dark);
    font-weight: 600;
}

.form-group input,
.form-group select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(30, 95, 138, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.result-box {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
}

.result-box h3 {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.result-box .result-value {
    font-size: 2rem;
    font-weight: 700;
}

.result-box .result-unit {
    font-size: 1rem;
    opacity: 0.8;
}

/* Article Cards */
.article-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--secondary-gray) 0%, var(--secondary-gray-light) 100%);
}

.article-content {
    padding: 1.5rem;
}

.article-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.article-category {
    background: var(--primary-blue);
    color: var(--bg-white);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.article-content h3 {
    color: var(--text-dark);
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.article-content p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

/* Article Page */
.article-page {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 3rem;
    box-shadow: var(--shadow-md);
}

.article-page h1 {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.article-page .article-hero-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.article-page .article-body {
    font-size: 1.1rem;
    line-height: 2;
    color: var(--text-medium);
}

.article-page .article-body h2 {
    color: var(--text-dark);
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.article-page .article-body h3 {
    color: var(--text-dark);
    font-size: 1.25rem;
    margin: 1.5rem 0 1rem;
}

.article-page .article-body p {
    margin-bottom: 1.5rem;
}

.article-page .article-body ul,
.article-page .article-body ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.article-page .article-body li {
    margin-bottom: 0.5rem;
}

.article-page .article-body img {
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
}

/* Footer */
.footer {
    background: var(--text-dark);
    color: rgba(255,255,255,0.8);
    padding: 3rem 0 1.5rem;
}

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

.footer-section h4 {
    color: var(--bg-white);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

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

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

.footer-section a {
    color: rgba(255,255,255,0.7);
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--accent-orange);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
}

/* Contact Form */
.contact-form {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.contact-form .form-group textarea {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    min-height: 150px;
    resize: vertical;
    font-family: inherit;
}

.contact-form .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(30, 95, 138, 0.1);
}

/* Page Headers */
.page-header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: var(--bg-white);
    padding: 3rem 0;
    text-align: center;
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    opacity: 0.9;
}

/* 404 Page */
.error-page {
    text-align: center;
    padding: 4rem 0;
}

.error-code {
    font-size: 8rem;
    font-weight: 700;
    color: var(--primary-blue);
    line-height: 1;
}

.error-page h1 {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.error-page p {
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* Search Box */
.search-box {
    max-width: 600px;
    margin: 0 auto 2rem;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 1rem 1.5rem;
    padding-left: 3rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-md);
}

.search-box::before {
    content: "🔍";
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
}

/* Stats Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    text-align: center;
}

.stat-item {
    padding: 1.5rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-orange);
}

.stat-label {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Features List */
.features-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.feature-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.feature-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-white);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.feature-content h4 {
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.feature-content p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--primary-blue);
    color: var(--bg-white);
    font-weight: 600;
}

.data-table tr:hover {
    background: var(--bg-light);
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.breadcrumb a {
    color: var(--primary-blue);
}

.breadcrumb span {
    opacity: 0.5;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    color: var(--text-medium);
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: var(--primary-blue);
    color: var(--bg-white);
    border-color: var(--primary-blue);
}

.pagination .active {
    background: var(--primary-blue);
    color: var(--bg-white);
    border-color: var(--primary-blue);
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        text-align: center;
    }

    .nav-menu.active {
        display: flex;
    }

    .menu-toggle {
        display: block;
        position: absolute;
        right: 1rem;
        top: 1rem;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .article-page {
        padding: 1.5rem;
    }

    .article-page .article-hero-image {
        height: 250px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .error-code {
        font-size: 5rem;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
