/* プロフィール画面スタイル */
.profile-header {
    margin-bottom: 2rem;
}

.profile-header h2 {
    font-size: 2rem;
    color: #333;
    font-weight: 700;
}

.profile-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.profile-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.profile-section h3 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 1.5rem;
    font-weight: 600;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.5rem;
}

#profile-form .form-group,
.profile-form .form-group {
    margin-bottom: 1.5rem;
}

#profile-form label,
.profile-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
}

#profile-form input,
.profile-form input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

#profile-form input:focus,
.profile-form input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.save-btn {
    background: var(--brand-grad);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 広告アカウント一覧 */
.ad-accounts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ad-account-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 2px solid #f0f0f0;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.ad-account-item:hover {
    border-color: var(--blue);
    background-color: #f8f9ff;
}

/* アカウント設定 */
.account-settings {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.account-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 2px solid #f0f0f0;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.account-item:hover {
    border-color: var(--blue);
    background-color: #f8f9ff;
}

.account-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.account-id {
    font-family: 'Courier New', monospace;
    color: #666;
    font-size: 0.9rem;
}

.edit-btn {
    background: var(--brand-grad);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.edit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.add-account-btn {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    padding: 1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.add-account-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(17, 153, 142, 0.3);
}

/* 契約プランセクション */
.current-plan-info {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.current-plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.plan-free {
    background: #e2e8f0;
    color: #475569;
}

.plan-pro {
    background: var(--brand-grad);
    color: white;
}

.subscription-status,
.subscription-detail {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #555;
}

.status-label {
    font-weight: 600;
    margin-right: 0.5rem;
}

.status-active {
    color: #16a34a;
    font-weight: 600;
}

.status-past-due {
    color: #dc2626;
    font-weight: 600;
}

.cancel-notice {
    color: #d97706;
}

/* プランカード */
.plan-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.plan-card {
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.plan-card:hover {
    border-color: var(--blue);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
}

.plan-card-current {
    border-color: var(--blue);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
}

.plan-card-header {
    padding: 1.25rem;
    background: #f8f9fa;
    text-align: center;
}

.plan-card-header-pro {
    background: var(--brand-grad);
    color: white;
}

.plan-card-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.plan-card-price {
    font-size: 0.95rem;
}

.price-amount {
    font-size: 1.8rem;
    font-weight: 800;
}

.price-period {
    font-size: 0.9rem;
    opacity: 0.8;
}

.plan-card-body {
    padding: 1.25rem;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
}

.plan-features li {
    padding: 0.4rem 0;
    font-size: 0.9rem;
    color: #555;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.plan-features li i {
    color: var(--blue);
    width: 16px;
    text-align: center;
}

.plan-card-action {
    text-align: center;
    margin-bottom: 0.75rem;
}

.current-plan-label {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: #e2e8f0;
    color: #475569;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.upgrade-plan-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--brand-grad);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    /* Payment Linkは<a>で描画されるためボタンと見た目を揃える */
    box-sizing: border-box;
    text-decoration: none;
}

.upgrade-plan-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    color: white;
    text-decoration: none;
}

/* 未設定プラン・処理中は操作不可 */
.upgrade-plan-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: grayscale(1);
}

.upgrade-plan-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.cancel-plan-btn {
    width: 100%;
    padding: 0.5rem;
    background: transparent;
    color: #dc2626;
    border: 1px solid #dc2626;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.cancel-plan-btn:hover {
    background: #fef2f2;
}

/* 下位プランへの変更は控えめな見た目にする */
.downgrade-plan-btn,
.resume-plan-btn {
    width: 100%;
    padding: 0.75rem;
    background: #fff;
    color: var(--navy);
    border: 1px solid var(--navy);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-sizing: border-box;
}

.downgrade-plan-btn:hover,
.resume-plan-btn:hover {
    background: #f1f5f9;
}

.downgrade-plan-btn:disabled,
.resume-plan-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.resume-plan-btn {
    margin-top: 0.5rem;
}

.plan-action-note {
    margin: 0.5rem 0 0;
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.5;
}

.scheduled-plan-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.25rem;
    background: #fef3c7;
    color: #92400e;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .profile-container {
        grid-template-columns: 1fr;
    }

    .account-item {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .account-info {
        justify-content: center;
    }

    .plan-cards {
        grid-template-columns: 1fr;
    }
}