/* ポップでタイポグラフィカルな精算指示のスタイル */
/* Googleフォントのインポート - バラエティに富んだタイポグラフィ */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;800;900&family=M+PLUS+Rounded+1c:wght@400;500;700;800;900&family=Quicksand:wght@500;700&display=swap');

/* 精算指示のスタイル */
.settlement-instructions-container {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px dashed rgba(74, 109, 167, 0.2);
    position: relative;
}

.settlement-instructions-container::before {
    content: "💸";
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    background-color: white;
    padding: 0 15px;
}

.instructions-heading {
    font-family: 'Poppins', 'M PLUS Rounded 1c', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: #4a6da7;
    text-align: center;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, #4A6DA7, #8BA3D0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.settlement-instructions {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.instruction-item {
    background-color: white;
    border-radius: 18px;
    padding: 1.2rem 1.8rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    position: relative;
    border-left: 5px solid #FF6B6B;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.instruction-item:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.08);
}

.instruction-people {
    display: flex;
    align-items: center;
    font-size: 1.25rem;
    font-family: 'Poppins', 'M PLUS Rounded 1c', sans-serif;
}

.from-person {
    font-weight: 700;
    color: #FF6B6B;
    position: relative;
    padding: 3px 10px;
    border-radius: 8px;
    background-color: rgba(255, 107, 107, 0.1);
}

.arrow {
    margin: 0 1.2rem;
    color: #8ba3d0;
    font-size: 1.4rem;
    font-weight: bold;
    position: relative;
    animation: arrowPulse 2s infinite;
}

@keyframes arrowPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.to-person {
    font-weight: 700;
    color: #4a6da7;
    position: relative;
    padding: 3px 10px;
    border-radius: 8px;
    background-color: rgba(74, 109, 167, 0.1);
}

.instruction-amount {
    font-weight: 700;
    font-size: 1.2rem;
    color: #ff6b6b;
    padding: 0.5rem 1rem;
    background-color: rgba(255, 107, 107, 0.1);
    border-radius: 50px;
}

/* 収支表示のスタイル */
.total-amount-display {
    background: linear-gradient(135deg, #58E6D9 0%, #2eb8ac 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.8rem;
    text-align: center;
    color: white;
    box-shadow: 0 5px 15px rgba(46, 184, 172, 0.2);
    animation: fade-in 0.8s ease;
}

.total-label {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 0.3rem;
    letter-spacing: 1px;
}

.total-value {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.positive-balance {
    color: #4CAF50;
    font-weight: 600;
}

.negative-balance {
    color: #f44336;
    font-weight: 600;
}

.receive-tag {
    display: inline-block;
    background-color: #4CAF50;
    color: white;
    padding: 0.25rem 0.7rem;
    border-radius: 100px;
    font-size: 0.8rem;
}

/* 立替情報のスタイル */
.expense-breakdown {
    padding: 0;
}

.expense-item {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.expense-item:last-child {
    border-bottom: none;
}

.expense-name {
    font-weight: 500;
    margin-right: 1rem;
    color: #555;
}

.expense-amount {
    font-weight: 500;
    color: #777;
}

.advanced-amount {
    color: #2196f3;
}

/* 立替情報のカードスタイル */
.advanced-payment-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-gap: 20px;
    margin-top: 1rem;
}

.advanced-payment-card {
    background-color: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    overflow: hidden;
}

.advanced-payment-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.payer-info {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.payer-avatar {
    font-size: 1.8rem;
    margin-right: 0.8rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.payer-name {
    font-weight: 600;
    font-size: 1.2rem;
    flex: 1;
}

.total-paid {
    font-weight: 700;
    font-size: 1.2rem;
    color: #2196f3;
    padding: 0.3rem 0.8rem;
    background-color: rgba(33, 150, 243, 0.1);
    border-radius: 50px;
}

.expense-list {
    max-height: 200px;
    overflow-y: auto;
}

/* 精算テーブル内のボタンスタイリング改善 */
.settlement-table td:last-child {
    text-align: center;
    padding: 0.8rem;
}

.settlement-table .unpaid-button {
    white-space: nowrap;
    min-width: auto;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .unpaid-button {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
        gap: 0.3rem;
    }
    
    .settlement-table td:last-child {
        padding: 0.6rem 0.4rem;
    }
    
    .paid-tag, .receive-tag, .neutral-tag {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
    
    .payment-instructions {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .instruction-title {
        font-size: 1rem;
    }
    
    .instruction-text {
        font-size: 0.9rem;
    }
    
    .total-amount-display {
        padding: 1rem;
    }
    
    .total-value {
        font-size: 1.8rem;
    }
}

/* テーブルのホバー効果 */
.settlement-table tbody tr:hover {
    background-color: #f9f9f9;
    transition: background-color 0.2s ease;
}

.settlement-table tbody tr:hover .unpaid-button {
    transform: scale(1.05);
}

/* メディアクエリ - モバイル対応 */
@media (max-width: 767px) {
    .shared-event-container {
        padding: 1.5rem 1rem;
    }
    
    .event-title {
        font-size: 2rem;
    }
    
    .share-card {
        padding: 1.5rem;
    }
    
    .instruction-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .instruction-amount {
        margin-top: 0.8rem;
    }
    
    .advanced-payment-container {
        grid-template-columns: 1fr;
    }
}
