/* ================================================
   Style AI Generator - Custom Styles
   デザインコンセプト: 「フォーカスと透明性」
   モノクロームベース + 機能的色彩（ピンク）
   ================================================ */

/* ================================================
   CSS Variables - デザインシステム定義
   ================================================ */
:root {
    /* アクセントカラー（機能的使用のみ） */
    --accent-color: #DE6787;
    --accent-hover: rgba(222, 103, 135, 0.85);

    /* 背景カラー（モノクローム） */
    --bg-primary: #FFFFFF;
    --bg-secondary: #FAFAFA;
    --bg-tertiary: #F5F5F5;

    /* テキストカラー（階層的） */
    --text-primary: #171717;
    --text-secondary: #525252;
    --text-muted: #A3A3A3;

    /* ボーダーカラー（控えめ） */
    --border-color: #E5E5E5;

    /* ステータスカラー */
    --danger-color: #DC2626;
    --danger-bg: #FEE2E2;
    --danger-text: #991B1B;
    --success-color: #16A34A;
    --success-bg: #DCFCE7;
    --success-text: #166534;

    /* シャドウ（控えめ） */
    --shadow-subtle: 0 1px 3px 0 rgba(0, 0, 0, 0.08);
    --shadow-card: 0 2px 8px 0 rgba(0, 0, 0, 0.06);

    /* トランジション */
    --transition-base: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --scale-active: 0.96;

    /* タイポグラフィスケール */
    --font-size-large: 1.75rem;
    --font-size-medium: 1.125rem;
    --font-size-base: 0.9375rem;
    --font-size-caption: 0.8125rem;

    /* 余白システム */
    --spacing-section: 4rem;
    --spacing-component: 2rem;
    --spacing-element: 1rem;
    --spacing-inner: 1.5rem;
}

/* ================================================
   Global Styles - 全体のベーススタイル
   ================================================ */
body {
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans JP", sans-serif;
    font-size: var(--font-size-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* タイポグラフィ階層 */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--spacing-element);
}

h1,
.h1 {
    font-size: var(--font-size-large);
}

h2,
.h2,
.h4 {
    font-size: var(--font-size-medium);
    font-weight: 500;
}

h3,
.h3,
h4,
h5,
h6 {
    font-size: var(--font-size-base);
    font-weight: 500;
}

p {
    margin-bottom: var(--spacing-element);
}

.small {
    font-size: var(--font-size-caption);
}

/* ブランドカラー適用 */
.text-brand {
    color: var(--accent-color) !important;
}

/* フォントウェイト */
.fw-bold {
    font-weight: 600 !important;
}

.fw-semibold {
    font-weight: 500 !important;
}

.fw-medium {
    font-weight: 500 !important;
}

/* ================================================
   Bootstrap Override - Bootstrapカラーオーバーライド
   ================================================ */

/* Primary Color (フラットデザイン) */
.btn-primary {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    box-shadow: none;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: none;
}

.btn-primary:focus,
.btn-primary:active,
.btn-check:checked+.btn-primary {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: none;
}

.btn-primary:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.btn-outline-primary {
    color: var(--accent-color);
    border-color: var(--border-color);
    background-color: transparent;
    box-shadow: none;
}

.btn-outline-primary:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--accent-color);
    box-shadow: none;
}

.btn-outline-primary:focus,
.btn-outline-primary:active {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--accent-color);
    box-shadow: none;
}

.bg-primary,
.badge.bg-primary {
    background-color: var(--accent-color) !important;
    color: white;
}

/* Link Colors */
a {
    color: var(--accent-color);
    text-decoration: none;
    transition: var(--transition-base);
}

a:hover {
    opacity: 0.85;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Form Controls */
.form-control,
.form-select {
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    font-size: var(--font-size-base);
    transition: var(--transition-base);
    box-shadow: none;
}

.form-control:hover,
.form-select:hover {
    border-color: var(--text-muted);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent-color);
    box-shadow: none;
    outline: none;
}

.form-control:focus-visible,
.form-select:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(222, 103, 135, 0.25);
    border-color: var(--accent-color);
}

/* ================================================
   Card Styles - カードコンポーネント（フラット）
   ================================================ */
.card {
    background-color: var(--bg-primary);
    border: none;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-subtle);
    transition: var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-card);
}

.card-body {
    padding: var(--spacing-inner);
}

.card.border-0 {
    border: none;
}

.card.shadow-sm,
.card.shadow-lg {
    box-shadow: var(--shadow-subtle);
}

/* ================================================
   Drop Zone Styles - ドラッグ&ドロップエリア
   ================================================ */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 0.5rem;
    padding: var(--spacing-section) var(--spacing-component);
    background-color: var(--bg-primary);
    transition: var(--transition-base);
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.drop-zone:hover {
    border-color: var(--accent-color);
    background-color: var(--bg-primary);
    transform: scale(1.005);
}

.drop-zone.drag-over {
    background-color: var(--bg-tertiary);
    border-color: var(--accent-color);
    border-style: solid;
    transform: scale(1.02);
    box-shadow: 0 0 0 4px rgba(222, 103, 135, 0.1);
}

/* ================================================
   Gallery Styles - ギャラリー関連
   ================================================ */
.uploaded-thumb,
.gallery-thumb {
    object-fit: contain;
    height: 220px;
    border-radius: 0.375rem;
    transition: var(--transition-base);
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
}

.gallery-thumb {
    box-shadow: var(--shadow-sm);
}

.gallery-card {
    cursor: pointer;
    transition: var(--transition-base);
    border: none;
}

.gallery-card:hover {
    box-shadow: var(--shadow-card);
}

.gallery-card .card-body {
    padding: var(--spacing-element);
}

.gallery-card .card-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gallery-card .card-text {
    color: var(--text-secondary);
    font-size: var(--font-size-caption);
}

/* モデル選択ラジオ（カード風） */
.model-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--bg-primary);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.model-option input[type="radio"] {
    margin: 0;
    accent-color: var(--primary-color, #0d6efd);
}

.model-option-body {
    flex: 1;
}

.model-option:hover {
    border-color: var(--primary-color, #0d6efd);
    box-shadow: var(--shadow-sm);
}

.model-option input[type="radio"]:checked+.model-option-body .fw-semibold {
    color: var(--primary-color, #0d6efd);
}

/* ================================================
   Button Styles - ボタンスタイル（フラット）
   ================================================ */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    font-size: var(--font-size-base);
    padding: 0.625rem 1.25rem;
    transition: var(--transition-base);
    border: 1px solid transparent;
    box-shadow: none;
}

.btn:hover,
.btn:focus {
    transform: translateY(-1px);
    box-shadow: var(--shadow-subtle);
}

.btn:active {
    transform: scale(var(--scale-active));
    box-shadow: none;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: var(--font-size-caption);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: var(--font-size-base);
}

.btn-outline-secondary {
    border-color: var(--border-color);
    color: var(--text-secondary);
    background-color: transparent;
}

.btn-outline-secondary:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-outline-secondary:focus,
.btn-outline-secondary:active {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-outline-danger {
    border-color: var(--border-color);
    color: var(--danger-color);
    background-color: transparent;
}

.btn-outline-danger:hover {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

.btn-outline-danger:focus,
.btn-outline-danger:active {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

/* ================================================
   Modal Styles - モーダルスタイル
   ================================================ */
.modal-content {
    border-radius: 0.5rem;
    border: none;
    box-shadow: var(--shadow-card);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-inner);
}

.modal-body {
    padding: var(--spacing-inner);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-inner);
}

.modal-title {
    font-weight: 500;
    color: var(--text-primary);
    font-size: var(--font-size-medium);
}

.detail-modal-footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
}

.detail-modal-footer .detail-footer-primary {
    display: flex;
}

.detail-modal-footer .detail-footer-primary .detail-action {
    width: 100%;
}

.detail-modal-footer .detail-primary-action {
    border-width: 1px;
    border-style: solid;
    border-color: var(--accent-color);
}

.detail-modal-footer .detail-footer-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.detail-modal-footer .detail-footer-actions .detail-action {
    width: auto;
}

.detail-modal-footer .detail-icon-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.detail-modal-footer .btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
}


/* ================================================
   Form Styles - フォーム要素
   ================================================ */
.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: var(--font-size-base);
}

textarea.form-control {
    resize: vertical;
}

/* ================================================
   Badge & Tags - バッジとタグ
   ================================================ */
.badge {
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    font-weight: 500;
    font-size: var(--font-size-caption);
}

/* Prompt Preset Buttons */
.prompt-preset-btn {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: var(--transition-base);
    font-size: var(--font-size-caption);
    font-weight: 500;
}

.prompt-preset-btn:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.prompt-preset-btn.active {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

/* お気に入りボタンのスタイル（控えめに） */
.prompt-favorite-btn {
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.prompt-favorite-btn:hover {
    opacity: 1;
}

.prompt-favorite-btn svg {
    pointer-events: none;
}

/* ================================================
   Toast Notifications - 通知トースト
   ================================================ */
.toast-container .toast {
    min-width: 280px;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
}

.toast-header {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: var(--font-size-base);
}

.toast-body {
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    font-size: var(--font-size-base);
}

/* トーストの固定幅カラーライン */
.toast-accent {
    position: relative;
    border-left: 4px solid transparent;
    padding-left: 0.75rem;
    background-color: var(--bg-primary);
}

.toast-accent-success {
    border-left-color: var(--bs-success);
}

.toast-accent-danger {
    border-left-color: var(--bs-danger);
}

.toast-accent-warning {
    border-left-color: var(--bs-warning);
}

.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.toast.show {
    animation: toastSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ================================================
   Progress Bar - 進捗バー
   ================================================ */
.progress {
    background-color: var(--bg-tertiary);
    border-radius: 0.375rem;
    overflow: hidden;
    height: 0.5rem;
}

.progress-bar {
    background-color: var(--accent-color);
    transition: width 0.6s ease;
}

/* ================================================
   Alert Styles - アラート
   ================================================ */
.alert {
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    padding: var(--spacing-element) var(--spacing-inner);
    font-size: var(--font-size-base);
}

.alert-danger {
    background-color: var(--danger-bg);
    color: var(--danger-text);
    border-color: var(--danger-color);
}

.alert-success {
    background-color: var(--success-bg);
    color: var(--success-text);
    border-color: var(--success-color);
}

.alert-info {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

/* ================================================
   Usage Summary - 利用状況表示
   ================================================ */
#usage-summary {
    min-width: 180px;
    max-width: 220px;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.usage-summary.compact .usage-progress {
    height: 4px;
    background-color: var(--bg-tertiary);
}

.usage-summary .usage-badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.5rem;
}

.usage-summary .usage-remaining {
    line-height: 1.1;
}

@media (max-width: 991.98px) {
    .usage-summary {
        max-width: 180px;
    }

    .usage-summary .usage-remaining {
        display: none;
    }
}

/* ナビゲーションの折り返し防止 */
.navbar .navbar-nav {
    white-space: nowrap;
}

/* 5列レイアウト（LG以上） */
@media (min-width: 992px) {
    .col-lg-5th {
        flex: 0 0 20%;
        max-width: 20%;
    }
}

/* ================================================
   Utility Classes - ユーティリティクラス
   ================================================ */
.text-muted {
    color: var(--text-muted) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.text-primary {
    color: var(--text-primary) !important;
}

.border {
    border-color: var(--border-color) !important;
}

.border-top {
    border-top-color: var(--border-color) !important;
}

.rounded {
    border-radius: 0.375rem !important;
}

.shadow-sm,
.shadow,
.shadow-lg {
    box-shadow: var(--shadow-subtle) !important;
}

/* 余白ユーティリティ */
.mb-5 {
    margin-bottom: var(--spacing-section) !important;
}

.mt-5 {
    margin-top: var(--spacing-section) !important;
}

.mb-4 {
    margin-bottom: var(--spacing-component) !important;
}

.mt-4 {
    margin-top: var(--spacing-component) !important;
}

/* ================================================
   Responsive Design - レスポンシブ対応
   ================================================ */
@media (max-width: 991.98px) {
    .drop-zone {
        padding: 2rem 1rem;
    }

    .btn {
        padding: 0.5rem 1rem;
    }
}

@media (max-width: 767.98px) {
    .drop-zone {
        padding: 1.5rem 0.75rem;
    }

    .uploaded-thumb,
    .gallery-thumb {
        height: 160px;
    }

    #usage-summary {
        min-width: 0;
        text-align: center;
        font-size: 0.75rem;
    }

    .card-body {
        padding: 1rem;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }

    /* Mobile FAB for Start Button */
    #start-conversion {
        position: fixed;
        bottom: 1.5rem;
        right: 1.5rem;
        z-index: 1050;
        border-radius: 50px;
        padding: 1rem 2rem;
        box-shadow: 0 4px 12px rgba(222, 103, 135, 0.4);
        width: auto;
        min-width: 160px;
        display: flex;
        justify-content: center;
        align-items: center;
        animation: fabSlideUp 0.5s ease-out;
    }

    @keyframes fabSlideUp {
        from {
            transform: translateY(100px);
            opacity: 0;
        }

        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    /* モバイル用に推定クレジット表示位置調整 */
    #estimated-credit {
        text-align: center;
        margin-bottom: 5rem;
        /* FABの分だけ余白を確保 */
    }

    /* Mobile Bottom Sheet for Options */
    #generation-options-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1060;
        margin: 0 !important;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        transform: translateY(110%);
        transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1);
        max-height: 80vh;
        overflow-y: auto;
    }

    #generation-options-container.show {
        transform: translateY(0);
    }

    #generation-options-container .card-body {
        padding: 1.5rem;
    }

    /* Overlay */
    .sheet-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1055;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        backdrop-filter: blur(2px);
    }

    .sheet-overlay.show {
        opacity: 1;
        pointer-events: auto;
    }

    /* Sheet Handle */
    #generation-options-container::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: #e0e0e0;
        border-radius: 2px;
        margin: 10px auto 5px;
    }
}

@media (max-width: 575.98px) {

    .uploaded-thumb,
    .gallery-thumb {
        height: 220px;
        object-fit: contain;
    }

    .gallery-card .card-title {
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .toast-container {
        left: 0;
        right: 0;
        padding: 1rem;
    }

    .toast-container .toast {
        min-width: 100%;
    }

    .btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }

    h2.h4 {
        font-size: 1.25rem;
    }
}



/* User Avatar */
.user-avatar {
    width: 36px;
    height: 36px;
    background-color: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition-base);
    border: 1px solid var(--border-color);
}

.user-avatar:hover {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.user-avatar-link::after {
    display: none;
    /* Hide default dropdown arrow */
}

/* ================================================
   Navigation Styles - ナビゲーション
   ================================================ */
.navbar {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-element) 0;
}

.navbar-light {
    border-bottom: 1px solid var(--border-color);
}

.navbar-brand {
    font-size: var(--font-size-medium);
    font-weight: 600;
    letter-spacing: -0.01em;
    transition: var(--transition-base);
    color: var(--text-primary);
}

.brand-logo {
    height: 32px;
    width: auto;
    display: block;
}

.navbar-brand:hover {
    opacity: 0.8;
    color: var(--text-primary);
}

.navbar-light .nav-link {
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: var(--transition-base);
}

.navbar-light .nav-link:hover {
    color: var(--accent-color);
    background-color: var(--bg-tertiary);
}

.navbar-light .nav-link.active {
    color: var(--accent-color);
    font-weight: 500;
}

/* ================================================
   Dark Elements - ダークテーマ要素（非推奨）
   ================================================ */
.navbar-dark,
.bg-dark {
    background-color: #1F2937 !important;
}

.navbar-dark .navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
    color: white !important;
}

.navbar-dark .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    transition: var(--transition-base);
}

.navbar-dark .nav-link:hover {
    color: var(--accent-light) !important;
}

footer.bg-dark {
    background-color: #111827 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ================================================
   Footer Styles - フッター
   ================================================ */
footer {
    margin-top: 4rem;
}

footer .border-top {
    border-color: var(--border-light) !important;
}

/* ================================================
   Animation & Effects - アニメーションとエフェクト
   ================================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.2s ease;
}

/* Focus Visible（アクセシビリティ） */
*:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 0.25rem;
}

/* コンテナ余白 */
.container {
    padding-left: var(--spacing-component);
    padding-right: var(--spacing-component);
}

main.container {
    margin-top: var(--spacing-component);
    margin-bottom: var(--spacing-section);
}

/* ================================================
   Hamburger Menu Animation
   ================================================ */
.custom-toggler:focus {
    box-shadow: none;
}

.hamburger-lines {
    width: 24px;
    height: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-lines .line {
    display: block;
    height: 2px;
    width: 100%;
    border-radius: 10px;
    background: var(--text-primary);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    transform-origin: center;
}

/* Animation State (Expanded) */
.navbar-toggler[aria-expanded="true"] .line1 {
    transform: translateY(9px) rotate(45deg);
}

.navbar-toggler[aria-expanded="true"] .line2 {
    opacity: 0;
    transform: translateX(-10px);
}

.navbar-toggler[aria-expanded="true"] .line3 {
    transform: translateY(-9px) rotate(-45deg);
}

/* ================================================
   AI Improve Button Animation
   ================================================ */
@keyframes pulse-glow-primary {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.4);
    }

    70% {
        transform: scale(1.02);
        box-shadow: 0 0 0 6px rgba(13, 110, 253, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
    }
}

#improve-prompt-btn {
    animation: pulse-glow-primary 2s infinite;
    transition: all 0.3s ease;
}

#improve-prompt-btn:hover {
    animation: none;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

/* ================================================
   Mobile Menu Refinement */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: var(--bg-primary);
        border-top: 1px solid var(--bg-tertiary);
        margin-top: 1rem;
        padding-bottom: 1rem;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
        border-radius: 0 0 1rem 1rem;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 1000;
        padding: 1rem var(--spacing-component);
    }

    .navbar-nav .nav-link {
        padding: 1rem 0;
        font-size: 1.1rem;
        border-bottom: 1px solid var(--bg-tertiary);
    }

    .navbar-nav .nav-item:last-child .nav-link {
        border-bottom: none;
    }
}

/* ================================================
   Loading Animation - ローディングアニメーション
   ================================================ */

/* Keyframes */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(222, 103, 135, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(222, 103, 135, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(222, 103, 135, 0);
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gradient-bg {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Loading Card */
.loading-card {
    position: relative;
    background: var(--bg-primary);
    border-radius: 1rem;
    padding: 3rem 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    text-align: center;
    max-width: 600px;
    margin: 4rem auto;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.loading-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #DE6787, #FDA4AF, #DE6787);
    background-size: 200% 200%;
    animation: gradient-bg 3s ease infinite;
}

/* AI Spinner */
.ai-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    border-radius: 50%;
    background: var(--bg-primary);
}

.ai-spinner::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--accent-color);
    border-right-color: var(--accent-color);
    animation: spin 1.5s linear infinite;
}

.ai-spinner::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-bottom-color: rgba(222, 103, 135, 0.5);
    border-left-color: rgba(222, 103, 135, 0.5);
    animation: spin 2s linear infinite reverse;
}

.ai-spinner-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: var(--accent-color);
    border-radius: 50%;
    animation: pulse-glow 2s infinite;
}

/* Status Text */
.status-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    min-height: 1.8rem;
    transition: opacity 0.3s ease;
}

.sub-status-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Progress Bar Custom */
.progress-bar-custom-container {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 2.5rem;
    position: relative;
}

.progress-bar-custom {
    height: 100%;
    background: var(--accent-color);
    border-radius: 3px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-bar-custom::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-20deg) translateX(-150%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: skewX(-20deg) translateX(-150%);
    }

    100% {
        transform: skewX(-20deg) translateX(150%);
    }
}

/* Tips Container */
.tips-container {
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.tips-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tips-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-style: italic;
    animation: fade-in-up 0.5s ease;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Multiple Processing specific */
.conversion-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-dot-pending {
    background-color: var(--text-muted);
}

.status-dot-processing {
    background-color: var(--accent-color);
    animation: pulse-glow 1.5s infinite;
}

.status-dot-completed {
    background-color: var(--success-color);
}

.status-dot-failed {
    background-color: var(--danger-color);
}
