/**
 * Public-facing styles for Kurasuba Marche Manager
 *
 * @package    Kurasuba_Marche_Manager
 * @subpackage Kurasuba_Marche_Manager/public/css
 */

/* ==========================================================================
   Common Styles
   ========================================================================== */

.kurasuba-marche-status-wrapper,
.kurasuba-marche-form-wrapper,
.kurasuba-marche-entry-wrapper, /* 追加: エントリーフォーム用ラッパー */
.kurasuba-marche-completion-wrapper,
.kurasuba-marche-exhibitors-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans JP", sans-serif;
    line-height: 1.8;
    color: #333;
}

/* ==========================================================================
   Status Page (詳細入力ページ)
   ========================================================================== */

.kurasuba-marche-status-wrapper {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* Header */
.kurasuba-marche-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding-bottom: 20px;
    margin-bottom: 25px;
    border-bottom: 2px solid #f0f0f0;
}

.kurasuba-marche-header h2 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
    color: #222;
}

/* Status Badge */
.kurasuba-status-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

.kurasuba-status-badge.status-under_review,
.kurasuba-status-badge.status-pending {
    background: #fff3cd;
    color: #856404;
}

.kurasuba-status-badge.status-accepted_pending_details {
    background: #cce5ff;
    color: #004085;
}

.kurasuba-status-badge.status-confirmed {
    background: #d4edda;
    color: #155724;
}

.kurasuba-status-badge.status-rejected {
    background: #f8d7da;
    color: #721c24;
}

.kurasuba-status-badge.status-waitlist {
    background: #e2e3e5;
    color: #383d41;
}

.kurasuba-status-badge.status-cancelled {
    background: #f5f5f5;
    color: #6c757d;
}

/* Info Block */
.kurasuba-marche-info-block {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.kurasuba-marche-info-block h3 {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.kurasuba-marche-info-block table {
    width: 100%;
    border-collapse: collapse;
}

.kurasuba-marche-info-block th,
.kurasuba-marche-info-block td {
    padding: 10px 0;
    text-align: left;
    vertical-align: top;
}

.kurasuba-marche-info-block th {
    width: 120px;
    font-weight: 500;
    color: #666;
    font-size: 0.9em;
}

.kurasuba-marche-info-block td {
    color: #333;
}

/* Form Block */
.kurasuba-marche-form-block {
    background: #fff;
    border: 2px solid #4a90d9;
    border-radius: 8px;
    padding: 25px;
    margin-top: 25px;
}

.kurasuba-marche-form-block h3 {
    margin: 0 0 10px 0;
    font-size: 1.2em;
    font-weight: 600;
    color: #4a90d9;
}

.kurasuba-marche-form-block > p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 0.95em;
}

/* Form Groups (Common & Specific) */
.form-group,
.marche-form-group { /* 追加 */
    margin-bottom: 25px;
}

.form-group label,
.marche-form-group label { /* 追加 */
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
}

.form-group label .required,
.marche-form-group label .required { /* 追加 */
    color: #e53935;
    margin-left: 3px;
}

.form-group .description,
.marche-form-group .description { /* 追加 */
    display: block;
    margin-bottom: 10px;
    font-size: 0.85em;
    color: #777;
    line-height: 1.6;
}

/* Input Fields Styling */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="url"],
.form-group textarea,
.form-group select,
.marche-form-group input[type="text"],   /* 追加 */
.marche-form-group input[type="email"],  /* 追加 */
.marche-form-group input[type="tel"],    /* 追加 */
.marche-form-group input[type="url"],    /* 追加 */
.marche-form-group textarea,             /* 追加 */
.marche-form-group select                /* 追加 */
{
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    line-height: 1.5;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.marche-form-group input:focus,   /* 追加 */
.marche-form-group textarea:focus,/* 追加 */
.marche-form-group select:focus   /* 追加 */
{
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.form-group textarea,
.marche-form-group textarea { /* 追加 */
    min-height: 120px;
    resize: vertical;
}

.form-group input[type="file"],
.marche-form-group input[type="file"] { /* 追加 */
    padding: 10px 0;
}

.regular-text {
    max-width: 400px;
}

/* Form Actions */
.form-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.form-actions input[type="submit"],
.button.button-primary {
    display: inline-block;
    padding: 14px 40px;
    background: #4a90d9;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.form-actions input[type="submit"]:hover,
.button.button-primary:hover {
    background: #3a7bc8;
}

.form-actions input[type="submit"]:active,
.button.button-primary:active {
    transform: translateY(1px);
}

/* Confirmed Block (確定後の表示) */
.kurasuba-marche-confirmed-block {
    background: #f0f9f0;
    border: 1px solid #c3e6c3;
    border-radius: 8px;
    padding: 25px;
    margin-top: 25px;
}

.kurasuba-marche-confirmed-block h3 {
    margin: 0 0 10px 0;
    font-size: 1.2em;
    font-weight: 600;
    color: #2e7d32;
}

.kurasuba-marche-confirmed-block > p {
    margin: 0 0 20px 0;
    color: #666;
}

.kurasuba-detail-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
}

.kurasuba-detail-table th,
.kurasuba-detail-table td {
    padding: 15px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #e8e8e8;
}

.kurasuba-detail-table th {
    width: 150px;
    background: #f5f5f5;
    font-weight: 500;
    color: #555;
}

.kurasuba-detail-table td {
    background: #fff;
}

.kurasuba-detail-table tr:last-child th,
.kurasuba-detail-table tr:last-child td {
    border-bottom: none;
}

.kurasuba-detail-table img {
    max-width: 300px;
    height: auto;
    border-radius: 4px;
}

.kurasuba-detail-table .no-image {
    color: #999;
    font-style: italic;
}

/* Next Steps */
.kurasuba-next-steps {
    margin-top: 25px;
    padding: 20px;
    background: #fff8e1;
    border-radius: 6px;
    border-left: 4px solid #ffc107;
}

.kurasuba-next-steps h4 {
    margin: 0 0 10px 0;
    font-size: 1em;
    font-weight: 600;
    color: #f57c00;
}

.kurasuba-next-steps p {
    margin: 0;
    color: #666;
    font-size: 0.95em;
}

/* ==========================================================================
   Error & Success Messages
   ========================================================================== */

.kurasuba-error,
.kurasuba-marche-error-message { /* 追加 */
    color: #c62828;
    background: #ffebee;
    padding: 15px 20px;
    border-radius: 6px;
    border-left: 4px solid #c62828;
    margin-bottom: 20px;
}
/* リストスタイルのエラー表示対応 */
.kurasuba-marche-error-message ul {
    margin: 0;
    padding-left: 20px;
}

.kurasuba-error-box {
    background: #ffebee;
    border: 1px solid #ffcdd2;
    border-radius: 6px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.kurasuba-error-box ul {
    margin: 0;
    padding: 0 0 0 20px;
    color: #c62828;
}

.kurasuba-error-box li {
    margin-bottom: 5px;
}

.kurasuba-error-box li:last-child {
    margin-bottom: 0;
}

.kurasuba-success-box {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: 6px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.kurasuba-success-box p {
    margin: 0;
    color: #2e7d32;
    font-weight: 500;
}

/* ==========================================================================
   Entry Form (仮エントリーフォーム)
   ========================================================================== */

.kurasuba-marche-entry-wrapper, /* 追加 */
.kurasuba-marche-form-wrapper {
    background: #fff;
}

.marche-step-title, /* 追加 */
.kurasuba-marche-form-wrapper h3 {
    font-size: 1.3em;
    font-weight: 600;
    color: #333;
    margin: 30px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #4a90d9;
}

.marche-step-title:first-child, /* 追加 */
.kurasuba-marche-form-wrapper h3:first-child {
    margin-top: 0;
}

/* Event Selection */
.marche-checkbox-group-vertical, /* 追加 */
.event-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.marche-event-checkbox, /* 追加 */
.event-checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    transition: border-color 0.2s, background-color 0.2s;
    cursor: pointer; /* 追加 */
}

.marche-event-checkbox:hover, /* 追加 */
.event-checkbox-item:hover {
    border-color: #4a90d9;
    background: #f5f9ff;
}

.marche-event-checkbox input[type="checkbox"], /* 追加 */
.event-checkbox-item input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    flex-shrink: 0; /* 追加: レイアウト崩れ防止 */
}

.event-checkbox-item label {
    flex: 1;
    cursor: pointer;
}

/* Radio & Checkbox Groups */
.marche-radio-group, /* 追加 */
.radio-group,
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.marche-radio-group-vertical { /* 追加 */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.marche-radio-group label, /* 追加 */
.radio-group label,
.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
    cursor: pointer;
}

.marche-radio-group-vertical label { /* 追加 */
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}
.marche-radio-group-vertical label:hover { /* 追加 */
    background: #f9f9f9;
    border-color: #bbb;
}

.marche-radio-group input[type="radio"], /* 追加 */
.marche-radio-group-vertical input[type="radio"], /* 追加 */
.radio-group input[type="radio"],
.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0; /* WordPressのデフォルトスタイルリセット */
}

/* Category Checkboxes */
.category-checkbox-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.category-checkbox-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f5f5f5;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.category-checkbox-list label:hover {
    background: #e8e8e8;
}

/* Character Counter */
.char-count, /* 追加 */
.char-counter {
    text-align: right;
    font-size: 0.85em;
    color: #888;
    margin-top: 5px;
}

/* Agreement Section */
.agreement-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 25px;
}

.marche-form-group .checkbox-label, /* 追加 */
.agreement-section label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    line-height: 1.5;
}

.marche-form-group .checkbox-label input[type="checkbox"], /* 追加 */
.agreement-section input[type="checkbox"] {
    margin-top: 3px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Submit Button */
.marche-submit-wrapper, /* 追加 */
.kurasuba-marche-form-wrapper .submit-section {
    text-align: center;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.marche-submit-btn, /* 追加 */
.kurasuba-marche-form-wrapper input[type="submit"] {
    padding: 16px 60px;
    background: #e53935;
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    -webkit-appearance: none; /* iOS対策 */
}

.marche-submit-btn:hover, /* 追加 */
.kurasuba-marche-form-wrapper input[type="submit"]:hover {
    background: #c62828;
}

.marche-submit-btn:active, /* 追加 */
.kurasuba-marche-form-wrapper input[type="submit"]:active {
    transform: translateY(1px);
}

/* ==========================================================================
   Completion Page (完了ページ)
   ========================================================================== */

.kurasuba-marche-completion-wrapper {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.kurasuba-marche-completion-wrapper h3 {
    font-size: 1.5em;
    color: #2e7d32;
    margin: 0 0 20px 0;
}

.kurasuba-marche-completion-wrapper > p {
    margin: 0 0 15px 0;
    color: #555;
}

.kurasuba-marche-caution {
    display: inline-block;
    text-align: left;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 6px;
    padding: 20px;
    margin: 25px 0;
}

.kurasuba-marche-caution p {
    margin: 0 0 10px 0;
    font-weight: 600;
    color: #f57c00;
}

.kurasuba-marche-caution ul {
    margin: 0;
    padding: 0 0 0 20px;
    color: #666;
}

.kurasuba-marche-caution li {
    margin-bottom: 5px;
}

.kurasuba-marche-completion-wrapper .button {
    display: inline-block;
    padding: 14px 40px;
    background: #4a90d9;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background-color 0.2s;
}

.kurasuba-marche-completion-wrapper .button:hover {
    background: #3a7bc8;
    color: #fff;
}

/* ==========================================================================
   Exhibitor List (出展者一覧)
   ========================================================================== */

.kurasuba-marche-exhibitors-wrapper {
    max-width: 1000px;
}

.kurasuba-marche-exhibitors-grid, /* 追加 */
.kurasuba-exhibitor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.kurasuba-marche-exhibitor-card, /* 追加 */
.kurasuba-exhibitor-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s, transform 0.2s;
}

.kurasuba-marche-exhibitor-card:hover, /* 追加 */
.kurasuba-exhibitor-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.kurasuba-marche-exhibitor-image, /* 追加 */
.kurasuba-exhibitor-image {
    width: 100%;
    height: 200px;
    position: relative; /* 追加 */
    background: #f0f0f0;
}

.kurasuba-marche-exhibitor-image img, /* 追加 */
.kurasuba-exhibitor-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kurasuba-marche-frame-label { /* 追加 */
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    background: #666;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.kurasuba-marche-frame-label.sales { background: #e65100; }
.kurasuba-marche-frame-label.workshop { background: #2e7d32; }
.kurasuba-marche-frame-label.service { background: #1565c0; }
.kurasuba-marche-frame-label.other { background: #7b1fa2; }


.kurasuba-marche-exhibitor-image .no-image, /* 追加 */
.kurasuba-exhibitor-image.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.9em;
    height: 100%; /* 追加 */
}

.kurasuba-marche-exhibitor-content, /* 追加 */
.kurasuba-exhibitor-content {
    padding: 20px;
}

.kurasuba-marche-exhibitor-name, /* 追加 */
.kurasuba-exhibitor-name {
    margin: 0 0 8px 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
}

.kurasuba-exhibitor-type {
    display: inline-block;
    padding: 3px 10px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
    margin-bottom: 10px;
}

.kurasuba-marche-exhibitor-description, /* 追加 */
.kurasuba-exhibitor-description {
    margin: 0;
    color: #666;
    font-size: 0.9em;
    line-height: 1.7;
}

/* No Exhibitors */
.kurasuba-marche-no-exhibitors, /* 追加 */
.kurasuba-no-exhibitors {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media screen and (max-width: 768px) {
    .kurasuba-marche-status-wrapper,
    .kurasuba-marche-form-wrapper,
    .kurasuba-marche-entry-wrapper, /* 追加 */
    .kurasuba-marche-completion-wrapper {
        padding: 15px;
    }
    
    .kurasuba-marche-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .kurasuba-marche-info-block th {
        width: 100px;
    }
    
    .kurasuba-detail-table th {
        width: 100px;
        font-size: 0.9em;
    }
    
    .kurasuba-detail-table img {
        max-width: 100%;
    }
    
    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group input[type="tel"],
    .form-group input[type="url"],
    .form-group textarea,
    .form-group select,
    .marche-form-group input[type="text"], /* 追加 */
    .marche-form-group input[type="email"], /* 追加 */
    .marche-form-group input[type="tel"] /* 追加 */
    {
        font-size: 16px;
        /* Prevent zoom on iOS */
    }
    
    .radio-group,
    .checkbox-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .category-checkbox-list {
        grid-template-columns: 1fr;
    }
    
    .kurasuba-marche-exhibitors-grid, /* 追加 */
    .kurasuba-exhibitor-grid {
        grid-template-columns: 1fr;
    }
    
    .marche-submit-btn, /* 追加 */
    .kurasuba-marche-form-wrapper input[type="submit"] {
        width: 100%;
        padding: 16px 20px;
    }
}

@media screen and (max-width: 480px) {
    .kurasuba-marche-header h2 {
        font-size: 1.2em;
    }
    
    .kurasuba-status-badge {
        font-size: 0.85em;
        padding: 6px 12px;
    }
    
    .kurasuba-marche-form-block,
    .kurasuba-marche-confirmed-block {
        padding: 15px;
    }
    
    .form-actions input[type="submit"],
    .button.button-primary {
        width: 100%;
        padding: 14px 20px;
    }
}