/**
 * デザイン改善CSS
 * モダンで洗練されたデザインへのアップグレード
 */

/* ========================================
   ページトップボタン
   ======================================== */

#page-top-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--purple-primary) !important;
    color: var(--white) !important;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(103, 98, 166, 0.3);
}

#page-top-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#page-top-btn:hover {
    background: var(--purple-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(103, 98, 166, 0.4);
}

/* モバイル対応 */
@media (max-width: 768px) {
    #page-top-btn {
        bottom: 80px; /* ボトムナビの上に配置 */
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }
}

/* ========================================
   ボタンのデザイン改善
   ======================================== */

/* すべてのボタンに共通のスタイル */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: none;
    letter-spacing: 0.025em;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* プライマリボタンの強化 */
.btn-primary {
    background: linear-gradient(135deg, #6762A6 0%, #524D88 100%) !important;
    color: var(--white) !important;
    border: 2px solid transparent !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(103, 98, 166, 0.25);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: linear-gradient(135deg, #524D88 0%, #4A4770 100%) !important;
    color: var(--white) !important;
    border-color: transparent !important;
    box-shadow: 0 6px 20px rgba(103, 98, 166, 0.35);
    text-decoration: none;
}

/* セカンダリボタンの改善 */
.btn-secondary {
    background: rgba(255, 255, 255, 0.95) !important;
    color: var(--purple-primary) !important;
    border: 2px solid var(--purple-primary) !important;
    font-weight: 600;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active {
    background: linear-gradient(135deg, #6762A6 0%, #524D88 100%) !important;
    color: var(--white) !important;
    border-color: transparent !important;
    box-shadow: 0 6px 20px rgba(103, 98, 166, 0.35);
    text-decoration: none;
}

/* ========================================
   カードのデザイン改善
   ======================================== */

.card {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: rgba(103, 98, 166, 0.2);
}

/* カードタイトルの改善 */
.card-title {
    font-weight: 700;
    background: linear-gradient(135deg, #6762A6, #8B84C7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   ヘッダーの改善
   ======================================== */

.site-header-modern {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header-main {
    background: transparent;
}

/* ロゴの改善 */
.site-logo-modern {
    transition: transform 0.3s ease;
}

.site-logo-modern:hover {
    transform: scale(1.05);
}

.logo-icon {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* ナビゲーションの改善 */
.nav-item {
    position: relative;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--purple-primary);
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.nav-item:hover::after {
    width: 80%;
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(103, 98, 166, 0.1) 0%, rgba(139, 132, 199, 0.1) 100%);
}

/* ========================================
   セクションの改善
   ======================================== */

.section {
    position: relative;
    overflow: hidden;
}

.section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(103, 98, 166, 0.03) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
    pointer-events: none;
}

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

/* セクションタイトルの改善 */
.section-title {
    position: relative;
    display: inline-block;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--purple-primary) 0%, var(--purple-light) 100%);
    border-radius: 2px;
}

/* ========================================
   フォームの改善
   ======================================== */

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    border-color: var(--purple-primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(103, 98, 166, 0.1);
}

/* ========================================
   アニメーション効果
   ======================================== */

/* フェードインアニメーション */
.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* スライドインアニメーション */
.slide-in-left {
    animation: slideInLeft 0.6s ease-out forwards;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   テーブルの改善
   ======================================== */

table {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

th {
    background: linear-gradient(135deg, #6762A6 0%, #524D88 100%);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

tr:hover {
    background: rgba(103, 98, 166, 0.05);
}

/* ========================================
   バッジの改善
   ======================================== */

.badge,
.announcement-badge {
    background: linear-gradient(135deg, rgba(103, 98, 166, 0.1) 0%, rgba(139, 132, 199, 0.1) 100%);
    border: 1px solid rgba(103, 98, 166, 0.2);
    color: var(--purple-dark);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* ========================================
   フッターの改善
   ======================================== */

.site-footer-modern {
    background: linear-gradient(180deg, rgba(247, 247, 252, 0.5) 0%, rgba(255, 255, 255, 1) 100%);
    border-top: 1px solid rgba(103, 98, 166, 0.1);
}

.footer-link {
    position: relative;
    padding-left: 1.5rem;
}

.footer-link::before {
    content: '→';
    position: absolute;
    left: 0;
    opacity: 0;
    transition: all 0.3s ease;
}

.footer-link:hover::before {
    left: 0.5rem;
    opacity: 1;
}

/* ========================================
   スクロールバーのカスタマイズ
   ======================================== */

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(103, 98, 166, 0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #8B84C7 0%, #6762A6 100%);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #6762A6 0%, #524D88 100%);
    background-clip: padding-box;
}

/* ========================================
   レスポンシブの改善
   ======================================== */

@media (max-width: 768px) {
    .btn {
        padding: 0.875rem 1.75rem;
        font-size: 1rem;
    }
    
    .section {
        padding: 3rem 0;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .card {
        margin-bottom: 1.5rem;
    }
}

/* ========================================
   アクセシビリティの改善
   ======================================== */

/* フォーカス状態の強化 */
*:focus-visible {
    outline: 3px solid var(--purple-primary);
    outline-offset: 2px;
}

/* リンクのアンダーライン */
a:not(.btn):not(.nav-item):hover {
    text-decoration: underline;
    text-decoration-color: var(--purple-primary);
    text-underline-offset: 3px;
}

/* ========================================
   ダークモード対応（将来の拡張用）
   ======================================== */

@media (prefers-color-scheme: dark) {
    /* ダークモード時のスタイル調整はここに追加 */
}

/* ========================================
   パフォーマンス最適化
   ======================================== */

/* GPU加速を有効化 */
.card,
.btn,
.nav-item {
    will-change: transform;
    transform: translateZ(0);
}

/* アニメーション無効化オプション */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}