@import url(http://fonts.googleapis.com/earlyaccess/notosansjp.css);
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* ============================================================
   Vivid & Cute Modern Design - Clean White Base
   ============================================================ */

:root {
    /* Clean Light Colors (白ベース、ほんのり色味) */
    --pastel-pink: #FFF5F7;
    --pastel-blue: #F0F9FF;
    --pastel-purple: #FAF5FF;
    --pastel-green: #F0FFF4;
    --pastel-yellow: #FFFFF0;
    --pastel-orange: #FFFAF0;
    --pastel-cyan: #E0FFFF;

    /* ★ Vivid Accent Colors - パッと目を引く鮮やかな色 */
    --vivid-pink: #FF1493;      /* ディープピンク - 可愛い！ */
    --vivid-blue: #0099FF;      /* ビビッドスカイブルー */
    --vivid-purple: #8B5CF6;    /* バイオレット */
    --vivid-green: #10B981;     /* エメラルドグリーン */
    --vivid-orange: #FF6B35;    /* ビビッドオレンジ */
    --vivid-cyan: #06B6D4;      /* シアン */

    /* Primary - メインカラー */
    --primary: #6366F1;         /* インディゴ */
    --primary-light: #818CF8;
    --primary-dark: #4F46E5;
    --secondary: #EC4899;       /* ピンク */

    /* UI Colors - クリーンな白ベース */
    --bg-color: #FFFFFF;
    --card-bg: #FFFFFF;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;
    --shadow-color: rgba(99, 102, 241, 0.15);
}

body {
    font-family: 'Poppins', 'Noto Sans JP', 'Roboto', sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
    background-attachment: fixed;
    line-height: 1.5;
    min-height: 100vh;
    padding: 10px;
}

h1 {
    font-size: 1.5em;
    font-weight: 700;
    margin-top: 0;
    background: linear-gradient(135deg, var(--vivid-blue) 0%, var(--vivid-purple) 50%, var(--vivid-pink) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* コンテナ用 */
.container {
    display: flex;
    justify-content: flex-start;
    align-items: stretch;
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0;
    gap: 15px;
    min-height: calc(100vh - 20px);
}

.title-and-help {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(90deg, var(--vivid-pink), var(--vivid-purple), var(--vivid-blue)) 1;
}

form {
    background: var(--card-bg);
    padding: 15px 20px;
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(99, 102, 241, 0.05);
    max-width: 760px;
    min-width: 760px;
    width: 100%;
    margin-top: 0;
}

label {
    display: inline-block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9em;
}

input[type="text"], select, input[type="number"] {
    width: 100%;
    padding: 6px 10px;
    margin: 2px 0;
    box-sizing: border-box;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95em;
    transition: all 0.2s ease;
    background: var(--card-bg);
}

input[type="text"]:focus, select:focus, input[type="number"]:focus {
    outline: none;
    border-color: var(--vivid-blue);
    box-shadow: 0 0 0 3px rgba(0, 153, 255, 0.2);
}

/* ★ バーコード生成ボタン - 目を引くグラデーション */
input[type="submit"] {
    background: linear-gradient(135deg, var(--vivid-pink) 0%, var(--vivid-orange) 100%);
    color: #fff;
    padding: 10px 30px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95em;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(255, 20, 147, 0.4);
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 20, 147, 0.5);
    filter: brightness(1.05);
}

/* ★ ヘルプボタン - シアン系でポップ */
.help-button {
    background: linear-gradient(135deg, var(--vivid-cyan) 0%, var(--vivid-blue) 100%);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
    transition: all 0.2s ease;
}

.help-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(6, 182, 212, 0.5);
    filter: brightness(1.05);
}

/* ============================================================
   バーコード種類セレクト - カテゴリースタイル
   ============================================================ */
#kind {
    background: linear-gradient(135deg, #F0FFFF 0%, #F0F9FF 100%);
    border: 2px solid var(--vivid-cyan);
    font-weight: 500;
}

#kind optgroup {
    font-weight: 700;
    color: var(--vivid-purple);
    background: var(--pastel-purple);
}

/* ============================================================
   固有プロパティ領域 - カラフルなカード（コンパクト版）
   ============================================================ */
.specific-props {
    margin: 6px 0;
    padding: 8px 10px;
    border-radius: 8px;
    border-left: 4px solid;
    position: relative;
}

.specific-props h4 {
    margin: 0 0 4px 0;
    font-size: 0.85em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
}

.specific-props h4::before {
    content: '⚙️';
    font-size: 0.9em;
}

.specific-props .prop-description {
    font-size: 0.75em;
    color: var(--text-secondary);
    margin-bottom: 6px;
    padding: 3px 6px;
    background: rgba(255,255,255,0.8);
    border-radius: 4px;
    line-height: 1.3;
}

.specific-props .form-group {
    margin-bottom: 4px;
}

/* QRコード専用 - パープル */
.props-qr {
    background: linear-gradient(135deg, #FAF5FF 0%, #F3E8FF 100%);
    border-color: var(--vivid-purple);
}

.props-qr h4 { color: var(--vivid-purple); }

/* DataMatrix専用 - ブルー */
.props-datamatrix {
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    border-color: var(--vivid-blue);
}

.props-datamatrix h4 { color: var(--vivid-blue); }

/* PDF417専用 - グリーン */
.props-pdf417 {
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
    border-color: var(--vivid-green);
}

.props-pdf417 h4 { color: var(--vivid-green); }

/* CODE128/GS1-128専用 - オレンジ */
.props-code128 {
    background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
    border-color: var(--vivid-orange);
}

.props-code128 h4 { color: var(--vivid-orange); }

/* CODE39/NW7専用 - ピンク */
.props-startstop {
    background: linear-gradient(135deg, #FFF1F2 0%, #FFE4E6 100%);
    border-color: var(--vivid-pink);
}

.props-startstop h4 { color: var(--vivid-pink); }

/* DataBar専用 - シアン */
.props-databar {
    background: linear-gradient(135deg, #ECFEFF 0%, #CFFAFE 100%);
    border-color: var(--vivid-cyan);
}

.props-databar h4 { color: var(--vivid-cyan); }

/* 全角エンコード - イエロー/ゴールド */
.props-encode {
    background: linear-gradient(135deg, #FEFCE8 0%, #FEF9C3 100%);
    border-color: #F59E0B;
}

.props-encode h4 { color: #D97706; }

/* ============================================================
   入力ヒント表示
   ============================================================ */
.input-hint {
    font-size: 0.75em;
    color: var(--text-secondary);
    padding: 4px 8px;
    background: #F9FAFB;
    border-radius: 6px;
    margin-bottom: 4px;
    border-left: 3px solid var(--vivid-blue);
    line-height: 1.35;
}

.input-hint::before {
    content: '💡 ';
}

/* ============================================================
   入力候補ドロップダウン
   ============================================================ */
.input-assist {
    margin-top: 4px;
    margin-bottom: 4px;
}

.input-assist select {
    font-size: 0.85em;
    padding: 5px 8px;
    background: linear-gradient(135deg, #ECFEFF 0%, #F0F9FF 100%);
    border: 2px solid var(--vivid-cyan);
    border-radius: 6px;
}

.input-assist label {
    font-size: 0.8em;
    color: var(--vivid-cyan);
    font-weight: 700;
}

/* ============================================================
   フォームグループ - モダンスタイル
   ============================================================ */
.form-group {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: nowrap;
}

.form-group label {
    margin-right: 10px;
    margin-bottom: 0;
    width: 240px;
    text-align: right;
    font-weight: 500;
}

.form-group2 {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: nowrap;
}

.form-group2 label {
    margin-right: 10px;
    margin-bottom: 0;
    width: 180px;
    text-align: right;
}

/* ============================================================
   カラー選択 - モダンスタイル
   ============================================================ */
#grp_colors {
    padding: 8px 12px;
    background: linear-gradient(135deg, #FDF2F8 0%, #FCE7F3 100%);
    border-radius: 10px;
    margin: 8px 0;
    border: 1px solid rgba(236, 72, 153, 0.2);
}

#grp_colors label {
    font-weight: 600;
    color: var(--text-primary);
}

/* ============================================================
   オプションコンテナ - 出力設定
   ============================================================ */
.option-container {
    display: inline-flex;
    align-items: center;
    margin-right: 8px;
    margin-bottom: 6px;
    padding: 5px 8px;
    background: #F0F9FF;
    border-radius: 8px;
    white-space: nowrap;
    border: 1px solid rgba(0, 153, 255, 0.15);
}

.option-container select {
    margin-left: 5px;
}

#browser_options,
#pdf_options {
    margin-top: -17px;
    margin-left: 10px;
}

#browser_options select {
    margin-top: 2px;
    font-size: 12px;
    padding: 6px 10px;
    width: 230px;
    border-radius: 8px;
}

#format_options select {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 8px;
}

#pdf_options select {
    margin-top: 2px;
    font-size: 12px;
    padding: 6px 10px;
    width: 160px;
    border-radius: 8px;
}

/* ============================================================
   テーブル内のフォームグループ調整
   ============================================================ */
table .form-group label {
    width: auto;
    text-align: left;
}

/* ============================================================
   バーコード描画キャンバス（描画エリア）- 右側全体を使用
   ============================================================ */
.barcode-canvas {
    background: #FAFAFA;
    border: 2px solid var(--vivid-cyan);
    border-radius: 15px;
    flex: 1;
    min-height: calc(100vh - 50px);
    padding: 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(6, 182, 212, 0.1), 0 2px 4px -1px rgba(6, 182, 212, 0.06);
    margin-right: 15px;
    margin-bottom: 15px;
}

#barcodeImage {
    display: block;
    max-width: none;
}

/* ============================================================
   セパレーター（hr）- ビビッドグラデーション
   ============================================================ */
hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, var(--vivid-pink), var(--vivid-purple), var(--vivid-blue), var(--vivid-cyan));
    margin: 10px 0;
    border-radius: 2px;
}

/* ============================================================
   モーダル関連 - モダンスタイル
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    z-index: 100;
    display: none;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 480px;
    background: var(--card-bg);
    padding: 30px;
    z-index: 101;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    display: none;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.modal p {
    margin-bottom: 25px;
    font-size: 1.1em;
    color: var(--text-primary);
}

.show {
    display: block !important;
}

.button-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 15px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--vivid-blue) 0%, var(--vivid-purple) 100%);
    color: #fff;
    border-radius: 25px;
    text-decoration: none;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(0, 153, 255, 0.35);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 153, 255, 0.45);
    filter: brightness(1.05);
}

.btn-view {
    margin-right: 0;
}

.btn-download {
    background: linear-gradient(135deg, var(--vivid-pink) 0%, var(--vivid-orange) 100%);
    box-shadow: 0 4px 14px rgba(255, 20, 147, 0.35);
}

.btn-download:hover {
    box-shadow: 0 6px 20px rgba(255, 20, 147, 0.45);
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.close:hover {
    color: var(--vivid-pink);
}

/* ヘルプ用モーダル */
.modal_help {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    max-width: 750px;
    background: var(--card-bg);
    padding: 30px;
    z-index: 101;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    display: none;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.modal_help.show {
    display: block;
}

.modal_help p {
    margin-bottom: 18px;
    padding: 12px 15px;
    background: #F0F9FF;
    border-radius: 10px;
    border-left: 4px solid var(--vivid-blue);
    font-size: 0.95em;
    line-height: 1.7;
}

.modal_help .close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal_help .close:hover {
    color: var(--vivid-pink);
}

.modal-overlay.show {
    display: block;
}

/* ============================================================
   SVG未対応エラー表示
   ============================================================ */
div[th\:if="${svgNotSupported}"] {
    background: #FEF2F2;
    border: none;
    border-left: 4px solid #EF4444;
    border-radius: 10px;
    padding: 15px;
    color: #DC2626;
}

/* ============================================================
   チェックボックス - カスタムスタイル
   ============================================================ */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--vivid-pink);
    cursor: pointer;
}

/* ============================================================
   セクションタイトル
   ============================================================ */
.section-title {
    font-size: 0.9em;
    font-weight: 700;
    color: var(--vivid-purple);
    margin: 20px 0 10px 0;
    padding-left: 10px;
    border-left: 3px solid var(--vivid-purple);
}

/* ============================================================
   アニメーション
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.specific-props {
    animation: fadeIn 0.3s ease-out;
}

/* ============================================================
   レスポンシブ調整
   ============================================================ */
@media (max-width: 1200px) {
    .container {
        flex-direction: column;
    }

    form {
        min-width: auto;
        max-width: 100%;
    }
}
