/* --- Global Styles & Resets --- */
:root {
    --color-primary: #0a4d68;
    --color-secondary: #088395;
    --color-accent: #f5b93d;
    --accent-coral: #ff7f50; /* A coral accent color */
    --color-background: #f9fbfd;
    --color-surface: #ffffff;
    --card-bg: #ffffff; /* Explicitly define card background */
    --color-text: #2c3e50;
    --text-light: #f8f9fa; /* Light text on dark backgrounds */
    --color-text-muted: #7f8c8d;
    --color-border: #eef2f5;
    --navy-dark: #2c3e50; /* For dark sections */
    --water-blue: #3498db; /* A nice blue for icons */
    --font-body: 'Inter', sans-serif;
    --font-heading: 'Poppins', sans-serif;
    --shadow-sm: 0 4px 10px rgba(10, 25, 47, 0.05);
    --shadow-md: 0 8px 25px rgba(10, 25, 47, 0.1);
    --border-radius: 12px;
}
*, *::before, *::after { box-sizing: border-box; }
body {
    font-family: var(--font-body);
    line-height: 1.7;
    background-color: var(--color-background);
    color: var(--color-text);
    margin: 0;
    overflow-x: hidden;
}
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
a { color: var(--color-secondary); text-decoration: none; }

/* --- [SHARED] Header --- */
.page-header {
    position: relative; padding: 60px 20px 120px; color: #fff; text-align: center;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    overflow: hidden;
}
.header-logo { display: inline-flex; align-items: center; gap: 15px; margin-bottom: 20px; }
.header-logo i { font-size: 2.5rem; }
.header-logo h1 { font-family: var(--font-heading); font-size: 2.5rem; margin: 0; }
.page-header p { font-size: 1.1rem; color: #a8b2d1; max-width: 600px; margin: 0 auto 30px; }
#wave-canvas { position: absolute; bottom: -1px; left: 0; width: 100%; height: 120px; z-index: 10; }

/* --- [INDEX PAGE] Search Form --- */
.search-container { position: relative; z-index: 20; }
.search-form { display: grid; grid-template-columns: 2fr 1fr auto; gap: 15px; max-width: 800px; margin: 0 auto; }
.search-input-wrapper, .prefecture-select-wrapper { position: relative; }
.search-icon { position: absolute; top: 50%; left: 20px; transform: translateY(-50%); color: #aaa; }
.search-bar, .prefecture-select {
    width: 100%; padding: 18px 20px 18px 50px; font-size: 1rem; border: 1px solid transparent;
    border-radius: 50px; background-color: rgba(255,255,255,0.95);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1); outline: none; transition: all .3s ease; appearance: none;
}
.search-button {
    background: var(--accent-coral); color: var(--card-bg); border: none; padding: 18px 35px;
    border-radius: 50px; font-weight: 700; font-size: 1rem; cursor: pointer; transition: all .3s ease;
}
.search-button:hover { background-color: #e66a40; transform: translateY(-2px); }

/* --- [INDEX PAGE] AI Recommendation Section --- */
.recommendation-section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 40px;
    margin-bottom: 60px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
}
.recommendation-header { text-align: center; margin-bottom: 30px; }
.recommendation-header i { font-size: 2.5rem; color: var(--color-accent); margin-bottom: 10px; }
.recommendation-header h2 { font-family: var(--font-heading); font-size: 2rem; margin: 0 0 10px 0; }
.recommendation-form .form-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 20px;
}
.recommendation-form .form-field { margin-bottom: 15px; }
.recommendation-form label { display: block; font-weight: 700; margin-bottom: 8px; font-size: 0.9rem; }
.recommendation-form input, .recommendation-form select, .recommendation-form textarea {
    width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 8px; font-size: 1rem; font-family: inherit;
}
.recommendation-form textarea { min-height: 80px; resize: vertical; }
.recommendation-button {
    display: flex; align-items: center; justify-content: center; width: 100%; background: var(--accent-coral);
    color: var(--card-bg); padding: 18px; border: none; border-radius: 8px; font-size: 1.2rem;
    font-weight: 700; cursor: pointer; transition: all .3s; margin-top: 20px; position: relative;
}
.recommendation-button:hover { background-color: #e66a40; }
.recommendation-button .spinner {
    display: none; width: 24px; height: 24px; border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff; border-radius: 50%; animation: spin 1s linear infinite;
}
.recommendation-button.loading .button-text { display: none; }
.recommendation-button.loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* AI Results Area */
.results-area { margin-top: 40px; }
.results-title { font-family: var(--font-heading); text-align: center; font-size: 1.8rem; margin-bottom: 30px; }
.recommendation-card {
    background: #fff; border: 1px solid var(--color-border); border-left: 5px solid var(--color-accent);
    border-radius: var(--border-radius); margin-bottom: 25px; padding: 25px; box-shadow: var(--shadow-sm);
}
.rec-card-header { margin-bottom: 15px; }
.rec-company { color: var(--color-text-muted); font-size: 0.9rem; }
.rec-title { margin: 5px 0 0 0; font-size: 1.4rem; }
.rec-title a { color: inherit; text-decoration: none; }
.rec-card-reason { background: #fffaf0; padding: 20px; border-radius: 8px; margin-bottom: 20px; }
.reason-title { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-weight: 700; color: #d9822b; }
.reason-title i { font-size: 1.2rem; }
.rec-card-reason p { margin: 0; }
.rec-card-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;}

/* --- [INDEX PAGE] Job List --- */
.list-header { display: flex; justify-content: space-between; align-items: baseline; margin: 60px 0 20px; }
.list-header h3 { margin: 0; }
.directory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 30px; }
.job-card {
    background-color: var(--card-bg); border-radius: var(--border-radius); box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column; overflow: hidden; position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
}
.job-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.card-accent-bar { height: 5px; background: linear-gradient(90deg, var(--color-secondary) 0%, var(--color-accent) 100%); width: 100%; }
.card-content { padding: 25px; display: flex; flex-direction: column; flex-grow: 1; }
.card-header-new { margin-bottom: 15px; }
.company-name-new { font-size: 0.9rem; color: var(--color-text-muted); margin: 0 0 5px 0; font-weight: 400; }
.job-title-new { font-size: 1.3rem; line-height: 1.4; margin: 0; }
.job-title-new a { color: var(--color-text); text-decoration: none; transition: color 0.3s; }
.job-title-new a:hover { color: var(--color-secondary); }
.card-body-new { flex-grow: 1; color: #555; margin-bottom: 20px; }
.job-excerpt { margin: 0; font-size: 0.95rem; line-height: 1.6; }
.card-footer-new { display: flex; justify-content: space-between; align-items: center; margin-top: auto; flex-wrap: wrap; gap: 10px; }
.card-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: #f0f4f8; color: var(--color-text-muted); padding: 5px 10px; border-radius: 5px; font-size: 0.85rem; display: inline-flex; align-items: center; gap: 5px; }
.card-cta {
    background-color: var(--color-secondary); color: #fff; padding: 8px 18px; border-radius: 50px;
    font-size: 0.9rem; font-weight: 700; text-decoration: none; transition: all 0.3s; white-space: nowrap;
}
.card-cta:hover { background-color: var(--color-primary); transform: scale(1.05); }

/* --- [DETAIL PAGE] Styles --- */
.detail-page-header { background: var(--card-bg); text-align: left; padding: 15px 0; border-bottom: 1px solid var(--color-border); }
.detail-page-header .header-logo { justify-content: flex-start; }
.detail-page-header .header-logo h1, .detail-page-header .header-logo i { color: var(--color-primary); font-size: 1.5rem; }
.job-title-header { text-align: center; padding: 60px 0 40px; }
.company-name-header { color: var(--color-text-muted); }
.detail-title { font-family: var(--font-heading); font-size: 2.8rem; line-height: 1.3; margin: 10px 0 0; }

/* "Honest Review" Section */
.recommendation-intro { text-align: center; margin-bottom: 50px; padding: 30px; }
.recommendation-intro h3 { font-family: var(--font-heading); font-size: 2rem; margin: 0 0 10px; color: var(--color-primary); }
.consultant-message { font-size: 1.1rem; color: var(--color-text-muted); max-width: 600px; margin: 0 auto; }
.recommendation-points { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; margin-bottom: 50px; }
.point-card {
    background: var(--card-bg); padding: 30px; border-radius: var(--border-radius); box-shadow: var(--shadow-sm);
    text-align: center; border-top: 6px solid; transition: transform 0.3s, box-shadow 0.3s;
}
.point-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-md); }
.point-card--interest { border-color: #3498db; }
.point-card--benefits { border-color: #2ecc71; }
.point-card--environment { border-color: #f1c40f; }
.point-icon {
    font-size: 2.5rem; width: 70px; height: 70px; margin: 0 auto 25px;
    border-radius: 50%; display: grid; place-items: center; box-shadow: 0 5px 15px rgba(0,0,0,0.1); color: #fff;
}
.point-card--interest .point-icon { background: #3498db; }
.point-card--benefits .point-icon { background: #2ecc71; }
.point-card--environment .point-icon { background: #f1c40f; }
.point-card h4 { font-family: var(--font-heading); font-size: 1.5rem; margin: 0 0 15px; }
.point-card h4 span { font-family: var(--font-body); font-size: 0.9rem; color: var(--color-text-muted); font-weight: 400; display: block; }
.recommendation-closing {
    text-align: center; background: var(--navy-dark); color: var(--text-light);
    padding: 40px; border-radius: var(--border-radius); margin: 60px 0;
}
.recommendation-closing h4 { font-family: var(--font-heading); font-size: 1.6rem; margin: 0 0 15px; color: var(--color-accent); }
.recommendation-closing .apply-button {
    display: inline-block; background: var(--accent-coral); color: var(--card-bg); padding: 15px 40px;
    border-radius: 50px; text-decoration: none; font-weight: 700; margin-top: 20px; transition: transform 0.2s, box-shadow 0.2s;
}
.recommendation-closing .apply-button:hover { transform: translateY(-3px); box-shadow: 0 5px 20px rgba(255,127,80,0.4); }

/* Spec Section */
.spec-section { background: var(--card-bg); border-radius: var(--border-radius); box-shadow: var(--shadow-sm); overflow: hidden; margin-top: 60px; }
.spec-title {
    font-family: var(--font-heading); font-size: 1.8rem; padding: 25px 30px; margin: 0;
    background: #f8f9fa; border-bottom: 1px solid var(--color-border); text-align: center;
}
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table th, .spec-table td { padding: 20px 30px; border-bottom: 1px solid var(--color-border); text-align: left; vertical-align: top; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: none; }
.spec-table th { background-color: #fcfdfe; width: 25%; font-weight: 700; }
.spec-table small { font-size: 0.9em; color: var(--color-text-muted); display: block; margin-top: 5px; }

/* Utility & Error/Empty states */
.error-box { background: #fff2f2; border: 1px solid #ffcccc; color: #a85252; padding: 20px; border-radius: 8px; }
.no-results { text-align: center; padding: 50px 20px; background: var(--color-surface); border: 1px dashed var(--color-border); border-radius: var(--border-radius); }
.no-results i { font-size: 3rem; color: var(--color-text-muted); margin-bottom: 20px; display: block; }
.site-footer { text-align: center; padding: 40px 20px; margin-top: 60px; background: #eef2f5; color: var(--color-text-muted); font-size: 0.9rem; }

/* --- ★★★ Responsive Design for Mobile ★★★ --- */
@media (max-width: 768px) {
    body {
        line-height: 1.6;
    }
    .container {
        padding: 0 15px;
    }
    .page-header {
        padding: 40px 15px 100px;
    }
    .header-logo i {
        font-size: 2rem;
    }
    .header-logo h1 {
        font-size: 1.8rem;
    }
    .page-header p {
        font-size: 1rem;
    }
    .search-form {
        grid-template-columns: 1fr;
    }
    .search-bar, .prefecture-select, .search-button {
        padding-top: 15px;
        padding-bottom: 15px;
        width: 100%;
        font-size: 1rem;
    }

    /* AI Recommendation Section on Mobile */
    .recommendation-section {
        padding: 25px 20px;
        margin-bottom: 40px;
    }
    .recommendation-header h2 {
        font-size: 1.6rem;
    }

    /* Job List on Mobile */
    .directory-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .list-header {
        margin-top: 40px;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    .card-content {
        padding: 20px;
    }
    .job-title-new {
        font-size: 1.2rem;
    }

    /* Detail Page on Mobile */
    .job-title-header {
        padding: 40px 0 30px;
    }
    .detail-title {
        font-size: 1.8rem;
    }
    .recommendation-intro {
        padding: 25px 20px;
    }
    .recommendation-intro h3 {
        font-size: 1.6rem;
    }
    .point-card {
        padding: 25px;
    }
    .point-card h4 {
        font-size: 1.3rem;
    }

    /* Responsive Spec Table - Vertical Layout */
    .spec-section {
        box-shadow: none;
        border: 1px solid var(--color-border);
        margin-top: 40px;
    }
    .spec-title {
        font-size: 1.5rem;
        padding: 20px;
    }
    .spec-table, .spec-table tbody, .spec-table tr, .spec-table th, .spec-table td {
        display: block;
        width: 100% !important;
        box-sizing: border-box;
    }
    .spec-table tr {
        padding: 20px;
        border-bottom: 1px solid var(--color-border);
    }
    .spec-table tr:last-child {
        border-bottom: none;
    }
    .spec-table th, .spec-table td {
        padding: 0;
        border: none;
        background: none;
        text-align: left;
    }
    .spec-table th {
        font-weight: 700;
        color: var(--color-text-muted);
        padding-bottom: 8px;
        font-size: 0.9rem;
    }
}
/* --- ★★★ Application Modal Styles ★★★ --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}
.modal-content {
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--color-border);
}
.modal-header h3 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.5rem;
}
.close-button {
    background: none;
    border: none;
    font-size: 2rem;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    color: var(--color-text-muted);
}
.modal-body {
    padding: 25px;
    overflow-y: auto;
}
.apply-job-title {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-size: 0.95rem;
    line-height: 1.5;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
}
.form-group label .required, .form-group label .optional {
    font-size: 0.8em;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: normal;
}
.form-group label .required {
    background: #fde2e2;
    color: #a85252;
}
.form-group label .optional {
    background: #eef2f5;
    color: var(--color-text-muted);
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}
.form-group input[type="file"] {
    padding: 8px;
}
.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}
.form-actions {
    text-align: center;
    margin-top: 30px;
}
.form-actions .apply-button {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
}

.form-messages {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    line-height: 1.6;
}
.form-messages.success {
    background-color: #e4f8f0;
    color: #2b7a5a;
}
.form-messages.error {
    background-color: #fde2e2;
    color: #a85252;
}
/* style.css の末尾に追加 */

/* --- Footer Admin Links --- */
.footer-admin-links {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #dcdfe2;
    font-size: 0.9rem;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}
.footer-admin-links a {
    background-color: #e9ecef;
    color: #495057;
    padding: 6px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s;
}
.footer-admin-links a:hover {
    background-color: #dee2e6;
}
/* --- MyPage Header Navigation --- */
.detail-page-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mypage-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap; /* 画面が狭い時に折り返すようにする */
    justify-content: flex-end;
}

.mypage-nav .nav-button {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    padding: 8px 15px;
    border: 1px solid var(--color-border);
    border-radius: 50px;
    transition: all 0.3s;
    background-color: #fff;
    white-space: nowrap; /* ボタン内のテキストが改行しないように */
}

.mypage-nav .nav-button:hover,
.mypage-nav .nav-button.active { /* 現在のページを示すスタイル（任意） */
    background-color: var(--color-secondary);
    border-color: var(--color-secondary);
    color: #fff;
    transform: translateY(-2px);
}

.mypage-nav .nav-button.logout {
    border-color: var(--accent-coral);
    color: var(--accent-coral);
    background-color: #fff;
}

.mypage-nav .nav-button.logout:hover {
    background-color: var(--accent-coral);
    color: #fff;
}

/* --- Responsive for MyPage Header --- */
@media (max-width: 768px) {
    .detail-page-header .container {
        flex-direction: column;
        gap: 15px;
    }
    .mypage-nav {
        justify-content: center;
    }
}
/* --- Profile Page Form Styles --- */

.profile-form .form-section {
    background: #fff;
    padding: 30px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
}

.profile-form .form-section h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 10px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--color-border);
}
.profile-form .section-description {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin-bottom: 30px;
}

.profile-form .form-row {
    display: flex;
    align-items: flex-start; /* ラベルと入力欄を上揃えに */
    margin-bottom: 25px;
}

.profile-form .form-row label {
    width: 30%; /* ラベルの幅を固定 */
    padding-top: 10px; /* 入力欄と高さを合わせる */
    font-weight: bold;
    color: #333;
}

.profile-form .form-control {
    width: 70%; /* 入力欄の幅 */
}

.profile-form input[type="text"],
.profile-form input[type="email"],
.profile-form input[type="password"],
.profile-form select,
.profile-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.profile-form input:focus,
.profile-form select:focus,
.profile-form textarea:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(8, 131, 149, 0.15);
}

.profile-form textarea {
    min-height: 100px;
    resize: vertical;
}

.form-divider-line {
    border: 0;
    height: 1px;
    background: #e0e0e0;
    margin: 40px 0;
}

/* --- Responsive for Profile Form --- */
@media (max-width: 768px) {
    .profile-form .form-row {
        flex-direction: column; /* スマートフォンでは縦に並べる */
        align-items: stretch;
    }
    .profile-form .form-row label {
        width: 100%;
        padding-top: 0;
        margin-bottom: 8px; /* ラベルと入力欄の間の余白 */
    }
    .profile-form .form-control {
        width: 100%;
    }
    .profile-form .form-section {
        padding: 20px;
    }
}
/* --- 共通の送信ボタンのスタイル --- */
.submit-btn {
    display: block;
    width: 100%;
    padding: 15px;
    background: var(--color-secondary); /* テーマカラー（青緑） */
    color: #fff; /* 白文字 */
    border: none;
    border-radius: 8px; /* 角を丸くする */
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: var(--shadow-sm);
}

.submit-btn:hover {
    background: var(--color-primary); /* ホバー時にもう少し濃い色に */
    transform: translateY(-2px); /* 少し浮き上がる効果 */
}

.submit-btn:disabled {
    background-color: #bdc3c7; /* 無効時の色 */
    cursor: not-allowed;
}
/* アップロードフォーム */
.document-upload-form .file-upload-area {
    border: 2px dashed #ccc;
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #fdfdfd;
    position: relative;
}
.document-upload-form .file-upload-area.drag-over {
    border-color: var(--color-secondary);
    background-color: #f0f8ff;
}
.document-upload-form .file-upload-area input[type="file"] {
    display: none; /* input自体は隠す */
}
.document-upload-form .upload-icon {
    font-size: 3rem;
    color: var(--color-secondary);
    margin-bottom: 15px;
}
.document-upload-form .upload-text {
    line-height: 1.5;
}

/* 登録済み書類一覧 */
.document-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.document-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background-color: #fff;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.document-card .doc-icon {
    font-size: 2rem;
    color: var(--color-text-muted);
}

.document-card .doc-info {
    flex-grow: 1; /* 残りのスペースをすべて使う */
}

.document-card .doc-info .doc-type-badge {
    display: inline-block;
    background-color: #eef2f5;
    color: var(--color-text-muted);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 8px;
}

.document-card .doc-info .doc-name {
    font-weight: bold;
    margin: 0;
}

.document-card .doc-info .doc-date {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.document-card .delete-button {
    background: transparent;
    border: none;
    color: #95a5a6;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: color 0.3s, background-color 0.3s;
}
.document-card .delete-button:hover {
    color: #e74c3c; /* 赤色 */
    background-color: #fde2e2;
}
/* --- Documents Page Action Buttons --- */
.document-card .doc-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto; /* 右寄せにする */
}

.document-card .action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: bold;
    border: 1px solid var(--color-border);
    transition: all 0.3s;
}
.document-card .action-btn .fas {
    font-size: 0.9em;
}

.document-card .action-btn.view-btn {
    background-color: #f0f4f8;
    color: var(--color-text-muted);
}
.document-card .action-btn.view-btn:hover {
    background-color: #e2e8f0;
}

.document-card .action-btn.analyze-btn {
    background-color: var(--color-secondary);
    color: #fff;
    border-color: var(--color-secondary);
}
.document-card .action-btn.analyze-btn:hover {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

@media (max-width: 480px) {
    .document-card .action-btn span {
        display: none; /* スマホではアイコンのみ表示 */
    }
    .document-card .action-btn {
        width: 40px;
        height: 40px;
        justify-content: center;
    }
}
/* --- AI Loading Animation Styles --- */

.ai-loading-container {
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    background: linear-gradient(145deg, #fdfefe, #f4f7f9);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.ai-loading-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--color-primary);
    margin-bottom: 20px;
}

.ai-loading-header .fa-robot {
    animation: pulse-robot 2s infinite;
}

@keyframes pulse-robot {
    0%, 100% {
        transform: scale(1);
        color: var(--color-secondary);
    }
    50% {
        transform: scale(1.1);
        color: var(--color-accent);
    }
}

.ai-loading-status-text {
    height: 2em;
    line-height: 2em;
    font-size: 1.1rem;
    color: #333;
    font-weight: 500;
}

.progress-bar-container {
    width: 100%;
    background-color: #e9ecef;
    border-radius: 8px;
    height: 12px;
    margin: 15px 0;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--color-secondary), var(--color-accent));
    border-radius: 8px;
    transition: width 0.5s ease-in-out;
}

.ai-loading-footer-text {
    font-size: 0.95rem;
    color: #555;
    margin-top: 20px;
}
/* --- AI Guide Modal - Logged-in Info --- */
.logged-in-email-info {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.5;
}
.logged-in-email-info strong {
    font-weight: bold;
}
.logged-in-email-info span {
    font-family: monospace; /* メールアドレスが見やすいように */
}
.logged-in-email-info small {
    display: block;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 5px;
}
/* --- Detail Page - AI Appeal Loading & Action Buttons --- */

/* AIアピール分析のローディングコンテナ（index.phpと共通）*/
.ai-loading-container {
    border-radius: 12px; padding: 30px; text-align: center;
    background: linear-gradient(145deg, #fdfefe, #f4f7f9);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05); overflow: hidden;
    border: 1px solid var(--color-border);
}
.ai-loading-header {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    font-size: 1.4rem; font-weight: bold; color: var(--color-primary); margin-bottom: 20px;
}
.ai-loading-header .fa-robot { animation: pulse-robot 2s infinite; }
@keyframes pulse-robot {
    0%, 100% { transform: scale(1); color: var(--color-secondary); }
    50% { transform: scale(1.1); color: var(--color-accent); }
}
.ai-loading-status-text { height: 2em; line-height: 2em; font-size: 1.1rem; color: #333; font-weight: 500; }
.progress-bar-container { width: 100%; background-color: #e9ecef; border-radius: 8px; height: 12px; margin: 15px 0; overflow: hidden; }
.progress-bar { width: 0%; height: 100%; background: linear-gradient(90deg, var(--color-secondary), var(--color-accent)); border-radius: 8px; transition: width 0.5s ease-in-out; }
.ai-loading-footer-text { font-size: 0.95rem; color: #555; margin-top: 20px; }


/* 応募アクションセクション */
.apply-action-section {
    background-color: #fff; border: 1px solid var(--color-border);
    border-radius: var(--border-radius); padding: 2rem; text-align: center; margin: 2.5rem 0;
}
.action-group { display: flex; justify-content: center; align-items: center; gap: 15px; flex-wrap: wrap; }


/* 「応募に進む」ボタン */
.apply-button {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    border: none; border-radius: 8px; padding: 0.875rem 2rem; font-size: 1rem;
    font-weight: bold; color: #ffffff; background-color: var(--color-secondary); cursor: pointer;
    text-decoration: none; text-align: center; box-shadow: 0 4px 6px rgba(8, 131, 149, 0.2);
    transition: all 0.3s ease;
}
.apply-button:hover { background-color: var(--color-primary); transform: translateY(-2px); box-shadow: 0 7px 10px rgba(8, 131, 149, 0.25); }


/* 「AI応募戦略を立てる」ボタン */
.generate-guide-button {
    background-color: #27ae60; border: none; color: white; padding: 14px 25px;
    font-size: 1rem; font-weight: bold; border-radius: 8px; cursor: pointer;
    transition: all 0.3s; display: inline-flex; align-items: center; gap: 10px;
}
.generate-guide-button:hover { background-color: #229954; transform: translateY(-2px); }


/* ボタンのスピナー（共通）*/
.apply-button .button-spinner,
.generate-guide-button .button-spinner {
    display: none; width: 20px; height: 20px; border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff; border-radius: 50%; animation: spin 1s linear infinite;
}
.apply-button.loading .button-spinner,
.generate-guide-button.loading .button-spinner { display: block; }

.apply-button.loading .button-text,
.generate-guide-button.loading .button-text { display: none; }

.apply-button:disabled,
.generate-guide-button:disabled { background-color: #bdc3c7; cursor: not-allowed; }

@keyframes spin { to { transform: rotate(360deg); } }
/* --- AI応募戦略ガイド生成モーダルのスタイル調整 --- */

#guide-modal .form-group.textarea-group {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

#guide-modal .form-group textarea {
    flex-grow: 1;
    min-height: 120px; /* テキストエリアの最小の高さを設定 */
    resize: vertical;   /* 垂直方向のリサイズを許可 */
}

/* フォーム全体の高さを確保するための調整 */
#guide-modal .modal-body {
    display: flex;
    flex-direction: column;
}

#guide-modal #guide-generation-form {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
/* --- AI Loading Animation Styles (追加) --- */

.ai-loading-header .fa-robot {
    animation: pulse-robot 2s infinite;
}

@keyframes pulse-robot {
    0%, 100% {
        transform: scale(1);
        color: var(--color-secondary);
    }
    50% {
        transform: scale(1.1);
        color: var(--color-accent);
    }
}
/* --- AI Loading Animation Styles --- */

.ai-loading-header .fa-robot {
    animation: pulse-robot 2s infinite;
}

@keyframes pulse-robot {
    0%, 100% {
        transform: scale(1);
        color: var(--color-secondary);
    }
    50% {
        transform: scale(1.1);
        color: var(--color-accent);
    }
}
/* --- MyPage Header Navigation (追記) --- */
.mypage-nav .notification-link {
    position: relative;
}
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--accent-coral);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

/* --- お知らせ一覧ページ --- */
.notification-list { list-style: none; padding: 0; }
.notification-item {
    background: #fff;
    border-left: 5px solid #ccc;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 0 8px 8px 0;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
}
.notification-item.unread {
    border-left-color: var(--color-secondary);
    background-color: #f8fbfd;
}
.notification-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; flex-wrap: wrap; gap: 10px; }
.notification-title { font-size: 1.2rem; font-weight: bold; margin: 0; }
.notification-date { font-size: 0.9rem; color: #777; white-space: nowrap;}
.notification-content { line-height: 1.7; color: #333; }
.no-notifications { text-align: center; padding: 40px; background: #fff; border-radius: 8px; }

/* style.css の末尾に追記 (以前の .chat-thread 関連のスタイルは削除してください) */

/* --- お知らせ詳細・チャット風UI (v2.0) --- */
.chat-thread {
    background-color: #eef2f5; /* 背景を少しグレーに */
    padding: 20px;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column; /* メッセージを縦に並べる */
    gap: 15px;
    height: 50vh; /* ビューポートの高さの50% */
    min-height: 400px;
    overflow-y: auto; /* スクロール可能にする */
    border: 1px solid var(--color-border);
}

.message-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

.message-card {
    padding: 12px 18px;
    border-radius: 18px;
    line-height: 1.6;
    box-shadow: var(--shadow-sm);
    width: fit-content; /* 内容に合わせて幅を調整 */
}
.message-card .message-content {
    margin: 0;
    white-space: pre-wrap;
}
.message-sender {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin: 0 8px 5px;
}
.message-date {
    font-size: 0.75rem;
    color: #333333;
    text-align: right;
    margin-top: 8px;
}

/* 自分が送信したメッセージ (右側・青) */
.message-sent {
    align-self: flex-end;
}
.message-sent .message-card {
    background-color: var(--color-secondary);
    color: #fff;
    border-top-right-radius: 4px;
}
.message-sent .message-sender {
    text-align: right;
}
/* 青い吹き出しの中のリンクを見やすくします */
.message-sent .message-card a {
    color: #ffffff; /* 文字色を強制的に白に */
    text-decoration: underline; /* 下線を追加してリンクだと分かるように */
    text-decoration-thickness: 1.5px;
}
.message-sent .message-card a:hover {
    text-decoration-color: #f5b93d; /* ホバー時に下線の色を変える（任意）*/
}
/* 相手から受信したメッセージ (左側・白) */
.message-received {
    align-self: flex-start;
}
.message-received .message-card {
    background-color: #fff;
    color: var(--color-text);
    border-top-left-radius: 4px;
}
.message-received .message-sender {
    text-align: left;
}

/* 返信フォームのUI */
.reply-form {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}
.reply-form textarea {
    flex-grow: 1;
    min-height: 50px;
    height: 50px;
    padding: 12px 20px;
    border-radius: 25px;
    border: 1px solid var(--color-border);
    resize: vertical;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s;
}
.reply-form textarea:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(8, 131, 149, 0.15);
}
.reply-form .submit-btn {
    flex-shrink: 0;
    width: auto;
    border-radius: 25px;
    font-size: 1rem;
    padding: 0 25px;
}

.notification-link-item { text-decoration: none; color: inherit; }
/* style.css の末尾に追記 */

/* --- お知らせ詳細・チャット風UI (v2.2 可読性向上版) --- */
.chat-thread {
    background-color: #eef2f5;
    padding: 20px;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 50vh;
    min-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--color-border);
}

.message-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

.message-card {
    padding: 12px 18px;
    border-radius: 18px;
    line-height: 1.6;
    box-shadow: var(--shadow-sm);
    overflow-wrap: break-word;
    word-break: break-word;
}
.message-card .message-content {
    margin: 0;
    white-space: pre-wrap;
}

.admin-message {
    background-color: #fff;
    border-top-left-radius: 0;
    align-self: flex-start;
}
.user-message {
    background-color: var(--color-secondary);
    color: #fff;
    border-top-right-radius: 0;
    align-self: flex-end;
}
.user-message .message-date {
    color: #eee;
}

/* --- 返信フォームのUI改善 --- */
.reply-form {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.reply-form textarea {
    flex-grow: 1; /* 残りのスペースをすべて使う */
    min-height: 50px;
    height: 50px;
    padding: 12px;
    border-radius: 25px; /* 角を丸くする */
    border: 1px solid #ccc;
    resize: vertical;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s;
}
.reply-form textarea:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(8, 131, 149, 0.15);
}
.reply-form .submit-btn {
    flex-shrink: 0; /* 縮まないようにする */
    width: auto;
    border-radius: 25px;
    font-size: 1rem;
    padding: 0 25px;
}

/* --- 管理者用 履歴ページ --- */
.chat-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    height: 60vh;
}
.user-list {
    width: 250px;
    flex-shrink: 0;
    background: #fff;
    border-radius: var(--border-radius);
    overflow-y: auto;
    box-shadow: var(--shadow-sm);
    padding: 10px;
}
.user-item {
    display: block;
    padding: 15px;
    text-decoration: none;
    color: var(--color-text);
    border-radius: 8px;
    margin-bottom: 5px;
    font-weight: bold;
    border: 1px solid transparent;
    position: relative;
}
.user-item:hover {
    background-color: #f8f9fa;
}
.user-item.active {
    background-color: var(--color-secondary);
    color: #fff;
    border-color: var(--color-primary);
}
.user-item .notification-badge {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
}
.chat-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}
.chat-area .no-selection {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: var(--color-text-muted);
    font-size: 1.2rem;
}
/* --- [追加] 気になる求人を持ち込んで分析するセクション --- */
.register-job-section .recommendation-header i {
    color: var(--color-secondary);
}

.register-type-selector {
    display: flex;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 30px;
}

.type-btn {
    flex: 1;
    padding: 15px 10px;
    font-size: 1rem;
    font-weight: bold;
    color: var(--color-text-muted);
    background-color: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: -2px; /* 親のborder-bottomと重なるように */
}

.type-btn:hover {
    color: var(--color-primary);
    background-color: #f8f9fa;
}

.type-btn.active {
    color: var(--color-secondary);
    border-bottom-color: var(--color-secondary);
}

.form-content-wrapper {
    min-height: 120px; /* タブ切り替え時の高さ変化を滑らかに */
}

.form-input-styled {
    width: 100%;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-input-styled:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(8, 131, 149, 0.15);
}

textarea.form-input-styled {
    resize: vertical;
}

/* ファイルアップロードエリア */
.file-upload-area-register {
    border: 2px dashed #ccc;
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #fdfdfd;
}
.file-upload-area-register.drag-over {
    border-color: var(--color-secondary);
    background-color: #f0f8ff;
}
.file-upload-area-register input[type="file"] {
    display: none;
}
.file-upload-area-register .upload-icon {
    font-size: 2.5rem; color: var(--color-secondary); margin-bottom: 10px;
}

/* カスタムチェックボックス */
#public-setting-field {
    border-top: 1px solid var(--color-border);
    padding-top: 25px;
    margin-top: 25px;
}
.custom-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
}
.custom-checkbox input[type="checkbox"] {
    display: none;
}
.custom-checkbox .checkbox-icon {
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 4px;
    margin-right: 12px;
    display: inline-block;
    position: relative;
    transition: all 0.3s;
}
.custom-checkbox input[type="checkbox"]:checked + .checkbox-icon {
    background-color: var(--color-secondary);
    border-color: var(--color-secondary);
}
.custom-checkbox input[type="checkbox"]:checked + .checkbox-icon::after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: #fff;
    font-size: 12px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.checkbox-note {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    display: block;
    margin-top: 8px;
    margin-left: 32px;
}

/* メッセージエリア */
#register-job-messages .message {
    padding: 15px; border-radius: 8px; text-align: left; line-height: 1.6;
}
#register-job-messages .message.success { background-color: #e4f8f0; border-left: 5px solid #2ecc71; color: #2b7a5a; }
#register-job-messages .message.error { background-color: #fde2e2; border-left: 5px solid #e74c3c; color: #a85252; }

/* style.css の末尾に追記 */

/* --- [追加] 求人登録フォームのローディング表示 --- */
#register-job-messages .loading-container {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--color-border);
}

#register-job-messages .loading-header {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--color-primary);
    margin-bottom: 15px;
}

#register-job-messages .progress-bar-container {
    width: 100%;
    background-color: #e9ecef;
    border-radius: 8px;
    height: 12px;
    margin: 10px 0;
    overflow: hidden;
}

#register-job-messages .progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--color-secondary), var(--color-accent));
    border-radius: 8px;
    transition: width 0.5s ease-in-out;
}