﻿html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
    background: #f8f8f8; /* 白に近い背景 */
    color: #333; /* テキストカラーを調整 */
    min-height: 100vh; /* ビューポートの高さに合わせる */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

/* グラスモーフィズム関連のスタイルを削除し、フラットなデザインに */

/* カード要素のスタイル調整 */
.card {
    border: none; /* ボーダーを削除 */
    border-radius: 8px; /* 少し角丸 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); /* 控えめな影 */
    background-color: #fff; /* 白い背景 */
    overflow: hidden;
}

/* リストグループアイテムのスタイル調整 (カートアイテムなど) */
.list-group-item {
    background-color: #fff !important; /* 白い背景 */
    border-bottom: 1px solid #f0f0f0 !important; /* 薄い下線ボーダー */
    padding: 15px; /* パディング調整 */
    color: #333;
}
.list-group-item:last-child {
    border-bottom: none !important;
}

/* サイドバーのカートサマリーのカードフッター */
.card-footer {
    background-color: #f8f8f8 !important; /* 薄いグレーの背景 */
    border-top: 1px solid #f0f0f0 !important; /* 薄いボーダー */
    color: #333;
    padding: 15px;
}

/* バッジのスタイル調整 */
.badge {
    border-radius: 4px;
    padding: 0.4em 0.7em;
    font-weight: 500;
    font-size: 0.85em;
}

/* ナビゲーションバーのスタイル調整 */
.navbar {
    background-color: #fff !important; /* 白い背景 */
    border-bottom: 1px solid #f0f0f0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03); /* 非常に控えめな影 */
}
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: #333 !important;
}
.nav-link {
    font-weight: 500;
    color: #555 !important;
}
.nav-link:hover {
    color: #007bff !important; /* ホバー時の色 */
}

/* ボタンのスタイル調整 */
.btn {
    border-radius: 50px; /* 丸いボタン */
    padding: 12px 30px; /* パディング */
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease-in-out;
    background-color: #fff; /* 白い背景 */
    color: #333; /* テキストカラー */
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); /* 控えめな影 */
}

.btn:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); /* ホバー時の影を強調 */
}

/* Primary Button (カートに追加など) */
.btn-primary {
    padding: 0; /* paddingを削除して子要素で制御 */
    background-image: linear-gradient(90deg, #ff6a88, #ad8bf1, #87ceeb);
    color: #fff !important; /* ボタン本体のテキストを白色に変更 */
    display: inline-flex; /* flexコンテナとして設定 */
    align-items: center; /* 垂直方向中央揃え */
    justify-content: center; /* 水平方向中央揃え */
    min-width: 120px; /* ボタンの最小幅を設定 */
    min-height: 48px; /* ボタンの最小高さを設定 (padding 12px*2 + font-size 1rem + line-height) */
    border: none;
}

/* Primary Buttonの内部要素 */
.btn-primary .inner-bg {
    position: absolute;
    top: 1px;
    left: 1px;
    right: 1px;
    bottom: 1px;
    background-color: #fff; /* 白い背景 */
    border-radius: 49px; /* ボタン本体より1px小さい角丸 */
    transition: opacity 0.3s ease-in-out;
    z-index: 1; /* テキストより下 */
}

/* Primary Buttonのテキスト要素 */
.btn-primary .text-content {
    position: relative;
    z-index: 2; /* 背景より上 */
    color: #333; /* デフォルトのテキストカラー */
    padding: 12px 30px; /* 元のpaddingをテキストに適用 */
}

.btn-primary:hover .inner-bg {
    opacity: 0; /* ホバー時に白い背景を透明にする */
}

.btn-primary:hover .text-content {
    color: #fff; /* ホバー時にテキストを白くする */
    transition: color 0.3s ease-in-out; /* テキストカラーの変化をスムーズに */
}

/* inner-bgやtext-contentクラスを持たないシンプルなbtn-primaryボタン用のスタイル */
.btn-primary:not(:has(.inner-bg)):not(:has(.text-content)) {
    color: #fff !important; /* 常に白色のテキスト */
    padding: 12px 30px; /* 通常のパディング */
}

.btn-primary:not(:has(.inner-bg)):not(:has(.text-content)):hover {
    opacity: 0.9; /* ホバー時に少し透明に */
}

/* Secondary Button (詳細を見る、製品一覧に戻るなど) */
.btn-secondary {
    background-color: #f0f0f0 !important;
    color: #555 !important;
    box-shadow: none;
    border: 1px solid #e0e0e0 !important;
    background-image: none !important;
}
.btn-secondary:hover {
    background-color: #d0d0d0 !important; /* ホバー前より少し濃いグレー */
    box-shadow: none;
}

/* Outline Primary Button (カートを見るボタン用) */
.btn-outline-primary {
    background: transparent !important;
    color: #ff6a88 !important;
    border: 1px solid #ff6a88 !important;
    box-shadow: none;
    background-image: none !important;
}
.btn-outline-primary:hover {
    background-color: transparent; /* 背景色を透明に */
    background-image: linear-gradient(#fff, #fff), linear-gradient(90deg, #ff6a88, #ad8bf1, #87ceeb) !important;
    color: #fff !important;
    box-shadow: none;
}

/* Danger Button (削除ボタンなど) */
.btn-danger {
    background-color: #dc3545 !important;
    color: #fff !important;
    box-shadow: none;
    border: 1px solid #dc3545 !important;
    background-image: none !important;
}
.btn-danger:hover {
    background-color: #c82333 !important; /* ホバー前より少し濃い赤 */
    box-shadow: none;
}

/* フォームコントロールのスタイル調整 */
.form-control {
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}
.form-control:focus {
    border-color: #a0d9f0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* トーストのスタイル調整 */
.toast-container {
    z-index: 1020; /* 他の要素より前面に */
}
.toast {
    background: linear-gradient(36deg, rgb(255 228 232 / 50%), rgb(217 240 247 / 50%)) !important; /* グラスモーフィズム背景 */
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    color: #333; /* テキストカラー調整 */
}

@media (max-width: 767.98px) {
    .toast-container {
        position: fixed;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 90%; /* モバイルでの幅を調整 */
        max-width: 350px; /* 最大幅を設定 */
    }
}

.toast-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: #333; /* テキストカラー調整 */
}

.toast-body {
    background: transparent !important;
    color: #333; /* テキストカラー調整 */
}

/* モーダルのスタイル調整 */
.modal-content {
    background: linear-gradient(36deg, rgb(255 228 232 / 50%), rgb(217 240 247 / 50%)) !important; /* グラスモーフィズム背景 */
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    color: #333; /* テキストカラー調整 */
}

.modal-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: #333; /* テキストカラー調整 */
}

.modal-body {
    background: transparent !important;
    color: #333; /* テキストカラー調整 */
}

.modal-footer {
    background: transparent !important;
    border-top: 1px solid rgba(255, 255, 255, 0.3) !important;
}

/* モーダルバックドロップのスタイル調整 */
.modal-backdrop {
    background-color: #d3d3d3; /* 薄いグレー */
    opacity: 0.5; /* 半透明 */
}

/* フッターリンクのスタイル調整 */
.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* 中央寄せ */
    align-items: center; /* 垂直方向中央寄せ */
    text-align: center;
}

.footer-links > div {
    margin: 0 5px; /* リンク間のスペース */
}

@media (max-width: 767.98px) {
    /* フッターのスタイル調整 */
    .footer {
        padding: 10px 0; /* 上下のパディングを減らす */
        margin-top: 10px !important; /* 上マージンを減らす */
    }

    /* フッターリンクの縦並び */
    .footer-links {
        flex-direction: column; /* 縦並び */
        align-items: center; /* 中央寄せ */
        padding: 0; /* 既に.footerで調整済みなので0にする */
    }

    .footer-links > div {
        margin: 2px 0; /* 縦方向のスペースを減らす */
        line-height: 1.2; /* 行の高さを調整 */
    }

    /* jumbotron要素のpaddingをモバイルで0にする */
    .jumbotron.p-5 { /* p-5クラスを持つjumbotronに適用 */
        padding: 0 !important; /* Bootstrapのユーティリティクラスを上書き */
    }
}

/* カートボタンのラッパー */
.cart-buttons-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px; /* card-bodyのパディングに合わせる */
    background-color: #fff; /* サイドバーの背景色と合わせる */
    border-top: 1px solid #f0f0f0;
    z-index: 1000; /* 他のコンテンツより手前 */
}

/* サイドバーの削除ボタンのスタイル調整 */
.btn-sm.remove-item-btn {
    width: 30px;  /* 適切なサイズに調整 */
    height: 30px; /* 適切なサイズに調整 */
    padding: 0;   /* パディングを0にして、アイコンが中央に来るように調整 */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%; /* 正円にする */
}

/* 追従カートボタンのスタイル */
#floatingCartButton {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050; /* サイドバーより手前 */
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: none; /* デフォルトで非表示 */
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    /* btn-primaryのグラデーションを適用 */
    background-image: linear-gradient(90deg, #ff6a88, #ad8bf1, #87ceeb);
    color: #fff !important; /* アイコン色を白に */
    border: none;
}

#floatingCartButton:hover {
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

    /* モバイル表示時のサイドバーの非表示とメインコンテンツの調整 */
    @media (max-width: 767.98px) {
        /* サイドバーの非表示 */
        .sidebar-col { /* 新しく追加するクラス */
            display: none;
        }
        /* メインコンテンツを全幅にする */
        .main-content-col { /* 新しく追加するクラス */
            width: 100%;
            max-width: 100%; /* flex-basis と flex-grow をリセット */
            /* flex: 0 0 100%; */ /* この行は削除 */
        }

        /* モバイル用サイドバー */
        #cartSidebar {
            position: fixed;
            top: 0;
            right: 0;
            height: 100%;
            width: 300px; /* サイドバーの幅 */
            background: linear-gradient(36deg, rgb(255 228 232 / 90%), rgb(217 240 247 / 90%)); /* 少し濃いめのグラスモーフィズム */
            backdrop-filter: blur(15px);
            -webkit-backdrop-filter: blur(15px);
            box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
            transform: translateX(100%); /* 初期状態は非表示（右にずらす） */
            transition: transform 0.3s ease-in-out;
            z-index: 1000; /* 他のコンテンツより手前 */
            padding: 20px; /* 適切なパディング */
            /* overflow-y: auto; */ /* この行は削除 */
            display: flex !important; /* モバイルで常にフレックスボックスとして扱う */
            flex-direction: column; /* 縦方向に要素を並べる */
        }

        #cartSidebar .card-body {
            overflow-y: auto; /* カートアイテムリストのみをスクロール可能にする */
        }

        #cartSidebar.show {
            transform: translateX(0); /* 表示状態（元の位置に戻す） */
        }

        /* サイドバーが開いているときのオーバーレイ */
        .sidebar-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5); /* 半透明の黒 */
            z-index: 999; /* サイドバーより奥、コンテンツより手前 */
            display: none; /* 初期状態は非表示 */
        }

        .sidebar-overlay.show {
            display: block;
        }

        /* モバイル表示時にフローティングボタンを表示 */
        #floatingCartButton {
            display: flex;
        }

        /* モバイル用追従カートボタンコンテナ */
        #floatingCartButtonsContainer {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            background-color: #fff; /* サイドバーの背景色と合わせる */
            box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
            z-index: 1010; /* サイドバーより手前 */
            display: none; /* デフォルトで非表示 */
        }
    }

/* フローティングカートボタンが開いている状態のスタイル */
#floatingCartButton.sidebar-open {
    background-image: linear-gradient(90deg, #dc3545, #dc3545); /* 赤色など、閉じるを示す色 */
    transform: rotate(90deg); /* 必要に応じて回転 */
}


/* ローディングオーバーレイ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8); /* 半透明の白 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* 他の要素の上に表示 */
    visibility: hidden; /* デフォルトで非表示 */
    opacity: 0;
    transition: visibility 0s, opacity 0.3s linear;
}

.loading-overlay.show {
    visibility: visible;
    opacity: 1;
}

/* ローディングスピナー */
.loading-spinner {
    border: 8px solid #f3f3f3; /* Light grey */
    border-top: 8px solid #3498db; /* Blue */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ローディングテキスト */
.loading-text {
    margin-top: 15px;
    font-size: 1.2em;
    color: #333;
}

/* ナビゲーションメニューのスタイル */
.navbar {
    padding-left: 0;
    padding-right: 0;
}

.navbar-brand {
    flex-grow: 0 !important;
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.user-menu {
    font-size: 0.9rem;
}

.user-menu .dropdown-item {
    padding: 0.5rem 1rem;
}

.user-menu .dropdown-divider {
    margin: 0.5rem 0;
}

.user-name {
    font-weight: 500;
    color: #333;
}

.user-email {
    font-size: 0.85rem;
    color: #666;
}

/* モバイル表示: ドロップダウンを通常のメニュー項目として表示 */
@media (max-width: 575.98px) {
    .user-menu .dropdown-toggle::after {
        display: none;
    }
    
    .user-menu .dropdown-menu {
        position: static !important;
        transform: none !important;
        border: none;
        box-shadow: none;
        padding: 0;
        margin: 0;
        background-color: transparent;
    }
    
    .user-menu .dropdown-item {
        color: rgba(0,0,0,.55);
        padding: 0.5rem 1rem;
    }
    
    .user-menu .dropdown-item:hover,
    .user-menu .dropdown-item:focus {
        background-color: #e9ecef;
        color: rgba(0,0,0,.7);
    }
    
    .user-menu .dropdown-divider {
        border-top: 1px solid rgba(0,0,0,.15);
        margin: 0.5rem 0;
    }
    
    .user-menu .dropdown-item-text {
        padding: 0.5rem 1rem;
    }
    
    /* モバイルではドロップダウンを常に表示 */
    .user-menu .dropdown-menu {
        display: block !important;
    }
    
    /* モバイルではユーザーアイコンリンク自体を非表示（メニュー項目のみ表示） */
    .user-menu .nav-link.dropdown-toggle {
        display: none;
    }
}

/* PC表示: 通常のドロップダウン動作 */
@media (min-width: 576px) {
    .user-menu .dropdown-menu {
        display: none;
    }
    
    .user-menu .dropdown-menu.show {
        display: block;
    }
}

/* ライセンス管理画面のスタイル */
.badge {
    color: #333 !important; /* バッジのテキスト色を濃い色に */
}

/* ライセンス管理画面の特定のバッジスタイル */
.badge.bg-info {
    background-color: #d1ecf1 !important; /* 薄い青背景 */
    color: #0c5460 !important; /* 濃い青文字 */
}

.badge.bg-success {
    background-color: #d4edda !important; /* 薄い緑背景 */
    color: #155724 !important; /* 濃い緑文字 */
}

.badge.bg-warning {
    background-color: #fff3cd !important; /* 薄い黄色背景 */
    color: #856404 !important; /* 濃い黄色文字 */
}

.badge.bg-danger {
    background-color: #f8d7da !important; /* 薄い赤背景 */
    color: #721c24 !important; /* 濃い赤文字 */
}

.badge.bg-secondary {
    background-color: #e2e3e5 !important; /* 薄いグレー背景 */
    color: #383d41 !important; /* 濃いグレー文字 */
}

/* テーブル内のバッジ（ドメイン名など） */
table .badge {
    background-color: #e9ecef !important; /* 薄いグレー背景 */
    color: #495057 !important; /* 濃いグレー文字 */
    padding: 0.5em 0.75em;
    font-weight: 500;
}
