/* ========================================
   本の追加フォーム専用スタイル
   ======================================== */

/* 背景色 */
body,
.wrapper {
    background-color: #fdf8f3;
    background-image: none;
}

/* ページヘッダー */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background-color: #fdf8f3;
}

.btn-back {
    display: flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background-color: rgba(232, 226, 206, 0.5);
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-back:hover {
    background-color: rgba(232, 226, 206, 0.8);
}

.btn-back .material-symbols-outlined {
    color: #5d4037;
    font-size: 24px;
}

.page-title {
    color: #3e2723;
    font-size: 1.125rem;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.header-spacer {
    width: 40px;
}

/* メインコンテンツ */
.main-content {
    padding: 0 0 24px 0;
}

/* 表紙プレビューセクション */
.cover-preview-section {
    display: flex;
    flex-direction: column;
    padding: 24px;
    padding-bottom: 8px;
}

.cover-preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    border-radius: 16px;
    border: 2px dashed #e8e2ce;
    background-color: rgba(244, 240, 231, 0.4);
    padding: 32px 24px;
}

.cover-preview-box {
    display: flex;
    height: 176px;
    width: 128px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background-color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e8e2ce;
    background-size: cover;
    background-position: center;
}

.cover-placeholder-icon {
    font-size: 3rem;
    color: rgba(156, 135, 73, 0.4);
}

.cover-preview-box.has-image .cover-placeholder-icon {
    display: none;
}

.cover-preview-text {
    color: rgba(62, 39, 35, 0.6);
    font-size: 0.875rem;
    font-weight: 500;
}

/* フォーム項目 */
.form-fields {
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.form-label {
    display: block;
}

.label-text {
    color: #3e2723;
    font-size: 0.875rem;
    font-weight: 700;
    display: block;
    padding-bottom: 8px;
}

.required {
    color: #dc2626;
}

/* 入力フィールド */
.form-input,
.form-select {
    width: 100%;
    border-radius: 12px;
    border: 1px solid #e8e2ce;
    background-color: #ffffff;
    height: 56px;
    padding: 0 16px;
    font-size: 1rem;
    color: #3e2723;
    font-family: 'Noto Sans JP', sans-serif;
    box-sizing: border-box;
}

.form-input::placeholder {
    color: rgba(156, 135, 73, 0.4);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #f4c025;
    box-shadow: 0 0 0 3px rgba(244, 192, 37, 0.1);
}

.form-input:disabled {
    background-color: #f3f4f6;
    color: rgba(62, 39, 35, 0.4);
    cursor: not-allowed;
    opacity: 0.5;
}

/* テキストエリア */
.form-textarea {
    width: 100%;
    border-radius: 12px;
    border: 1px solid #e8e2ce;
    background-color: #ffffff;
    min-height: 120px;
    padding: 16px;
    font-size: 1rem;
    color: #3e2723;
    font-family: 'Noto Sans JP', sans-serif;
    resize: vertical;
    box-sizing: border-box;
}

.form-textarea::placeholder {
    color: rgba(156, 135, 73, 0.4);
}

.form-textarea:focus {
    outline: none;
    border-color: #f4c025;
    box-shadow: 0 0 0 3px rgba(244, 192, 37, 0.1);
}

/* エラーメッセージ */
.error-message {
    display: none;
    color: #dc2626;
    font-size: 0.75rem;
    margin-top: 4px;
    font-weight: 500;
}

.form-input:invalid:not(:placeholder-shown) ~ .error-message,
.form-select:invalid ~ .error-message {
    display: block;
}

/* 星評価 */
.rating-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
}

.star-rating {
    display: flex;
    gap: 8px;
    padding: 12px 0;
}

.star-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s;
}

.star-button:hover {
    transform: scale(1.1);
}

.star-button .material-symbols-outlined {
    font-size: 2.5rem;
    color: #e8e2ce;
}

.star-button.filled .material-symbols-outlined {
    color: #FFD700;
    font-variation-settings: 'FILL' 1;
}

/* ステータスボタン */
.status-buttons {
    display: flex;
    width: 100%;
    background-color: #f4f0e7;
    border-radius: 12px;
    padding: 6px;
    gap: 4px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.status-btn {
    flex: 1;
    padding: 12px 0;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 8px;
    color: rgba(62, 39, 35, 0.6);
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.status-btn.active {
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.status-btn[data-status="completed"].active {
    background-color: #10b981;
}

.status-btn[data-status="reading"].active {
    background-color: #eab308;
}

.status-btn[data-status="want-to-read"].active {
    background-color: #9ca3af;
}

/* 日付入力 */
.date-input-wrapper {
    position: relative;
}

.date-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(156, 135, 73, 0.4);
    pointer-events: none;
}

#completionDateGroup.disabled {
    opacity: 0.5;
}

/* フッター（保存ボタン） */
.form-footer {
    padding: 32px 0 48px 0;
}

.btn-submit {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 16px;
    background-color: #f4c025;
    height: 64px;
    box-shadow: 0 10px 15px -3px rgba(244, 192, 37, 0.2);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-submit:hover {
    filter: brightness(1.05);
}

.btn-submit:active {
    transform: scale(0.98);
}

.btn-submit .material-symbols-outlined {
    font-weight: 700;
    color: #3e2723;
    font-size: 24px;
}

.btn-submit-text {
    color: #3e2723;
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ========================================
   レスポンシブデザイン
   ======================================== */

@media (min-width: 640px) {
    .main-content {
        max-width: 600px;
        margin: 0 auto;
    }
}
