/* --- Base Styles --- */
:root {
    --primary-color: #0052cc;
    --primary-hover: #0041a3;
    --bg-color: #f4f7f9;
    --card-bg: #ffffff;
    --text-color: #333;
    --muted-color: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
}

body {
    overflow-y: auto;
    background-color: var(--bg-color);
    font-family: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
}

#background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* --- Home Page Styles --- */
.top-page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding-bottom: 60px;
}

.top-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 70vh;
    padding: 40px 20px;
    width: 90%;
    max-width: 500px;
    margin: 0 auto;
}

.logo {
    max-width: 300px;
    width: 100%;
    height: auto;
    padding: 20px;
}

/* トップページ：お問い合わせ導線（ロゴと世界観を統一） */
.top-cta {
    display: inline-block;
    margin-top: 24px;
    padding: 14px 32px;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.top-cta:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

.top-cta:active {
    transform: translateY(0);
}

/* トップページ：会社概要（簡素・スタイリッシュ） */
.company-overview {
    max-width: 520px;
    margin: 0 auto;
    padding: 48px 40px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    border-radius: 12px;
    box-shadow: 0 2px 24px rgba(0, 0, 0, 0.06);
}

.company-overview-title {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--muted-color);
    margin-bottom: 32px;
    text-align: left;
}

.company-overview-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.company-overview-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 24px;
    align-items: baseline;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.company-overview-row:last-child {
    border-bottom: none;
}

.company-overview-list dt {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--muted-color);
    margin: 0;
}

.company-overview-list dd {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-color);
    margin: 0;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .top-cta {
        margin-top: 20px;
        padding: 12px 24px;
        font-size: 0.95rem;
    }
    .top-hero {
        min-height: 60vh;
    }
    .company-overview {
        margin: 0 20px;
        padding: 36px 24px;
    }
    .company-overview-row {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 14px 0;
    }
    .company-overview-list dt {
        font-size: 0.75rem;
    }
    .company-overview-list dd {
        font-size: 0.9rem;
    }
}

/* --- Prompt Generator Styles --- */
.prompt-generator-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
    flex-grow: 1;
}

.prompt-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    color: white;
    position: relative;
    overflow: hidden;
}

.prompt-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.3; }
}

.prompt-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.prompt-header p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.15rem;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

.back-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.back-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* カテゴリタブ */
.category-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    justify-content: center;
}

.category-tab {
    padding: 12px 24px;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.category-tab:hover::before {
    left: 100%;
}

.category-tab:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 82, 204, 0.2);
}

.category-tab.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 82, 204, 0.3);
}

.category-section {
    margin-bottom: 30px;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.category-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #172B4D;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-title .icon {
    font-size: 1.3rem;
}

.prompt-wrapper {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.prompt-wrapper:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* 検索セクション */
.search-section {
    margin-bottom: 25px;
}

.search-container {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.search-input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 82, 204, 0.1);
}

.prompt-info {
    font-size: 0.9rem;
    color: var(--muted-color);
    padding: 10px 0;
}

/* 進捗バー */
.progress-section {
    margin-bottom: 25px;
}

.progress-bar-container {
    margin-top: 10px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
}

.progress-bar {
    width: 100%;
    height: 10px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

/* クリアボタン */
.clear-button {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--muted-color);
    transition: all 0.2s ease;
}

.clear-button:hover {
    background: #f8f9fa;
    border-color: #dc3545;
    color: #dc3545;
}

/* 文字数カウント */
.char-count {
    font-size: 0.9rem;
    color: var(--muted-color);
    font-weight: 500;
}

.prompt-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
}

.input-group {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.input-group label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 6px;
}

.input-group label::before {
    content: '•';
    color: var(--primary-color);
    font-size: 1.2rem;
}

.input-group input,
.input-group textarea,
#prompt-selector {
    padding: 14px 18px;
    border: 2px solid #ced4da;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
    font-family: inherit;
    background: white;
}

.input-group input:focus,
.input-group textarea:focus,
#prompt-selector:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 82, 204, 0.1);
    transform: translateY(-1px);
}

.input-group textarea {
    resize: vertical;
    min-height: 100px;
}

#prompt-selector {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

.result-wrapper {
    position: relative;
}

.generated-prompt-content {
    width: 100%;
    min-height: 300px;
    max-height: 600px;
    padding: 24px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 0.95em;
    line-height: 1.8;
    white-space: pre-wrap;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #e9ecef;
}

.generated-prompt-content::-webkit-scrollbar {
    width: 8px;
}

.generated-prompt-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.generated-prompt-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.generated-prompt-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

#generated-prompt strong {
    color: var(--primary-color);
    font-weight: 700;
    background: rgba(0, 82, 204, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.prompt-title-heading {
    color: #172B4D;
    font-weight: 600;
    display: block;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    font-size: 1.1em;
    border-left: 4px solid var(--primary-color);
    padding-left: 12px;
}

.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.copy-button,
.download-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 82, 204, 0.3);
}

.copy-button:hover,
.download-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 82, 204, 0.4);
}

.copy-button:active,
.download-button:active {
    transform: translateY(0);
}

.copy-button.copied {
    background: linear-gradient(135deg, #28a745, #20c997);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.button-icon {
    font-size: 1.1rem;
}

.download-button {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.download-button:hover {
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

/* --- Contact Form Page (Modern) --- */
.contact-form-container {
    max-width: 560px;
    margin: 0 auto;
    padding: 48px 24px 64px;
    flex-grow: 1;
}

.form-nav {
    margin-bottom: 32px;
}

.form-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease, gap 0.2s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.form-back-link:hover {
    color: #fff;
    gap: 12px;
}

.form-back-icon {
    font-size: 1rem;
    line-height: 1;
}

.contact-form-header {
    margin-bottom: 40px;
    padding: 0;
    background: none;
    border-radius: 0;
    box-shadow: none;
    text-align: left;
    color: inherit;
}

.contact-form-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    margin-bottom: 8px;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.contact-form-lead {
    font-size: 0.95rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.92);
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.contact-form-wrapper {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px 36px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 20px -4px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease;
}

.contact-form-wrapper:focus-within {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 24px -4px rgba(0, 82, 204, 0.12);
}

.contact-form-body {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

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

.form-field-full {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
    letter-spacing: 0.01em;
}

.form-required {
    color: #e11d48;
    font-weight: 700;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-color);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.form-input::placeholder {
    color: #9ca3af;
}

.form-input:hover {
    border-color: #cbd5e1;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.12);
}

.form-input:invalid:not(:placeholder-shown):not(:focus) {
    border-color: #f43f5e;
}

.form-textarea {
    resize: vertical;
    min-height: 140px;
    padding: 16px;
    line-height: 1.6;
}

.form-actions {
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid var(--border-color);
}

.submit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 280px;
    padding: 16px 32px;
    border: none;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    font-family: inherit;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 82, 204, 0.25);
}

.submit-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 82, 204, 0.35);
}

.submit-button:active {
    transform: translateY(0);
}

.submit-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.25);
}

/* --- Thanks Page --- */
.thanks-container {
    max-width: 560px;
    margin: 40px auto;
    padding: 20px;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.thanks-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 48px 40px;
    box-shadow: var(--shadow);
    text-align: center;
}

.thanks-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    font-size: 2rem;
    font-weight: 700;
    line-height: 64px;
    border-radius: 50%;
}

.thanks-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 16px;
}

.thanks-message {
    color: var(--muted-color);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 32px;
}

.thanks-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.thanks-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.thanks-button:first-child {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    box-shadow: 0 4px 15px rgba(0, 82, 204, 0.3);
}

.thanks-button:first-child:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 82, 204, 0.4);
}

.thanks-button-secondary {
    background: var(--card-bg);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.thanks-button-secondary:hover {
    background: rgba(0, 82, 204, 0.08);
}

@media (max-width: 768px) {
    .contact-form-container {
        padding: 32px 16px 48px;
    }
    .contact-form-title {
        font-size: 1.5rem;
    }
    .contact-form-wrapper {
        padding: 28px 20px;
        border-radius: 16px;
    }
    .contact-form-body {
        gap: 24px;
    }
    .submit-button {
        max-width: none;
    }
    .thanks-card {
        padding: 32px 24px;
    }
    .thanks-title {
        font-size: 1.5rem;
    }
    .thanks-actions {
        flex-direction: column;
    }
    .thanks-button {
        width: 100%;
    }
}

/* --- Footer Styles --- */
.footer {
    background-color: var(--card-bg);
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    width: 100%;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-logo {
    max-width: 200px;
    margin-bottom: 15px;
}

.footer-link {
    color: var(--muted-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--primary-color);
}


/* レスポンシブ対応 */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    .prompt-generator-container {
        margin: 20px auto;
        padding: 15px;
    }
    .prompt-header {
        padding: 30px 20px;
    }
    .prompt-header h1 {
        font-size: 2rem;
    }
    .prompt-header p {
        font-size: 1rem;
    }
    .category-tabs {
        gap: 8px;
    }
    .category-tab {
        padding: 10px 18px;
        font-size: 0.85rem;
    }
    .search-container {
        flex-direction: column;
    }
    .prompt-form {
        grid-template-columns: 1fr;
    }
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .category-title {
        font-size: 1.3rem;
    }
    .input-group input,
    .input-group textarea,
    #prompt-selector {
        padding: 12px 15px;
        font-size: 0.95rem;
    }
    .generated-prompt-content {
        min-height: 250px;
        max-height: 400px;
        font-size: 0.9rem;
        padding: 18px;
    }
    .action-buttons {
        flex-direction: column;
    }
    .copy-button,
    .download-button {
        width: 100%;
        justify-content: center;
        padding: 12px 24px;
        font-size: 0.95rem;
    }
    .footer-content {
        padding: 0 15px;
    }
    .footer-link {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .prompt-header h1 {
        font-size: 1.6rem;
    }
    .prompt-header p {
        font-size: 0.9rem;
    }
    .category-title {
        font-size: 1.1rem;
    }
    .prompt-wrapper {
        padding: 20px;
    }
}
