/* app.css - Vue 3 App Template */

body {
    font-family: "Biz UDPGothic", "Noto Sans JP", sans-serif;
}

/* プルトゥリフレッシュ無効化 */
body, html {
    overscroll-behavior-y: contain;
}

/* Vue.js クローク */
[v-cloak] {
    display: none;
}

/* ===========================
   ヘッダー
   =========================== */

.app-header {
    background-color: var(--theme-bg-primary, white);
    box-shadow: 0 1px 3px 0 var(--theme-shadow, rgba(0, 0, 0, 0.1));
    position: sticky;
    top: 0;
    z-index: 50;
}

/* ===========================
   ドロップダウンメニュー
   =========================== */

.dropdown {
    position: relative;
}

.dropdown-btn {
    padding: 0.5rem 0.5rem 0.5rem 0.75rem;
    background-color: transparent;
    color: var(--theme-text-secondary, #6b7280);
    border-radius: 0.375rem;
    font-size: 1.5rem;
    line-height: 1;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.dropdown-btn:hover {
    background-color: var(--theme-bg-secondary, #f3f4f6);
    color: var(--theme-text-primary, #374151);
}

.dropdown-btn:active {
    background-color: var(--theme-bg-tertiary, #e5e7eb);
}

/* 背景オーバーレイ */
.dropdown-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: transparent;
    z-index: 40;
}

/* ドロップダウンメニュー本体 */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    width: 200px;
    background-color: var(--theme-bg-primary, white);
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px var(--theme-shadow-large, rgba(0, 0, 0, 0.1)), 0 4px 6px -2px var(--theme-shadow-medium, rgba(0, 0, 0, 0.05));
    border: 1px solid var(--theme-border, transparent);
    z-index: 50;
    overflow: hidden;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 1rem;
    color: var(--theme-text-primary, #374151);
    background-color: var(--theme-bg-primary, white);
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: var(--theme-bg-secondary, #f3f4f6);
}

.dropdown-item:active {
    background-color: var(--theme-bg-tertiary, #e5e7eb);
}

.dropdown-item i {
    width: 1.25rem;
    color: var(--theme-brand-primary, #2563eb);
}

/* ===========================
   ユーザーメニュー
   =========================== */

.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: var(--theme-bg-primary, white);
    border: 1px solid var(--theme-border, #d1d5db);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    color: var(--theme-text-primary, #374151);
}

.user-menu-btn:hover {
    background-color: var(--theme-bg-secondary, #f9fafb);
    border-color: var(--theme-border-hover, #9ca3af);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .user-name {
        display: none;
    }

    .user-menu-btn {
        border: none;
        background-color: transparent;
        padding: 0.25rem;
    }

    .user-menu-btn:hover {
        background-color: var(--theme-bg-secondary, transparent);
        border-color: transparent;
    }

    .user-menu-btn .fa-chevron-down {
        display: none;
    }

    .login-btn {
        display: none;
    }
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    width: 250px;
    background-color: var(--theme-bg-primary, white);
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px var(--theme-shadow-large, rgba(0, 0, 0, 0.1)), 0 4px 6px -2px var(--theme-shadow-medium, rgba(0, 0, 0, 0.05));
    border: 1px solid var(--theme-border, transparent);
    z-index: 50;
    overflow: hidden;
}

.user-info {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--theme-border, #e5e7eb);
    background-color: var(--theme-bg-secondary, #f9fafb);
}

.user-email {
    font-size: 0.875rem;
    color: var(--theme-text-secondary, #6b7280);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-plan-badge {
    display: inline-flex;
    align-items: center;
    margin-top: 0.5rem;
    padding: 0.25rem 0.75rem;
    background-color: var(--theme-bg-tertiary, #eff6ff);
    border: 1px solid var(--theme-border, #bfdbfe);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--theme-brand-primary, #1e40af);
}

.user-plan-badge i.fa-crown {
    color: var(--theme-warning, #f59e0b);
}

.user-plan-badge i.fa-user {
    color: var(--theme-text-secondary, #6b7280);
}

.login-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--theme-brand-primary, #2563eb);
    color: #ffffff !important;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.login-btn:hover {
    background-color: var(--theme-brand-hover, #1d4ed8);
}

.login-btn:active {
    background-color: var(--theme-brand-hover, #1e40af);
}

.login-btn i {
    color: #ffffff !important;
}

/* ===========================
   ボタン共通スタイル
   =========================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
    min-width: 44px;
    min-height: 44px;
    border: none;
    outline: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--theme-brand-primary, #2563eb);
    color: #ffffff !important;
}

.btn-primary:hover {
    background-color: var(--theme-brand-hover, #1d4ed8);
}

.btn-primary i {
    color: #ffffff !important;
}

.btn-secondary {
    background-color: var(--theme-success, #10b981);
    color: #ffffff !important;
}

.btn-secondary:hover {
    background-color: var(--theme-success-hover, #059669);
}

.btn-secondary i {
    color: #ffffff !important;
}

/* ===========================
   モーダル
   =========================== */

.modal-fade-enter-active,
.modal-fade-leave-active {
    transition: opacity 0.3s ease;
}

.modal-fade-enter,
.modal-fade-leave-to {
    opacity: 0;
}

.modal-fade-enter-active .bg-white,
.modal-fade-leave-active .bg-white {
    transition: transform 0.3s ease;
}

.modal-fade-enter .bg-white {
    transform: scale(0.9);
}

.modal-fade-leave-to .bg-white {
    transform: scale(0.9);
}

/* ===========================
   スムーズスクロール
   =========================== */

html {
    scroll-behavior: smooth;
}

/* ===========================
   カスタムスクロールバー
   =========================== */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--theme-bg-secondary, #f1f1f1);
}

::-webkit-scrollbar-thumb {
    background: var(--theme-border-hover, #c1c1c1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--theme-text-secondary, #a8a8a8);
}

/* ===========================
   タップ時のハイライト無効化
   =========================== */

* {
    -webkit-tap-highlight-color: transparent;
}

/* ===========================
   テキスト選択の色
   =========================== */

::selection {
    background-color: var(--theme-brand-primary, #3b82f6);
    color: white;
}

::-moz-selection {
    background-color: var(--theme-brand-primary, #3b82f6);
    color: white;
}

/* ===========================
   レスポンシブ調整
   =========================== */

@media (max-width: 640px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    body {
        font-size: 14px;
    }

    h1, h2, h3 {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
}

@media (max-width: 375px) {
    body {
        font-size: 13px;
    }
}

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

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* ===========================
   Notyfのカスタムスタイル
   =========================== */

.notyf__wrapper{
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}

.notyf__toast {
    max-width: 500px !important;
    min-width: 300px !important;
    width: auto !important;
}

.notyf__message {
    color: white !important;
}

/* ===========================
   モーダルオーバーレイ
   =========================== */

.fixed.inset-0 {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
}
