/**
 * quickate フロントエンドUI スタイル
 */

/* ボタン要素のリセット - テーマのスタイルを継承 */
.quickate-mypage button,
.quickate-mypage .quickate-btn:is(button) {
	appearance: none;
	-webkit-appearance: none;
	margin: 0;
	padding: 0;
	border: none;
	background: none;
	font: inherit;
	color: inherit;
	cursor: pointer;
	text-align: inherit;
	text-decoration: none;
}

.quickate-mypage {
	max-width: 1200px;
	margin: 0 auto;
	padding: 40px 20px;
	font-family: inherit;
}

/* ヘッダー */
.quickate-mypage-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 32px;
	padding-bottom: 24px;
	border-bottom: 2px solid #e0e0e0;
}

.quickate-mypage-title {
	font-size: 32px;
	font-weight: 700;
	font-family: inherit;
	color: #333;
	margin: 0;
	background: linear-gradient(135deg, #6366f1, #764ba2);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	line-height: 1.2;
}

.quickate-mypage-user-info {
	font-size: inherit;
	font-family: inherit;
	color: #666;
	line-height: 1.5;
}

/* タブナビゲーション */
.quickate-mypage-tabs {
	display: flex;
	gap: 8px;
	margin-bottom: 32px;
	border-bottom: 2px solid #e0e0e0;
}

.quickate-tab-btn {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	border: none;
	background: transparent;
	color: #666;
	font-size: inherit;
	font-weight: 500;
	font-family: inherit;
	cursor: pointer;
	border-bottom: 2px solid transparent;
	transition: all 0.3s ease;
	line-height: 1.5;
}

.quickate-tab-btn:hover {
	color: #6366f1;
}

.quickate-tab-btn.active {
	color: #6366f1;
	border-bottom-color: #6366f1;
}

/* タブコンテンツ */
.quickate-tab-content {
	display: none;
}

.quickate-tab-content.active {
	display: block;
}

/* ボタン */
.quickate-btn,
.quickate-btn:is(button),
.quickate-btn:is(a) {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	border: none;
	border-radius: 10px;
	font-size: inherit;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: all 0.3s ease;
	text-decoration: none;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	background: transparent;
	color: inherit;
	line-height: 1.5;
}

.quickate-btn-primary {
	background: linear-gradient(135deg, #6366f1, #764ba2);
	color: #fff;
	box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
	border: 2px solid transparent;
}

.quickate-btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(99, 102, 241, 0.5);
	background: linear-gradient(135deg, #5855eb, #6a42a0);
}

.quickate-btn-primary.disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
}

.quickate-btn-secondary {
	background: #fff;
	color: #333;
	border: 2px solid #ddd;
}

.quickate-btn-secondary:hover {
	background: #f8f9fa;
	border-color: #6366f1;
	color: #6366f1;
}

.quickate-btn-danger {
	background: #ef4444;
	color: #fff;
	border: 2px solid transparent;
}

.quickate-btn-danger:hover {
	background: #dc2626;
	box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
	transform: translateY(-2px);
}

/* ライセンス情報 */
.quickate-license-info {
	margin-bottom: 24px;
}

.quickate-license-card {
	background: linear-gradient(135deg, #f8f9fa, #e9ecef);
	border-radius: 16px;
	padding: 24px;
	text-align: center;
	border: 2px solid #e0e0e0;
}

.quickate-license-stats {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-bottom: 12px;
}

.quickate-license-current {
	font-size: 32px;
	font-weight: 700;
	font-family: inherit;
	color: #6366f1;
	line-height: 1.2;
}

.quickate-license-separator {
	font-size: 24px;
	font-family: inherit;
	color: #999;
	line-height: 1.2;
}

.quickate-license-max {
	font-size: 32px;
	font-weight: 700;
	font-family: inherit;
	color: #666;
	line-height: 1.2;
}

.quickate-license-text {
	margin: 0;
	color: #666;
	font-size: 14px;
	font-family: inherit;
	line-height: 1.5;
}

/* フォーム一覧 */
.quickate-forms-section {
	margin-bottom: 40px;
}

.quickate-section-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 24px;
}

.quickate-section-header h2 {
	margin: 0;
	font-size: 24px;
	font-family: inherit;
	font-weight: 600;
	color: #333;
	line-height: 1.3;
}

.quickate-forms-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 24px;
}

.quickate-form-card {
	background: #fff;
	border-radius: 16px;
	padding: 24px;
	border: 2px solid #e0e0e0;
	transition: all 0.3s ease;
	box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.quickate-form-card:hover {
	border-color: #6366f1;
	box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
	transform: translateY(-4px);
}

.quickate-form-card-header {
	margin-bottom: 16px;
}

.quickate-form-card-image {
	width: 100%;
	height: 150px;
	object-fit: cover;
	border-radius: 12px;
	margin-bottom: 12px;
}

.quickate-form-card-title {
	font-size: 18px;
	font-weight: 600;
	font-family: inherit;
	color: #333;
	margin: 0 0 8px 0;
	line-height: 1.4;
}

.quickate-form-card-description {
	font-size: 14px;
	font-family: inherit;
	color: #666;
	margin: 0 0 12px 0;
	line-height: 1.5;
}

.quickate-form-card-stats {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 16px;
	font-size: 14px;
	font-family: inherit;
	color: #666;
	line-height: 1.5;
}

.quickate-form-card-actions {
	display: flex;
	gap: 8px;
}

.quickate-form-card-actions .quickate-btn {
	flex: 1;
	justify-content: center;
	padding: 8px 12px;
	font-size: 13px;
	font-family: inherit;
}

/* モーダル */
.quickate-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 10000;
	display: none;
}

.quickate-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(4px);
}

.quickate-modal-content {
	position: relative;
	background: #fff;
	border-radius: 20px;
	max-width: 900px;
	width: 90%;
	max-height: 90vh;
	margin: 5vh auto;
	overflow: hidden;
	box-shadow: 0 20px 60px rgba(0,0,0,0.3);
	display: flex;
	flex-direction: column;
}

.quickate-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 24px 32px;
	border-bottom: 1px solid #e0e0e0;
	background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.quickate-modal-header h2 {
	margin: 0;
	font-size: 24px;
	font-family: inherit;
	font-weight: 600;
	color: #333;
	line-height: 1.3;
}

.quickate-modal-close {
	background: transparent;
	border: none;
	font-size: 24px;
	font-family: inherit;
	color: #666;
	cursor: pointer;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: all 0.2s;
	line-height: 1;
}

.quickate-modal-close:hover {
	background: #f0f0f0;
	color: #333;
}

.quickate-modal-body {
	padding: 32px;
	overflow-y: auto;
	flex: 1;
}

/* ローディング */
.quickate-loading {
	text-align: center;
	padding: 40px;
}

.quickate-spinner {
	border: 4px solid #f3f3f3;
	border-top: 4px solid #6366f1;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	animation: spin 1s linear infinite;
	margin: 0 auto 16px;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* キャンペーン */
.quickate-campaign-section {
	padding: 24px;
	background: #f8f9fa;
	border-radius: 16px;
}

.quickate-campaign-form-selector {
	margin-bottom: 24px;
}

.quickate-campaign-form-selector select {
	width: 100%;
	padding: 12px;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	font-size: inherit;
	font-family: inherit;
	line-height: 1.5;
}

.quickate-campaign-link {
	margin-top: 24px;
	padding: 24px;
	background: #fff;
	border-radius: 12px;
	border: 2px solid #e0e0e0;
}

.quickate-campaign-link-input {
	display: flex;
	gap: 8px;
	margin-bottom: 16px;
}

.quickate-campaign-link-input input {
	flex: 1;
	padding: 12px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 14px;
}

.quickate-share-buttons {
	display: flex;
	gap: 12px;
}

.quickate-share-btn {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border: none;
	border-radius: 8px;
	font-size: 14px;
	font-family: inherit;
	cursor: pointer;
	transition: all 0.3s ease;
	line-height: 1.5;
}

.quickate-share-twitter {
	background: #1da1f2;
	color: #fff;
}

.quickate-share-facebook {
	background: #1877f2;
	color: #fff;
}

.quickate-share-line {
	background: #00c300;
	color: #fff;
}

/* レスポンシブ */
@media (max-width: 768px) {
	.quickate-mypage-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 16px;
	}

	.quickate-mypage-tabs {
		flex-wrap: wrap;
	}

	.quickate-forms-grid {
		grid-template-columns: 1fr;
	}

	.quickate-modal-content {
		margin: 0;
		max-height: 100vh;
		border-radius: 0;
	}
}

/* フォームビルダー */
.quickate-form-builder-frontend {
	padding: 24px;
}

.quickate-form-builder-section {
	margin-bottom: 32px;
	padding: 24px;
	background: #f8f9fa;
	border-radius: 12px;
	border: 1px solid #e0e0e0;
}

.quickate-form-builder-section h3 {
	margin: 0 0 20px 0;
	font-size: 20px;
	font-family: inherit;
	font-weight: 600;
	color: #333;
	line-height: 1.4;
}

.quickate-form-field {
	margin-bottom: 20px;
}

.quickate-form-field label {
	display: block;
	margin-bottom: 8px;
	font-weight: 500;
	font-family: inherit;
	color: #333;
	line-height: 1.5;
}

.quickate-form-field .required {
	color: #ef4444;
}

.quickate-input {
	width: 100%;
	padding: 12px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: inherit;
	font-family: inherit;
	transition: border-color 0.2s;
	line-height: 1.5;
}

.quickate-input:focus {
	outline: none;
	border-color: #6366f1;
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.quickate-questions-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.quickate-question-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px;
	margin-bottom: 12px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	transition: all 0.2s;
}

.quickate-question-item:hover {
	border-color: #6366f1;
	box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.quickate-question-item-content {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 1;
}

.quickate-question-number {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	background: #6366f1;
	color: #fff;
	border-radius: 50%;
	font-weight: 600;
	font-size: 14px;
}

.quickate-question-label {
	font-weight: 500;
	font-family: inherit;
	color: #333;
	line-height: 1.5;
}

.quickate-question-type {
	padding: 4px 12px;
	background: #f0f0f0;
	border-radius: 12px;
	font-size: 12px;
	font-family: inherit;
	color: #666;
	line-height: 1.4;
}

.quickate-question-required {
	padding: 4px 12px;
	background: #fee2e2;
	color: #dc2626;
	border-radius: 12px;
	font-size: 12px;
	font-family: inherit;
	font-weight: 600;
	line-height: 1.4;
}

.quickate-question-item-actions {
	display: flex;
	gap: 8px;
}

.quickate-btn-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	background: transparent;
	border: 1px solid #ddd;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s;
	font-family: inherit;
	line-height: 1;
}

.quickate-btn-icon:hover {
	background: #f0f0f0;
	border-color: #6366f1;
}

.quickate-btn-icon .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

.quickate-question-editor {
	margin-top: 24px;
	padding: 24px;
	background: #fff;
	border: 2px solid #6366f1;
	border-radius: 12px;
}

.quickate-question-editor h3 {
	margin: 0 0 20px 0;
	font-size: 18px;
	font-family: inherit;
	font-weight: 600;
	color: #333;
	line-height: 1.4;
}

.quickate-option-item {
	display: flex;
	gap: 8px;
	margin-bottom: 8px;
}

.quickate-empty-message {
	padding: 24px;
	text-align: center;
	color: #999;
	background: #f8f9fa;
	border-radius: 8px;
	border: 2px dashed #ddd;
}

.quickate-form-builder-actions {
	display: flex;
	gap: 12px;
	align-items: center;
}

.quickate-btn-large {
	padding: 14px 28px;
	font-size: 16px;
	font-family: inherit;
}

.quickate-btn .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
	margin-right: 6px;
}

.spin {
	animation: spin 1s linear infinite;
}

@keyframes spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

/* フォームタイプ選択 */
.quickate-form-type-selector {
	display: flex;
	gap: 16px;
	margin-bottom: 8px;
}

.quickate-form-type-option {
	position: relative;
	flex: 1;
	cursor: pointer;
}

.quickate-form-type-option input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.quickate-form-type-label {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 20px;
	background: #fff;
	border: 2px solid #e0e0e0;
	border-radius: 12px;
	transition: all 0.3s ease;
	cursor: pointer;
}

.quickate-form-type-option input[type="radio"]:checked + .quickate-form-type-label {
	border-color: #6366f1;
	background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(118, 75, 162, 0.1));
	box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.quickate-form-type-label .dashicons {
	font-size: 32px;
	width: 32px;
	height: 32px;
	color: #6366f1;
}

.quickate-form-type-option input[type="radio"]:checked + .quickate-form-type-label .dashicons {
	color: #6366f1;
}

.quickate-form-type-label span:last-child {
	font-weight: 600;
	color: #333;
	font-size: 15px;
}

.quickate-form-type-option input[type="radio"]:checked + .quickate-form-type-label span:last-child {
	color: #6366f1;
}

.quickate-form-field-hint {
	margin-top: 8px;
	font-size: 13px;
	font-family: inherit;
	color: #666;
	line-height: 1.5;
}

/* 通知 */
@keyframes slideInRight {
	from {
		transform: translateX(100%);
		opacity: 0;
	}
	to {
		transform: translateX(0);
		opacity: 1;
	}
}

.quickate-notification {
	animation: slideInRight 0.3s ease;
}

/* プレビューモーダル */
.quickate-preview-modal {
	backdrop-filter: blur(8px);
}

.quickate-preview-content {
	animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
	from {
		transform: scale(0.9);
		opacity: 0;
	}
	to {
		transform: scale(1);
		opacity: 1;
	}
}

.quickate-preview-question label:hover {
	border-color: var(--theme-color, #6366f1);
	box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
	transform: translateY(-2px);
}
