/*
 * 推し活ログ デザインシステム V3: "Celestial"
 * ----------------------------
 * 動的な最推しカラーをCSS変数で管理
 */
:root {
    --oshi-color-start: #eed9ee; /* デフォルトの開始色 (淡い紫) */
    --oshi-color-end: #dcb3e3;   /* デフォルトの終了色 (やや濃い紫) */
    --text-color: #333;
}

/* きらめきアニメーション */
@keyframes glitter {
    0% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0.5; }
}

/* ボタンホバー時のキラキラエフェクト */
@keyframes sparkle {
    0% { 
        transform: translateX(-50%) translateY(-50%) scale(0); 
        opacity: 1; 
    }
    50% { 
        transform: translateX(-50%) translateY(-50%) scale(1); 
        opacity: 0.8; 
    }
    100% { 
        transform: translateX(-50%) translateY(-50%) scale(0); 
        opacity: 0; 
    }
}

/* 基本設定 & 動的背景 */
body {
    color: var(--text-color);
    background: linear-gradient(135deg, var(--oshi-color-start), var(--oshi-color-end));
    transition: background 0.5s ease;
    font-family: 'Noto Sans JP', sans-serif;
    position: relative;
    overflow-x: hidden;
}
/* 背景のきらめき */
body::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.4) 1px, transparent 1.5px),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,0.3) 1px, transparent 1.5px);
    animation: glitter 10s infinite alternate;
    pointer-events: none; /* 背景要素がクリックを妨げないようにする */
    z-index: -1; /* 背景を最背面に配置 */
}

/* -------------------------
 * 装飾付き見出し
 * ------------------------- */
h1, h2, h3 {
    position: relative;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
}
h1::before, h2::before {
    content: '◇';
    color: #ffd700;
    margin-right: 0.75rem;
    font-size: 0.8em;
    opacity: 0.8;
}

/* -------------------------
 * ナビゲーションバー
 * ------------------------- */
.navbar {
    background: linear-gradient(to right, #ffffff, #fdfcff) !important;
    box-shadow: 0 4px 12px rgba(155, 137, 179, 0.08);
}
.navbar-brand {
    color: #9b89b3 !important;
    font-weight: 700;
}

/* -------------------------
 * ボタン
 * ------------------------- */
.btn {
    border-radius: 50px; /* pill shape */
    font-weight: 700;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: none;
    cursor: pointer; /* Ensure pointer cursor */
    pointer-events: auto; /* 確実にクリック可能にする */
    z-index: 1; /* 他の要素に隠れないようにする */
}
.btn-primary {
    background: linear-gradient(135deg, #fceabb 0%, #f8b500 100%);
    color: #4a3800;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    transform: translateY(0);
}
.btn-primary:hover {
    color: #4a3800;
    background: linear-gradient(135deg, #fdf2d0 0%, #ffc107 100%);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.7);
    transform: translateY(-2px);
}
.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.5);
}

/* 大きなボタン（ログ投稿ボタン）の特別なエフェクト */
.btn-lg {
    position: relative;
    overflow: hidden;
}
.btn-lg:hover {
    transform: translateY(-3px) scale(1.02);
}
.btn-lg:active {
    transform: translateY(-1px) scale(1.01);
}

/* ホバー時のキラキラエフェクト */
.btn-lg:hover::before {
    content: '✨';
    position: absolute;
    top: 50%;
    left: 20%;
    animation: sparkle 1.5s infinite;
    pointer-events: none;
}
.btn-lg:hover::after {
    content: '✨';
    position: absolute;
    top: 30%;
    right: 20%;
    animation: sparkle 1.5s infinite 0.5s;
    pointer-events: none;
}

.btn-secondary {
    background-color: rgba(108, 117, 125, 0.9);
    border: 1px solid rgba(108, 117, 125, 1);
    color: #ffffff;
    backdrop-filter: blur(2px);
}
.btn-secondary:hover {
    background-color: rgba(90, 98, 104, 1);
    border-color: rgba(90, 98, 104, 1);
    color: #ffffff;
    transform: translateY(-1px);
}
.btn-secondary:focus {
    background-color: rgba(90, 98, 104, 1);
    border-color: rgba(90, 98, 104, 1);
    color: #ffffff;
    box-shadow: 0 0 0 0.25rem rgba(108, 117, 125, 0.25);
}
.btn-secondary:active {
    background-color: rgba(73, 80, 87, 1);
    border-color: rgba(73, 80, 87, 1);
    color: #ffffff;
    transform: translateY(0);
}

/* btn-warning のカスタマイズ */
.btn-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffc107 100%);
    border: 1px solid #ffb302;
    color: #664d03;
    font-weight: 700;
}
.btn-warning:hover {
    background: linear-gradient(135deg, #ffecb5 0%, #ffb302 100%);
    border-color: #ff9a00;
    color: #664d03;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}
.btn-warning:focus {
    background: linear-gradient(135deg, #ffecb5 0%, #ffb302 100%);
    border-color: #ff9a00;
    color: #664d03;
    box-shadow: 0 0 0 0.25rem rgba(255, 193, 7, 0.25);
}
.btn-warning:active {
    background: linear-gradient(135deg, #ffe69c 0%, #ff9a00 100%);
    border-color: #ff8800;
    color: #664d03;
    transform: translateY(0);
}

/* btn-outline-secondary のカスタマイズ */
.btn-outline-secondary {
    background-color: transparent;
    border: 2px solid rgba(108, 117, 125, 0.8);
    color: #6c757d;
    font-weight: 600;
}
.btn-outline-secondary:hover {
    background-color: rgba(108, 117, 125, 0.9);
    border-color: rgba(108, 117, 125, 1);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}
.btn-outline-secondary:focus {
    background-color: rgba(108, 117, 125, 0.9);
    border-color: rgba(108, 117, 125, 1);
    color: #ffffff;
    box-shadow: 0 0 0 0.25rem rgba(108, 117, 125, 0.25);
}
.btn-outline-secondary:active {
    background-color: rgba(90, 98, 104, 1);
    border-color: rgba(90, 98, 104, 1);
    color: #ffffff;
    transform: translateY(0);
}

/* 小さなボタン（btn-sm）の調整 */
.btn-sm {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 25px;
}
.btn-sm:hover {
    transform: translateY(-1px);
}
.btn-sm:active {
    transform: translateY(0);
}

/* ボタンのアクセシビリティ向上 */
.btn:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* ボタンの無効状態 */
.btn:disabled,
.btn.disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* モーダルの閉じるボタン（btn-close）のカスタマイズ */
.btn-close {
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    opacity: 0.8;
    transition: all 0.3s ease;
}
.btn-close:hover {
    background-color: rgba(220, 53, 69, 0.1);
    opacity: 1;
    transform: scale(1.1);
}
.btn-close:focus {
    background-color: rgba(220, 53, 69, 0.1);
    opacity: 1;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* -------------------------
 * 画像の最適化
 * ------------------------- */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* 推しの画像（ダッシュボード）の最適化 */
.img-fluid.rounded-circle {
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* -------------------------
 * カード
 * ------------------------- */
.card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(118, 92, 133, 0.2);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
}

/* クリック可能なカード用のホバーエフェクト */
.card-interactive:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px 0 rgba(118, 92, 133, 0.3);
    cursor: pointer;
}

.card-img-top {
    width: 100%;
    aspect-ratio: 1 / 1; /* 画像を正方形に保つ */
    object-fit: cover;   /* 画像を歪ませずにコンテナを埋める */
}

/* -------------------------
 * 推し一覧ページ
 * ------------------------- */
.card-main-oshi {
    border-width: 2px;
}

.card-main-oshi .card-body {
    padding: 2rem;
}

/* -------------------------
 * 特殊カード（ダッシュボード用）
 * ------------------------- */
.card.card-accent {
    background: linear-gradient(135deg, #b3a2c7, #9b89b3);
    box-shadow: 0 8px 24px rgba(155, 137, 179, 0.3);
}

/* -------------------------
 * タイムライン / リスト
 * ------------------------- */
.timeline-item {
    display: block;
    padding: 1.5rem;
    margin-bottom: 1rem;
    text-decoration: none;
    background-color: rgba(255, 255, 255, 0.7);
    color: var(--text-color);
    border-radius: 16px !important;
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 12px rgba(155, 137, 179, 0.08);
    transition: all 0.2s ease-in-out;
}
.timeline-item:hover {
    transform: translateY(-3px);
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 6px 16px rgba(155, 137, 179, 0.15);
}
.timeline-item h5 {
    color: #8a6db1;
    font-weight: 700;
}

/* -------------------------
 * フォーム
 * ------------------------- */
.form-control, .form-select {
    background-color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.7);
    color: var(--text-color);
    border-radius: 0.5rem;
}
.form-control:focus, .form-select:focus {
    background-color: rgba(255, 255, 255, 0.8);
    border-color: #fff;
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
    color: var(--text-color);
}
.form-control::placeholder {
    color: var(--text-color-muted);
}
.form-label {
    font-weight: 600;
}

/* -------------------------
 * その他の推しカード
 * ------------------------- */
.card-oshi {
    transition: all 0.3s ease;
}

/* -------------------------
 * モーダル
 * ------------------------- */
.modal-content {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-color);
}
.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
} 