/* ===========================
   紹介ページ統一CSS
   全ての紹介ページ関連スタイルを整理統合
   =========================== */

/* ===========================
   1. 基本レイアウト
   =========================== */
/* ダッシュボードレイアウト */
.dashboard {
    display: flex;
    min-height: 100vh;
    background: #f8f9fa;
}

/* サイドバー */
.sidebar {
    width: 260px;
    flex-shrink: 0;
    background: white;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

/* メインコンテンツ - 統一定義 */
.main-content {
    flex: 1;
    width: calc(100% - 260px);
    overflow-y: auto;
    background: #f8f9fa;
}

/* コンテンツヘッダー */
.content-header {
    background: white;
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

/* コンテンツボディ */
.content-body {
    padding: 0 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* ===========================
   2. 紹介ページ専用要素
   =========================== */
/* ページ説明 */
.page-intro {
    margin-bottom: 2rem;
}

.page-description {
    background: linear-gradient(135deg, #e0eaff 0%, #f0f4ff 100%);
    border-left: 4px solid #0066ff;
    padding: 1.25rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-description i {
    font-size: 1.25rem;
    color: #0066ff;
    flex-shrink: 0;
}

/* ポイントサマリー */
.points-summary {
    background: linear-gradient(135deg, #e8f8ff 0%, #f0f9ff 100%);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.points-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.point-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.point-item:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.point-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #0066ff 0%, #0052cc 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* 紹介の流れ */
.referral-steps {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.steps-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2rem;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
}

.step-icon {
    width: 80px;
    height: 80px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    color: #0066ff;
}

/* 紹介リンク管理 - 統一定義 */
.referral-links {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    color: #212529;
    font-size: 1.5rem;
    font-weight: 700;
}

/* リンクアイテム - 統一定義 */
.link-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.link-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: #dbeafe;
}

.link-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.link-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.link-actions {
    display: flex;
    gap: 0.5rem;
}

.link-actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.link-actions .btn i {
    color: #ffffff;
}

/* タブセクション */
.tabs-section {
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tab-navigation {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
}

.tab-button {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.3s ease;
    position: relative;
}

.tab-button.active {
    color: #0066ff;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #0066ff;
}

/* ===========================
   3. モーダル関連（統一定義）
   =========================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    position: relative;
    animation: modalFadeIn 0.3s ease-out;
}

.modal-content.compact {
    max-width: 400px;
    padding: 1.5rem;
}

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

/* 共有ボタン - 統一定義 */
.share-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin: 1rem 0;
    padding: 0 0.5rem;
}

.share-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f3f4f6;
    color: #6b7280;
    position: relative;
    overflow: hidden;
    flex: 1;
    min-width: 0;
    max-width: 120px;
    white-space: nowrap;
}

.share-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* SNS別カラー */
.share-button.twitter {
    background: #e8f3fd;
    color: #1DA1F2;
}

.share-button.twitter:hover {
    background: #d6eafc;
    box-shadow: 0 4px 12px rgba(29, 161, 242, 0.15);
}

.share-button.line {
    background: #e8f7e8;
    color: #00B900;
}

.share-button.line:hover {
    background: #d6f0d6;
    box-shadow: 0 4px 12px rgba(0, 185, 0, 0.15);
}

.share-button.facebook {
    background: #e8f0fe;
    color: #1877F2;
}

.share-button.facebook:hover {
    background: #d6e4fd;
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.15);
}

.share-button.email {
    background: #f3e8ff;
    color: #7c3aed;
}

.share-button.email:hover {
    background: #e9d5ff;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
}

/* ===========================
   4. フォーム要素
   =========================== */
/* 基本フォーム要素 */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* リンク作成フォーム */
.link-create-form {
    background: #f3f4f6;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* フィルターセクション */
.filter-section {
    padding: 1rem 0;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.filter-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
}

/* キャッシュアウトボタン */
.cashout-button {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 1.5rem auto 0;
    padding: 1rem 2rem;
    background: #0066ff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.cashout-button:not(:disabled):hover {
    background: #0052cc;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 255, 0.4);
}

.cashout-button:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ===========================
   5. z-index管理（統一）
   =========================== */
.sidebar { z-index: 100; }
.mobile-sidebar { z-index: 999; }
.user-dropdown { z-index: 200; }
.notification-dropdown { z-index: 200; }
.modal { z-index: 10000; }

/* ===========================
   5. レスポンシブデザイン
   =========================== */
/* PC画面（1024px以上） */
@media (min-width: 1024px) {
    .main-content {
        padding: 2rem;
    }
    
    .content-body {
        padding: 0 3rem;
        max-width: 1400px;
    }
    
    .points-summary,
    .referral-steps,
    .referral-links,
    .tabs-section {
        margin-bottom: 2.5rem;
    }
}

/* 大画面（1440px以上） */
@media (min-width: 1440px) {
    .main-content {
        padding: 2rem 3rem;
    }
    
    .content-body {
        padding: 0 4rem;
        max-width: 1600px;
    }
}

/* 超大画面（1920px以上） */
@media (min-width: 1920px) {
    .content-body {
        max-width: 1800px;
        padding: 0 5rem;
    }
}

/* タブレット（768px〜1023px） */
@media (max-width: 1023px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        width: 100%;
        padding: 1rem;
    }
    
    .content-body {
        padding: 0 1rem;
        max-width: 100%;
    }
    
    .points-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .steps-container {
        flex-direction: column;
        gap: 2rem;
    }
}

/* モバイル（640px以下） */
@media (max-width: 640px) {
    .points-grid {
        grid-template-columns: 1fr;
    }
    
    .share-button {
        padding: 0.5rem;
        font-size: 0.75rem;
        gap: 0.25rem;
        min-width: 60px;
        max-width: 80px;
    }
    
    .modal-content {
        width: 95%;
        margin: 0.5rem;
        max-height: 95vh;
    }
    
    .modal-content.compact {
        padding: 1rem;
    }
}

/* 極小画面（480px以下） */
@media (max-width: 480px) {
    .share-button {
        font-size: 0;
        padding: 0.75rem;
        width: 44px;
        height: 44px;
        min-width: unset;
        max-width: unset;
        justify-content: center;
    }
    
    .share-button i {
        font-size: 1.25rem;
        margin: 0;
    }
    
    .share-button span {
        display: none;
    }
}